mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Utility function to change window flags
This commit is contained in:
committed by
Mathew Sutcliffe
parent
1bfe125108
commit
daaf895c3b
@@ -19,6 +19,7 @@
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/registermetadata.h"
|
||||
#include "blackmisc/slot.h"
|
||||
#include "blackmisc/directoryutils.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/logcategory.h"
|
||||
@@ -194,6 +195,24 @@ namespace BlackGui
|
||||
emit uiObjectTreeReady();
|
||||
}
|
||||
|
||||
void CGuiApplication::addWindowFlags(Qt::WindowFlags flags)
|
||||
{
|
||||
QWidget *maw = this->mainApplicationWindow();
|
||||
if (maw)
|
||||
{
|
||||
Qt::WindowFlags windowFlags = maw->windowFlags();
|
||||
windowFlags |= flags;
|
||||
maw->setWindowFlags(windowFlags);
|
||||
}
|
||||
else
|
||||
{
|
||||
connectOnce(this, &CGuiApplication::uiObjectTreeReady, this, [ = ]
|
||||
{
|
||||
this->addWindowFlags(flags);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void CGuiApplication::setWindowIcon(const QPixmap &icon)
|
||||
{
|
||||
instance()->m_windowIcon = icon;
|
||||
|
||||
@@ -111,6 +111,9 @@ namespace BlackGui
|
||||
//! Init the main application window based on information in this application
|
||||
void initMainApplicationWindow(QWidget *mainWindow);
|
||||
|
||||
//! Set window flag on main application window
|
||||
void addWindowFlags(Qt::WindowFlags flags);
|
||||
|
||||
//! \name print messages generated during parsing / cmd handling
|
||||
//! @{
|
||||
virtual bool cmdLineErrorMessage(const QString &cmdLineErrorMessage, bool retry = false) const override;
|
||||
|
||||
Reference in New Issue
Block a user