Cocoa: Set window title after setting window flags if window has border

A QWindow should keep its title after removing and restoring the
frame, so set it if we are setting window flags that include a frame.

Task-number: QTBUG-32978

Change-Id: I0fe1b651eac05a210b06ec4f7f6fb78f2536834d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Daiwei Li 2013-08-13 15:58:41 -07:00 committed by The Qt Project
parent 1044f23dee
commit 3e4c9cb3d6

View File

@ -486,6 +486,9 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
[m_nsWindow setStyleMask:styleMask];
[m_nsWindow setLevel:level];
setWindowShadow(flags);
if (!(styleMask & NSBorderlessWindowMask)) {
setWindowTitle(window()->title());
}
}
m_windowFlags = flags;