Fixed compilation with older qt versions

This commit is contained in:
0xFEEDC0DE64
2017-12-22 23:14:03 +01:00
parent 3049c6b09e
commit d15ec86470
11 changed files with 55 additions and 0 deletions

View File

@@ -29,7 +29,12 @@ AdvancedViewDialog::AdvancedViewDialog(StripsWidget &stripsWidget) :
m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this)) m_timeAssignmentsModel(new TimeAssignmentsModel(stripsWidget, this))
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
ui->bookingsView->setModel(m_bookingsModel); ui->bookingsView->setModel(m_bookingsModel);
ui->bookingsView->setEnabled(m_bookingsModel->enabled()); ui->bookingsView->setEnabled(m_bookingsModel->enabled());

View File

@@ -6,7 +6,12 @@ BookingDialog::BookingDialog(QWidget *parent) :
ui(new Ui::BookingDialog) ui(new Ui::BookingDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
} }
BookingDialog::~BookingDialog() BookingDialog::~BookingDialog()

View File

@@ -13,7 +13,12 @@ TimeAssignmentDialog::TimeAssignmentDialog(const QMap<QString, QString> &project
ui(new Ui::TimeAssignmentDialog) ui(new Ui::TimeAssignmentDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
{ {
for(const auto &preferedProject : settings.projects()) for(const auto &preferedProject : settings.projects())

View File

@@ -6,7 +6,12 @@ LogDialog::LogDialog(QWidget *parent) :
ui(new Ui::LogDialog) ui(new Ui::LogDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
} }
LogDialog::~LogDialog() LogDialog::~LogDialog()

View File

@@ -16,7 +16,12 @@ LunchMealDialog::LunchMealDialog(StripsWidget &stripsWidget) :
ui(new Ui::LunchMealDialog) ui(new Ui::LunchMealDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
ui->labelTitle->setText(tr("Lunch meal for %0").arg(stripsWidget.date().toString(tr("dd.MM.yyyy")))); ui->labelTitle->setText(tr("Lunch meal for %0").arg(stripsWidget.date().toString(tr("dd.MM.yyyy"))));

View File

@@ -6,7 +6,12 @@ ProfileDialog::ProfileDialog(const GetUserInfoReply::UserInfo &userInfo, QWidget
ui(new Ui::ProfileDialog) ui(new Ui::ProfileDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
ui->spinBoxUserId->setValue(userInfo.userId); ui->spinBoxUserId->setValue(userInfo.userId);
ui->lineEditEmail->setText(userInfo.email); ui->lineEditEmail->setText(userInfo.email);

View File

@@ -24,7 +24,12 @@ UpdaterDialog::UpdaterDialog(MainWindow &mainWindow) :
m_mainWindow(mainWindow) m_mainWindow(mainWindow)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);

View File

@@ -11,7 +11,12 @@ WebRadioDialog::WebRadioDialog(MainWindow &mainWindow) :
m_player(new QMediaPlayer(this)) m_player(new QMediaPlayer(this))
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
connect(m_player, &QMediaPlayer::stateChanged, this, &WebRadioDialog::stateChanged); connect(m_player, &QMediaPlayer::stateChanged, this, &WebRadioDialog::stateChanged);
connect(m_player, &QMediaPlayer::stateChanged, this, &WebRadioDialog::updateWidgets); connect(m_player, &QMediaPlayer::stateChanged, this, &WebRadioDialog::updateWidgets);

View File

@@ -6,7 +6,12 @@ AuthenticationDialog::AuthenticationDialog(QWidget *parent) :
ui(new Ui::AuthenticationDialog) ui(new Ui::AuthenticationDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
} }
AuthenticationDialog::~AuthenticationDialog() AuthenticationDialog::~AuthenticationDialog()

View File

@@ -6,7 +6,12 @@ LanguageSelectionDialog::LanguageSelectionDialog(QWidget *parent) :
ui(new Ui::LanguageSelectionDialog) ui(new Ui::LanguageSelectionDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
ui->comboBoxLanguage->addItem(tr("English"), QLocale::English); ui->comboBoxLanguage->addItem(tr("English"), QLocale::English);
ui->comboBoxLanguage->addItem(tr("German"), QLocale::German); ui->comboBoxLanguage->addItem(tr("German"), QLocale::German);

View File

@@ -16,7 +16,12 @@ SettingsDialog::SettingsDialog(ZeiterfassungSettings &settings, QWidget *parent)
m_settings(settings) m_settings(settings)
{ {
ui->setupUi(this); ui->setupUi(this);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#else
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
#endif
ui->comboBoxLanguage->addItem(tr("English"), QLocale::English); ui->comboBoxLanguage->addItem(tr("English"), QLocale::English);
ui->comboBoxLanguage->addItem(tr("German"), QLocale::German); ui->comboBoxLanguage->addItem(tr("German"), QLocale::German);