-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: ajust window flags #380
base: master
Are you sure you want to change the base?
Conversation
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#380
Doc Check bot |
@@ -319,6 +340,12 @@ DQuickWindowAttached::DQuickWindowAttached(QWindow *window) | |||
: QObject(window) | |||
, DObject(*new DQuickWindowAttachedPrivate(window, this)) | |||
{ | |||
auto windowFlags = window->flags(); | |||
if (window->isTopLevel()) { | |||
fixTopLevelWindowFlags(windowFlags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个行为,应该让window的创建者自己设置吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
widget 里面是 qwidgetwindow 主动做了这个事,默认窗口只有 Qt::Window
这个 flag
如果让创建者自己设置,那么所有的窗口都需要自行处理一次,包括我的example也没有最大化、最小化、关闭按钮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flags: Qt.Window | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMinimizeButtonHint | Qt.WindowMaximizeButtonHint
应用 倒是也可以这么设置
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个操作会不会覆盖了应用在Window设置的flags,
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: FeiWang1119, kegechen The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
TAG Bot New tag: 5.6.34 |
fix window flags is always Qt::Window
f8235a8
to
0f0192a
Compare
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#380
deepin pr auto review关键摘要:
是否建议立即修改: |
TAG Bot New tag: 5.0.35 |
switch (flags) { | ||
case Qt::Window: | ||
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | ||
|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
flags |= Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | ||
|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint; | ||
break; | ||
case Qt::Dialog: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q_FALLTHROUGH
这是解决啥bug? |
fix window flags is always Qt::Window