QWidget::setWindowFlag was introduced since Qt 5.9.
This commit is contained in:
parent
0225ade6fc
commit
3d0573f2a7
|
@ -493,4 +493,21 @@ inline void RemoveLast(QString &str)
|
|||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline void SetWindowFlag(QWidget *widget, Qt::WindowType flag, bool on = true)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
|
||||
widget->setWindowFlag(flag, on);
|
||||
#else
|
||||
if (on)
|
||||
{
|
||||
widget->setWindowFlags(widget->windowFlags() | flag);
|
||||
}
|
||||
else
|
||||
{
|
||||
widget->setWindowFlags(widget->windowFlags() & ~flag);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // COMPATIBILITY_H
|
||||
|
|
|
@ -414,7 +414,7 @@ void VAbstractMainWindow::ExportDataToCSV()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractMainWindow::AlwaysOnTop(bool state)
|
||||
{
|
||||
setWindowFlag(Qt::WindowStaysOnTopHint, state);
|
||||
SetWindowFlag(this, Qt::WindowStaysOnTopHint, state);
|
||||
destroy();
|
||||
create();
|
||||
setVisible(true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user