ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

【Qt文档阅读】Window and Dialog Widgets

2019-06-04 21:39:48  阅读:277  来源: 互联网

标签:manager 窗口 Qt frame window QWidget Window Dialog


Window and Dialog Widgets

没有嵌入到父控件中的控件(widget)称之为窗口(window)。通常窗口带有边框和标题栏。

Windows通常集成到桌面环境中,并且在某种程度上由桌面环境提供的窗口管理系统管理。例如,应用程序的选定窗口在任务栏中表示。

Primary and Secondary Windows

任何没有父组件的QWidget都将成为一个窗口,并且在大多数平台上都将在桌面的任务栏中列出。这通常只适用于应用程序中的一个窗口,即主窗口。

此外,通过设置Qt:: window标志,具有父组件的QWidget可以成为一个窗口。根据窗口管理系统的不同,这些辅助窗口通常堆叠在各自的父窗口之上,并且没有自己的任务栏条目。

QMainWindow类在其构造函数中设置了Qt::Window标志,因为它被设计为用作窗口,并提供了子部件不需要的工具。

Main Windows and Dialogs

Window Geometry

X11 Peculiarities

On X11, a window does not have a frame until the window manager decorates it. This happens asynchronously at some point in time after calling QWidget::show() and the first paint event the window receives, or it does not happen at all. Bear in mind that X11 is policy-free (others call it flexible). Thus you cannot make any safe assumption about the decoration frame your window will get. Basic rule: There's always one user who uses a window manager that breaks your assumption, and who will complain to you.

Furthermore, a toolkit cannot simply place windows on the screen. All Qt can do is to send certain hints to the window manager. The window manager, a separate process, may either obey, ignore or misunderstand them. Due to the partially unclear Inter-Client Communication Conventions Manual (ICCCM), window placement is handled quite differently in existing window managers.

X11 provides no standard or easy way to get the frame geometry once the window is decorated. Qt solves this problem with nifty heuristics and clever code that works on a wide range of window managers that exist today. Don't be surprised if you find one where QWidget::frameGeometry() returns wrong results though.

Nor does X11 provide a way to maximize a window. QWidget::showMaximized() has to emulate the feature. Its result depends on the result of QWidget::frameGeometry() and the capability of the window manager to do proper window placement, neither of which can be guaranteed.

标签:manager,窗口,Qt,frame,window,QWidget,Window,Dialog
来源: https://www.cnblogs.com/pplxlee/p/10976338.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有