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. Vim 标签定义

    一.单个文件: m+标记字符 打上标记,如在开头行按ms(start),标记开头: 如需返回到自己的标记点,按`+标记字符就行: 二.多个文件: m+大写标记字符 如果删除了标签的行,同时也删除了标签 ...

  2. <再看TCP/IP第一卷>关于网络层及协议细节---IP协议(2)--移动IP及DHCP

    题外话:本来想按照互联网的层级自下向上回顾这些协议的,但是今天实在得破个例,DHCP不得不说! 主机从一个网络迁移到另一个网络,那么IP编址的结构就要发生改变,当今主流有如下几种修改方案: (一)改变 ...

  3. Delphi中 为DBNavigator的按钮加中文

    Delphi中 为DBNavigator的按钮加中文 /*Delphi中数据库控件DBNavigator使用起来不错,但是按钮上“+”.“-”等含义对于中国的用户不习惯,甚至不知道是什么含义.改成相应 ...

  4. Oracle的PL_SQL的异常处理

    --什么是异常 --异常是在PL/SQL运行过程中有可能出现的错误. --执行异常的语句 exception when [异常] when --异常输出信息. --Oracle的预定义异常 CASE_ ...

  5. 用 CSS3 创建一个漂亮的多种色彩的菜单

    1. [图片] thumb.png ​2. [代码][HTML]代码 <!DOCTYPE html><html lang="en" >    <hea ...

  6. vue2.0 构建单页应用最佳实战

    vue2.0 构建单页应用最佳实战   前言 我们将会选择使用一些 vue 周边的库vue-cli, vue-router,vue-resource,vuex 1.使用 vue-cli 创建项目2.使 ...

  7. (转)通过汇编语言实现C协程

    转自:http://www.cnblogs.com/sniperHW/archive/2012/06/19/2554574.html 协程的概念就不介绍了,不清楚的同学可以自己google,windo ...

  8. Struts2 - 异常处理: exception-mapping 元素

    异常处理: exception-mapping 元素 在action方法中添加 int i=1/0; 请求action后,结果为: 在struts.xml中添加异常处理:exception-mappi ...

  9. 串行总线 —— I2C、UART、SPI

    I2C,也叫 IIC,是一种常见的串行总线,它只需要两根线即可在连接于总线上的器件之间传送信息. 0. 电气知识 开漏输出:Open drain output,不输出电压,低电平时接地,高电平时不接地 ...

  10. [原]NYOJ-6174问题-57

    大学生程序代写 /*6174问题 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 假设你有一个各位数字互不相同的四位数,把所有的数字从大到小排序后得到a,从小到大后得到b ...