Get rid of QWindow::WindowType and clean up Qt::WindowFlags instead.
(cherry picked from commit 72176bf2a490d2f831d53a66a0987213efa60935)bb10
parent
96b872506a
commit
45272d5e45
|
|
@ -292,13 +292,7 @@ public:
|
|||
WindowContextHelpButtonHint = 0x00010000,
|
||||
WindowShadeButtonHint = 0x00020000,
|
||||
WindowStaysOnTopHint = 0x00040000,
|
||||
// reserved for Qt3Support:
|
||||
// WMouseNoMask = 0x00080000,
|
||||
// WDestructiveClose = 0x00100000,
|
||||
// WStaticContents = 0x00200000,
|
||||
// WGroupLeader = 0x00400000,
|
||||
// WShowModal = 0x00800000,
|
||||
// WNoMousePropagation = 0x01000000,
|
||||
|
||||
CustomizeWindowHint = 0x02000000,
|
||||
WindowStaysOnBottomHint = 0x04000000,
|
||||
WindowCloseButtonHint = 0x08000000,
|
||||
|
|
@ -308,56 +302,6 @@ public:
|
|||
WindowCancelButtonHint = 0x00100000,
|
||||
WindowSoftkeysVisibleHint = 0x40000000,
|
||||
WindowSoftkeysRespondHint = 0x80000000
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
,
|
||||
WMouseNoMask = 0x00080000,
|
||||
WDestructiveClose = 0x00100000,
|
||||
WStaticContents = 0x00200000,
|
||||
WGroupLeader = 0x00400000,
|
||||
WShowModal = 0x00800000,
|
||||
WNoMousePropagation = 0x01000000,
|
||||
|
||||
WType_TopLevel = Window,
|
||||
WType_Dialog = Dialog,
|
||||
WType_Popup = Popup,
|
||||
WType_Desktop = Desktop,
|
||||
WType_Mask = WindowType_Mask,
|
||||
|
||||
WStyle_Customize = 0,
|
||||
WStyle_NormalBorder = 0,
|
||||
WStyle_DialogBorder = MSWindowsFixedSizeDialogHint,
|
||||
WStyle_NoBorder = FramelessWindowHint,
|
||||
WStyle_Title = WindowTitleHint,
|
||||
WStyle_SysMenu = WindowSystemMenuHint,
|
||||
WStyle_Minimize = WindowMinimizeButtonHint,
|
||||
WStyle_Maximize = WindowMaximizeButtonHint,
|
||||
WStyle_MinMax = WStyle_Minimize | WStyle_Maximize,
|
||||
WStyle_Tool = Tool,
|
||||
WStyle_StaysOnTop = WindowStaysOnTopHint,
|
||||
WStyle_ContextHelp = WindowContextHelpButtonHint,
|
||||
|
||||
// misc flags
|
||||
WPaintDesktop = 0,
|
||||
WPaintClever = 0,
|
||||
|
||||
WX11BypassWM = X11BypassWindowManagerHint,
|
||||
WWinOwnDC = MSWindowsOwnDC,
|
||||
WMacSheet = Sheet,
|
||||
WMacDrawer = Drawer,
|
||||
|
||||
WStyle_Splash = SplashScreen,
|
||||
|
||||
WNoAutoErase = 0,
|
||||
WRepaintNoErase = 0,
|
||||
WNorthWestGravity = WStaticContents,
|
||||
WType_Modal = Dialog | WShowModal,
|
||||
WStyle_Dialog = Dialog,
|
||||
WStyle_NoBorderEx = FramelessWindowHint,
|
||||
WResizeNoErase = 0,
|
||||
WMacNoSheet = 0
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_FLAGS(WindowFlags, WindowType)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class QPlatformWindowPrivate
|
|||
{
|
||||
QWindow *window;
|
||||
QRect rect;
|
||||
Qt::WindowFlags flags;
|
||||
friend class QPlatformWindow;
|
||||
};
|
||||
|
||||
|
|
@ -115,19 +114,9 @@ void QPlatformWindow::setVisible(bool visible)
|
|||
Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
|
||||
{
|
||||
Q_D(QPlatformWindow);
|
||||
d->flags = flags;
|
||||
return flags;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the effective window flags for this surface.
|
||||
*/
|
||||
Qt::WindowFlags QPlatformWindow::windowFlags() const
|
||||
{
|
||||
Q_D(const QPlatformWindow);
|
||||
return d->flags;
|
||||
}
|
||||
|
||||
/*!
|
||||
Reimplement in subclasses to return a handle to the native window
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ public:
|
|||
|
||||
virtual void setVisible(bool visible);
|
||||
virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
|
||||
virtual Qt::WindowFlags windowFlags() const;
|
||||
virtual WId winId() const;
|
||||
virtual void setParent(const QPlatformWindow *window);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,10 +93,11 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
|
|||
|
||||
QWindow *win = topData()->window;
|
||||
|
||||
// translate window type
|
||||
// window->setWindowType();
|
||||
win->setWindowFlags(data.window_flags);
|
||||
win->create();
|
||||
|
||||
data.window_flags = win->windowFlags();
|
||||
|
||||
if (!surface ) {
|
||||
if (win) {
|
||||
surface = QApplicationPrivate::platformIntegration()->createWindowSurface(win, win->winId());
|
||||
|
|
@ -105,8 +106,6 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
|
|||
}
|
||||
}
|
||||
|
||||
// data.window_flags = q->windowHandle()->setWindowFlags(data.window_flags);
|
||||
|
||||
setWinId(win->winId());
|
||||
|
||||
// first check children. and create them if necessary
|
||||
|
|
@ -195,8 +194,8 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
|
|||
}
|
||||
|
||||
bool explicitlyHidden = q->testAttribute(Qt::WA_WState_Hidden) && q->testAttribute(Qt::WA_WState_ExplicitShowHide);
|
||||
|
||||
// Reparenting toplevel to child
|
||||
|
||||
// Reparenting toplevel to child
|
||||
if (!(f&Qt::Window) && (oldFlags&Qt::Window) && !q->testAttribute(Qt::WA_NativeWindow)) {
|
||||
//qDebug() << "setParent_sys() change from toplevel";
|
||||
q->destroy();
|
||||
|
|
@ -207,13 +206,6 @@ void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f)
|
|||
q->setAttribute(Qt::WA_WState_Visible, false);
|
||||
q->setAttribute(Qt::WA_WState_Hidden, false);
|
||||
|
||||
if (f & Qt::Window) {
|
||||
//qDebug() << "setParent_sys" << q << newparent << hex << f;
|
||||
// if (QPlatformWindow *window = q->platformWindow())
|
||||
// data.window_flags = window->setWindowFlags(data.window_flags);
|
||||
// Q_ASSERT(false);
|
||||
}
|
||||
|
||||
if (q->isWindow() || (!newparent || newparent->isVisible()) || explicitlyHidden)
|
||||
q->setAttribute(Qt::WA_WState_Hidden);
|
||||
q->setAttribute(Qt::WA_WState_ExplicitShowHide, explicitlyHidden);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class QWindowPrivate : public QObjectPrivate
|
|||
public:
|
||||
QWindowPrivate()
|
||||
: QObjectPrivate()
|
||||
, windowType(QWindow::Window)
|
||||
, windowFlags(Qt::Window)
|
||||
, surfaceType(QWindow::RasterSurface)
|
||||
, platformWindow(0)
|
||||
, glContext(0)
|
||||
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
}
|
||||
|
||||
QWindow::WindowType windowType;
|
||||
Qt::WindowFlags windowFlags;
|
||||
QWindow::SurfaceType surfaceType;
|
||||
|
||||
QPlatformWindow *platformWindow;
|
||||
|
|
@ -116,8 +116,10 @@ void QWindow::setVisible(bool visible)
|
|||
void QWindow::create()
|
||||
{
|
||||
Q_D(QWindow);
|
||||
if (!d->platformWindow)
|
||||
if (!d->platformWindow) {
|
||||
d->platformWindow = QApplicationPrivate::platformIntegration()->createPlatformWindow(this);
|
||||
d->windowFlags = d->platformWindow->setWindowFlags(d->windowFlags);
|
||||
}
|
||||
Q_ASSERT(d->platformWindow);
|
||||
}
|
||||
|
||||
|
|
@ -172,16 +174,19 @@ QWindow::SurfaceType QWindow::surfaceType() const
|
|||
return d->surfaceType;
|
||||
}
|
||||
|
||||
void QWindow::setWindowType(WindowType type)
|
||||
void QWindow::setWindowFlags(Qt::WindowFlags flags)
|
||||
{
|
||||
Q_D(QWindow);
|
||||
d->windowType = type;
|
||||
if (d->platformWindow)
|
||||
d->windowFlags = d->platformWindow->setWindowFlags(flags);
|
||||
else
|
||||
d->windowFlags = flags;
|
||||
}
|
||||
|
||||
QWindow::WindowType QWindow::type() const
|
||||
Qt::WindowFlags QWindow::windowFlags() const
|
||||
{
|
||||
Q_D(const QWindow);
|
||||
return d->windowType;
|
||||
return d->windowFlags;
|
||||
}
|
||||
|
||||
void QWindow::setWindowTitle(const QString &title)
|
||||
|
|
|
|||
|
|
@ -76,17 +76,6 @@ class Q_GUI_EXPORT QWindow : public QObject
|
|||
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle)
|
||||
|
||||
public:
|
||||
enum WindowType {
|
||||
Window,
|
||||
Dialog,
|
||||
Popup,
|
||||
Tool,
|
||||
SplashScreen,
|
||||
ToolTip,
|
||||
Sheet,
|
||||
Drawer
|
||||
};
|
||||
|
||||
enum SurfaceType {
|
||||
RasterSurface,
|
||||
OpenGLSurface
|
||||
|
|
@ -112,8 +101,8 @@ public:
|
|||
void setSurfaceType(SurfaceType type);
|
||||
SurfaceType surfaceType() const;
|
||||
|
||||
void setWindowType(WindowType type);
|
||||
WindowType type() const;
|
||||
void setWindowFlags(Qt::WindowFlags flags);
|
||||
Qt::WindowFlags windowFlags() const;
|
||||
|
||||
QString windowTitle() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ Qt::WindowFlags QXcbWindow::setWindowFlags(Qt::WindowFlags flags)
|
|||
Q_XCB_CALL(xcb_change_window_attributes(xcb_connection(), m_window, mask, values));
|
||||
}
|
||||
|
||||
return QPlatformWindow::setWindowFlags(flags);
|
||||
return flags;
|
||||
}
|
||||
|
||||
void QXcbWindow::setNetWmWindowTypes(Qt::WindowFlags flags)
|
||||
|
|
|
|||
Loading…
Reference in New Issue