From 5a6ec20ebc9fc078970f475f7cd89798dc751496 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Thu, 9 Oct 2014 04:23:05 +0000 Subject: [PATCH] Support frameless taskbarless dialogs in wxQt * Moved frameless hint to window, checking border * Removed duplicate code in wxFrame and asserts that were preventing AUI to work Thanks to @seandepagnier for the original patch git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/qt/frame.cpp | 16 ---------------- src/qt/window.cpp | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/qt/frame.cpp b/src/qt/frame.cpp index 7817d7418c..4944181f22 100644 --- a/src/qt/frame.cpp +++ b/src/qt/frame.cpp @@ -127,27 +127,11 @@ void wxFrame::SetWindowStyleFlag( long style ) Qt::WindowFlags qtFlags = GetHandle()->windowFlags(); - wxCHECK_RET( !HasFlag( wxFRAME_FLOAT_ON_PARENT ) && !HasFlag( wxTINY_CAPTION ) , - "wxFRAME_FLOAT_ON_PARENT, wxTINY_CAPTION not supported. Use wxFRAME_TOOL_WINDOW instead." ); - wxCHECK_RET( !HasFlag( wxFRAME_TOOL_WINDOW ) || HasFlag( wxFRAME_NO_TASKBAR ) , - "wxFRAME_TOOL_WINDOW without wxFRAME_NO_TASKBAR not supported." ); - if ( HasFlag( wxFRAME_TOOL_WINDOW ) ) { qtFlags &= ~Qt::WindowType_Mask; qtFlags |= Qt::Tool; } - else if ( HasFlag( wxFRAME_NO_TASKBAR ) ) - { - qtFlags &= ~Qt::WindowType_Mask; - qtFlags |= Qt::Dialog; - } - - if ( ( (style & wxSIMPLE_BORDER) || (style & wxNO_BORDER) ) - != qtFlags.testFlag( Qt::FramelessWindowHint ) ) - { - qtFlags ^= Qt::FramelessWindowHint; - } GetHandle()->setWindowFlags( qtFlags ); } diff --git a/src/qt/window.cpp b/src/qt/window.cpp index a39a37540c..31969dc9f3 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -719,6 +719,26 @@ void wxWindowQt::SetWindowStyleFlag( long style ) // qtFrame->setFrameStyle( QFrame::StyledPanel ); // qtFrame->setFrameShadow( QFrame::Plain ); // } + + Qt::WindowFlags qtFlags = GetHandle()->windowFlags(); + + if ( HasFlag( wxFRAME_NO_TASKBAR ) ) + { +// qtFlags &= ~Qt::WindowType_Mask; + if ( (style & wxSIMPLE_BORDER) || (style & wxNO_BORDER) ) { + qtFlags = Qt::ToolTip | Qt::FramelessWindowHint; + } + else + qtFlags |= Qt::Dialog; + } + else + if ( ( (style & wxSIMPLE_BORDER) || (style & wxNO_BORDER) ) + != qtFlags.testFlag( Qt::FramelessWindowHint ) ) + { + qtFlags ^= Qt::FramelessWindowHint; + } + + GetHandle()->setWindowFlags( qtFlags ); } void wxWindowQt::SetExtraStyle( long exStyle )