Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix compilation for Qt 5.15

Agata Cacko2cc1b144b04b
diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index 77dda3db42..ca92b6aa3e 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -424,7 +424,11 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
selectionActionsBarOrietationLabel->setEnabled(sabEnabled);
connect(selectionActionsBarBehaviorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectionActionsBarBehaviorChanged(int)));
+#if (QT_VERSION > QT_VERSION_CHECK(6, 7, 0))
connect(chkEnableSelectionActionBar, SIGNAL(checkStateChanged(Qt::CheckState)), this, SLOT(selectionActionsBarCheckboxChanged(Qt::CheckState)));
+#else
+ connect(chkEnableSelectionActionBar, SIGNAL(stateChanged(int)), this, SLOT(selectionActionsBarCheckboxChanged(int)));
+#endif
//
// File handling
@@ -912,8 +916,11 @@ void GeneralTab::selectionActionsBarBehaviorChanged(int index)
selectionActionsBarPositionComboBox->setEnabled(enabled);
selectionActionsBarPositionLabel->setEnabled(enabled);
}
-
+#if (QT_VERSION > QT_VERSION_CHECK(6, 7, 0))
void GeneralTab::selectionActionsBarCheckboxChanged(Qt::CheckState value)
+#else
+void GeneralTab::selectionActionsBarCheckboxChanged(int value)
+#endif
{
bool enabled = value == Qt::CheckState::Checked;
diff --git a/libs/ui/dialogs/kis_dlg_preferences.h b/libs/ui/dialogs/kis_dlg_preferences.h
index f013121c64..032eb82c90 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.h
+++ b/libs/ui/dialogs/kis_dlg_preferences.h
@@ -129,7 +129,12 @@ private Q_SLOTS:
void colorSamplePreviewOutlineEnabledChanged(int value);
void selectionActionsBarBehaviorChanged(int index);
+#if (QT_VERSION > QT_VERSION_CHECK(6, 7, 0))
void selectionActionsBarCheckboxChanged(Qt::CheckState value);
+#else
+ void selectionActionsBarCheckboxChanged(int value);
+#endif
+
public:
QButtonGroup m_pasteFormatGroup;
KisCumulativeUndoData m_cumulativeUndoData;