Commit a77ceb07 authored by Davide Gianforte's avatar Davide Gianforte

replace deprecated QComboBox::highlighted

parent 73834e78
......@@ -89,7 +89,7 @@ PackGUIBase::PackGUIBase(QWidget* parent)
typeData = new QComboBox(this);
typeData->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
connect(typeData, QOverload<const QString &>::of(&QComboBox::QCOMBOBOX_ACTIVATED), this, &PackGUIBase::checkConsistency);
connect(typeData, QOverload<const QString &>::of(&QComboBox::highlighted), this, &PackGUIBase::checkConsistency);
connect(typeData, QOverload<const QString &>::of(&QComboBox::QCOMBOBOX_HIGHLIGHTED), this, &PackGUIBase::checkConsistency);
hbox->addWidget(typeData);
grid->addLayout(hbox, 1, 0);
......
......@@ -42,6 +42,20 @@
#define QCOMBOBOX_ACTIVATED activated
#endif
/**
* QComboBox::highlighted(const QString &text) was made obsoleted in QT 5.15 in
* favor of QComboBox::textHighlighted(const QString &text)
*
* https://doc.qt.io/qt-5.15/qcombobox-obsolete.html#highlighted-1
*
* This can be removed when the qt minimum version required will be >= 5.14
*/
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#define QCOMBOBOX_HIGHLIGHTED textHighlighted
#else
#define QCOMBOBOX_HIGHLIGHTED highlighted
#endif
/**
* QFontMetrics::width(const QString&, int) was made obsoleted in QT 5.11 in
* favor of QFontMetrics::horizontalAdvance(const QString &, int)
......
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