dwindowgroupleader_zh
2022-04-14 15:20:27

Class::DWindowGroupLeader

暂无该属性


Detailed Description

~chinese

~chinese

DWindowGroupLeader 用于设置窗口所在的组,可以把多个窗口加到同一个组。在dxcb平台上,所有未指定组的 ~chinese 窗口都会被分配到 DWindowGroupLeader::clientLeaderId 这个组,且在窗口对应的本地窗口被创建时,会对 ~chinese Qt::Dialog、Qt::Sheet、Qt::Tool、Qt::SplashScreen、Qt::ToolTip、Qt::Drawer、Qt::Popup ~chinese 类型的窗口设置 WM_TRANSIENT_FOR 属性,对于此类型的窗口,如果没有手动调用 QWindow::setTransientParent , ~chinese 则会将其 WM_TRANSIENT_FOR 属性设置为所在组id,得到的效果就是:会保证此窗口显示到这个组所有其它窗口 ~chinese 之上。例子: ~chinese

DWindowGroupLeader leader;
QWindow wa, wb;
QWindow topWindow;

leader.addWindow(&wa);
leader.addWindow(&wb);
leader.addWindow(&topWindow);

wa.setTitle("窗口wa");
wa.resize(300, 100);
wa.show();
wb.setTitle("窗口wb");
wb.resize(300, 100);
wb.show();
topWindow.setTitle("窗口topWindow");
topWindow.setFlag(Qt::Dialog);
topWindow.resize(300, 300);
topWindow.show();

~chinese 窗口topWindow一直处于窗口wa和wb上层 ~chinese

image

~chinese 如果一个组内同时存在多个未设置过 QWindow::setTransientParent 的 Qt::Dialog(其它会自动设置 WM_TRANSIENT_FOR ~chinese 属性的窗口也成立)类型的窗口,这些窗口之间不会互相影响显示顺序,具体的规则和 X11 ICCCM 标准一致。 ~chinese

~chinese

~chinese

See also https://tronche.com/gui/x/icccm/sec-4.html#WM_TRANSIENT_FOR DWindowGroupLeader::clientLeaderId DApplication::loadDXcbPlugin

DWindowGroupLeader::DWindowGroupLeader

[public constructor  ]

DWindowGroupLeader(int groupId) ~chinese

DWindowGroupLeader::DWindowGroupLeader ~chinese groupId 为0时会在需要时自动创建一个有效的 groupLeaderId ~chinese See also DWindowGroupLeader::groupLeaderId

DWindowGroupLeader::~DWindowGroupLeader

[public destructor  ]

~DWindowGroupLeader() ~chinese

DWindowGroupLeader::~ DWindowGroupLeader ~chinese 对象销毁时会释放由自己自动创建的 groupLeaderId ~chinese See also DWindowGroupLeader::groupLeaderId

DWindowGroupLeader::groupLeaderId

[public plain  ]

int groupLeaderId() const ~chinese

~chinese Returns 返回组的id,类似于 QWindow::winId ~chinese Warning: 如果没有一个有效的id,则会先创建一个新的组id

DWindowGroupLeader::clientLeaderId

[public plain  ]

int clientLeaderId() const ~chinese

~chinese Returns 返回应用程序默认的组id

DWindowGroupLeader::addWindow

[public plain  ]

void addWindow(int *window) ~chinese

~chinese 将窗口添加到这个组 ~chinese window ~chinese Warning: 每个窗口只能有一个组,添加到新的组时,将不再受旧的组所带来的任何影响

DWindowGroupLeader::removeWindow

[public plain  ]

void removeWindow(int *window) ~chinese

~chinese 将窗口从这个组中移除 ~chinese window ~chinese Warning: 窗口被移除后将不再受此组带来的任何影响