fix: Deprecated QFlags = 0

This commit is contained in:
Sirius Bakke 2020-10-07 19:14:45 +02:00
parent 10f74bfa20
commit ea9f1e72ac
11 changed files with 49 additions and 3 deletions

View File

@ -7,7 +7,11 @@ class ClickableLabel : public QLabel
{
Q_OBJECT
public:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
ClickableLabel(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags() );
#else
ClickableLabel(QWidget *parent = 0, Qt::WindowFlags f = 0 );
#endif
void mousePressEvent(QMouseEvent *);
signals:

View File

@ -61,7 +61,11 @@ protected:
public:
Ui::FWObjectDropArea_q *m_objectDropArea;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
FWObjectDropArea(QWidget*p, const char * n = 0, Qt::WindowFlags f = Qt::WindowFlags());
#else
FWObjectDropArea(QWidget*p, const char * n = 0, Qt::WindowFlags f = 0);
#endif
~FWObjectDropArea();
libfwbuilder::FWObject * getObject(){return object;};
void setObject(libfwbuilder::FWObject * o){ object = o ;};

View File

@ -65,7 +65,11 @@ private:
public:
Ui::findObjectWidget_q *m_widget;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
FindObjectWidget(QWidget*p, ProjectPanel *pp, const char * n = 0, Qt::WindowFlags f = Qt::WindowFlags());
#else
FindObjectWidget(QWidget*p, ProjectPanel *pp, const char * n = 0, Qt::WindowFlags f = 0);
#endif
~FindObjectWidget() { delete m_widget; };
void findObject (libfwbuilder::FWObject *o);
void attachToProjectWindow(ProjectPanel *pp) { project_panel = pp; }

View File

@ -61,7 +61,11 @@ private:
public:
FindWhereUsedWidget(QWidget*p, ProjectPanel* pp, const char * n = 0,
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
Qt::WindowFlags f = Qt::WindowFlags(), bool f_mini=false);
#else
Qt::WindowFlags f = 0, bool f_mini=false);
#endif
~FindWhereUsedWidget();
void setShowObject(bool fl);

View File

@ -43,10 +43,18 @@ public:
ObjectEditorDockWidget(const QString &title,
QWidget *parent = 0,
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
Qt::WindowFlags flags = Qt::WindowFlags());
#else
Qt::WindowFlags flags = 0);
#endif
ObjectEditorDockWidget(QWidget *parent = 0,
Qt::WindowFlags flags = 0);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
Qt::WindowFlags flags = Qt::WindowFlags());
#else
Qt::WindowFlags flags = 0);
#endif
void setupEditor(ObjectEditor *ed);

View File

@ -56,8 +56,11 @@ protected:
bool event ( QEvent * event );
public:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
ObjectIconView(QWidget* parent, const char * name = 0, Qt::WindowFlags f = Qt::WindowFlags());
#else
ObjectIconView(QWidget* parent, const char * name = 0, Qt::WindowFlags f = 0);
#endif
void setDB(libfwbuilder::FWObjectDatabase *_db) { db = _db; }

View File

@ -54,8 +54,11 @@ protected:
bool event ( QEvent * event );
public:
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
ObjectListView(QWidget* parent, const char * name = 0, Qt::WindowFlags f = Qt::WindowFlags());
#else
ObjectListView(QWidget* parent, const char * name = 0, Qt::WindowFlags f = 0);
#endif
void setDB(libfwbuilder::FWObjectDatabase *_db) { db = _db; }

View File

@ -110,7 +110,11 @@ protected:
ObjectTreeView(ProjectPanel* project,
QWidget* parent = 0,
const char * name = 0,
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
Qt::WindowFlags f = Qt::WindowFlags());
#else
Qt::WindowFlags f = 0);
#endif
void freezeSelection(bool f) { selectionFrozen = f; }

View File

@ -106,7 +106,11 @@ void ProjectPanel::loadState(bool)
if (!mdiWindow->isMaximized() && mdiWindow)
{
if (fwbdebug) qDebug("ProjectPanel::loadState show normal");
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
setWindowState(Qt::WindowStates());
#else
setWindowState(nullptr);
#endif
int x = st->getInt("Window/"+filename+"/x");
int y = st->getInt("Window/"+filename+"/y");
int width = st->getInt("Window/"+filename+"/width");

View File

@ -263,7 +263,11 @@ void instDialog::setFlags(QTreeWidgetItem* item)
// Standby
item->setText(0, QString("%1 (standby)").arg(txt));
item->setCheckState(INSTALL_CHECKBOX_COLUMN, Qt::Unchecked);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
item->setFlags(Qt::ItemFlags());
#else
item->setFlags(nullptr);
#endif
}
}
}

View File

@ -59,7 +59,11 @@ void ListOfLibrariesModel::addStaticItems()
Qt::ItemFlags ListOfLibrariesModel::flags(const QModelIndex &index) const
{
int row = index.row();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
if (row < 0 || row >= items.size()) return Qt::ItemFlags();
#else
if (row < 0 || row >= items.size()) return nullptr;
#endif
FWObject *lib = items.at(index.row()).lib;
if (lib == nullptr) return Qt::ItemIsEnabled;