Commit 50e8681a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile with qt5.15

parent 39806f01
...@@ -63,10 +63,9 @@ if (KF5Config_VERSION VERSION_GREATER "5.56.0") ...@@ -63,10 +63,9 @@ if (KF5Config_VERSION VERSION_GREATER "5.56.0")
MESSAGE(STATUS "compile without foreach") MESSAGE(STATUS "compile without foreach")
endif() endif()
if (EXISTS "${CMAKE_SOURCE_DIR}/.git") if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
endif() endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
include_directories(src) include_directories(src)
add_subdirectory(src) add_subdirectory(src)
......
...@@ -64,8 +64,12 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) ...@@ -64,8 +64,12 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent)
connect(m_removeButton, &QPushButton::clicked, this, &SettingsDialog::removeFolder); connect(m_removeButton, &QPushButton::clicked, this, &SettingsDialog::removeFolder);
connect(resetButton, &QPushButton::clicked, this, &SettingsDialog::reset); connect(resetButton, &QPushButton::clicked, this, &SettingsDialog::reset);
connect(closeButton, &QPushButton::clicked, this, &SettingsDialog::close); connect(closeButton, &QPushButton::clicked, this, &SettingsDialog::close);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(m_schemaGroup, static_cast<void (QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &SettingsDialog::changeScheme);
#else
connect(m_schemaGroup, &QButtonGroup::buttonClicked, this, &SettingsDialog::changeScheme);
#endif
connect(m_schemaGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SettingsDialog::changeScheme);
connect(contrastSlider, &QSlider::valueChanged, this, &SettingsDialog::changeContrast); connect(contrastSlider, &QSlider::valueChanged, this, &SettingsDialog::changeContrast);
connect(contrastSlider, &QSlider::sliderReleased, this, &SettingsDialog::slotSliderReleased); connect(contrastSlider, &QSlider::sliderReleased, this, &SettingsDialog::slotSliderReleased);
...@@ -201,10 +205,13 @@ void SettingsDialog::startTimer() ...@@ -201,10 +205,13 @@ void SettingsDialog::startTimer()
m_timer.start(TIMEOUT); m_timer.start(TIMEOUT);
} }
void SettingsDialog::changeScheme(int s) void SettingsDialog::changeScheme(QAbstractButton *button)
{ {
Config::scheme = (Filelight::MapScheme)s; if (button) {
emit canvasIsDirty(1); const int s = m_schemaGroup->id(button);
Config::scheme = (Filelight::MapScheme)s;
emit canvasIsDirty(1);
}
} }
void SettingsDialog::changeContrast(int c) void SettingsDialog::changeContrast(int c)
{ {
......
...@@ -52,7 +52,7 @@ public Q_SLOTS: ...@@ -52,7 +52,7 @@ public Q_SLOTS:
void toggleUseAntialiasing(bool = true); void toggleUseAntialiasing(bool = true);
void toggleVaryLabelFontSizes(bool); void toggleVaryLabelFontSizes(bool);
void changeContrast(int); void changeContrast(int);
void changeScheme(int); void changeScheme(QAbstractButton *button);
void changeMinFontPitch(int); void changeMinFontPitch(int);
void toggleShowSmallFiles(bool); void toggleShowSmallFiles(bool);
void slotSliderReleased(); void slotSliderReleased();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment