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.

【Qt文档阅读】Window and Dialog Widgets的更多相关文章

  1. 【Qt文档阅读】事件系统

    在Qt中,事件对象都继承于QEvent类,它表示应用程序内部或由于应用程序需要了解的外部活动而发生的事情.事件可以由QObject子类的任何实例接收和处理,尤其是widget.本文档描述如何在典型应用 ...

  2. Qt文档阅读笔记-QGraphicsItem::paint中QStyleOptionGraphicsItem *option的进一步认识

    官方解析 painter : 此参数用于绘图;option : 提供了item的风格,比如item的状态,曝光度以及详细的信息:widget : 想画到哪个widget上,如果要画在缓存区上,这个参数 ...

  3. 生成 Qt 文档

    个人总结    从命令行进入Qt安装目录     设置环境变量     set path=D:/mingw32/bin;D:/Qt/5.0.0/qtbase/bin;D:/icu/bin;D:/icu ...

  4. Node.js的下载、安装、配置、Hello World、文档阅读

    Node.js的下载.安装.配置.Hello World.文档阅读

  5. 我的Cocos Creator成长之路1环境搭建以及基本的文档阅读

    本人原来一直是做cocos-js和cocos-lua的,应公司发展需要,现转型为creator.会在自己的博客上记录自己的成长之路. 1.文档阅读:(cocos的官方文档) http://docs.c ...

  6. 转:苹果Xcode帮助文档阅读指南

    一直想写这么一个东西,长期以来我发现很多初学者的问题在于不掌握学习的方法,所以,Xcode那么好的SDK文档摆在那里,对他们也起不到什么太大的作用.从论坛.微博等等地方看到的初学者提出的问题,也暴露出 ...

  7. Keras 文档阅读笔记(不定期更新)

    目录 Keras 文档阅读笔记(不定期更新) 模型 Sequential 模型方法 Model 类(函数式 API) 方法 层 关于 Keras 网络层 核心层 卷积层 池化层 循环层 融合层 高级激 ...

  8. Django文档阅读-Day1

    Django文档阅读-Day1 Django at a glance Design your model from djano.db import models #数据库操作API位置 class R ...

  9. Django文档阅读-Day2

    Django文档阅读 - Day2 Writing your first Django app, part 1 You can tell Django is installed and which v ...

随机推荐

  1. 启动Hive时报错

    报错信息如下 Logging initialized -bin/lib/hive-common-.jar!/hive-log4j.properties Exception in thread &quo ...

  2. 用python实现的抓取腾讯视频所有电影的爬虫

    1. [代码]用python实现的抓取腾讯视频所有电影的爬虫    # -*- coding: utf-8 -*-# by awakenjoys. my site: www.dianying.atim ...

  3. js中innerText/value/innerHTML三个属性的区别

    在做一个两个窗口之间的简单信息交互时遇见了一点问题,导致信息无法正常的传递. 最后发现问题是在innerText和value这两个属性上,先简单的总结记录一下几个相似的属性的作用: 1.innerTe ...

  4. (转)edm注意事项

    格式编码 1.页面宽度请设定在600到800px以内,长度1024px以内. 2.HTML编码请使用utf-8. 3.HTML代码在15KB以内.(各个邮箱的收件标准不一样,如果超出15KB您的邮件很 ...

  5. Saiku_学习_02_Schema Workbench 开发mdx和模式文件

    一.前言 saiku的查询都是通过cube来进行的.因此每当我们要进行一次多维度查询时,都要先修改xml.上传.重启才能生效,不仅效率低,还不利于学习和理解MDX和模式文件. 通过 workbench ...

  6. Java钉钉开发_异常_01_error code:50002, error message:请求的员工userid不在授权范围内

    一.异常原因: 请求的员工不在 应用的可见范围内. 如下图,应用的可见范围只设置为了部分员工.所以导致此异常 二.异常解决 将员工添加进可见范围即可

  7. QListWidget拖放

    setDragEnabled() 允许拖 setAcceptDrops()允许放 setDragDropMode(QAbstractItemView.DragDrop)设置拖拽模式 setSelect ...

  8. 利用bootsrap控件 实现文件上传功能

    源代码实例:https://github.com/kartik-v/bootstrap-fileinput 一.jsp页面 <%@ page language="java" ...

  9. Silk codec的一些资料

    Skype表示它最近将开始向第三方开发人员和硬件制造商提供免版税认证(RF)的Silk宽带音频编码器. Silk下载地址如下 http://developer.skype.com/silk/SILK_ ...

  10. C#实现根据传入时间段,找出时间段内日期,并生成相对应文件路径

    [1]获取固定日期范围内的所有日期,以数组形式返回 /// <summary>        /// 获取固定日期范围内的所有日期,以数组形式返回        /// </summ ...