Cocoa: Use private property to enable NSWindow child windows
Enabled for QToolBar to allow it to overlap OpenGL widgets when expanding. Task-number: QTBUG-33082 Change-Id: I76dc8da52bc04eedc6d6779c48753da100ed1c9f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>bb10
parent
323ce42de6
commit
624df9cf7f
|
|
@ -1215,11 +1215,18 @@ QCocoaGLContext *QCocoaWindow::currentContext() const
|
|||
void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
|
||||
{
|
||||
bool wasNSWindowChild = m_isNSWindowChild;
|
||||
// TODO Set value for m_isNSWindowChild here
|
||||
m_isNSWindowChild = parentWindow && (window()->property("_q_platform_MacUseNSWindow").toBool());
|
||||
bool needsNSWindow = m_isNSWindowChild || !parentWindow;
|
||||
|
||||
QCocoaWindow *oldParentCocoaWindow = m_parentCocoaWindow;
|
||||
m_parentCocoaWindow = const_cast<QCocoaWindow *>(static_cast<const QCocoaWindow *>(parentWindow));
|
||||
if (m_parentCocoaWindow && m_isNSWindowChild) {
|
||||
QWindow *parentQWindow = m_parentCocoaWindow->window();
|
||||
if (!parentQWindow->property("_q_platform_MacUseNSWindow").toBool()) {
|
||||
parentQWindow->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
|
||||
m_parentCocoaWindow->recreateWindow(m_parentCocoaWindow->m_parentCocoaWindow);
|
||||
}
|
||||
}
|
||||
|
||||
bool usesNSPanel = [m_nsWindow isKindOfClass:[QNSPanel class]];
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ void QToolBarPrivate::init()
|
|||
q->setBackgroundRole(QPalette::Button);
|
||||
q->setAttribute(Qt::WA_Hover);
|
||||
q->setAttribute(Qt::WA_X11NetWmWindowTypeToolBar);
|
||||
q->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
|
||||
|
||||
QStyle *style = q->style();
|
||||
int e = style->pixelMetric(QStyle::PM_ToolBarIconSize, 0, q);
|
||||
|
|
|
|||
Loading…
Reference in New Issue