Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit cecfd5e7 authored by Laurent Montel's avatar Laurent Montel 😁

Use QComboBox here

parent 51987b49
......@@ -29,7 +29,7 @@
#include <QPushButton>
#include <QCheckBox>
#include <KComboBox>
#include <QComboBox>
#include <KLocalizedString>
using namespace MessageList::Utils;
......@@ -47,27 +47,27 @@ AggregationEditor::AggregationEditor(QWidget *parent)
QGridLayout *tabg = new QGridLayout(tab);
tabg->addWidget(new QLabel(i18n("Grouping:"), tab), 0, 0);
mGroupingCombo = new KComboBox(tab);
mGroupingCombo = new QComboBox(tab);
tabg->addWidget(mGroupingCombo, 0, 1);
connect(mGroupingCombo, QOverload<int>::of(&KComboBox::activated), this, &AggregationEditor::groupingComboActivated);
connect(mGroupingCombo, QOverload<int>::of(&QComboBox::activated), this, &AggregationEditor::groupingComboActivated);
tabg->addWidget(new QLabel(i18n("Group expand policy:"), tab), 3, 0);
mGroupExpandPolicyCombo = new KComboBox(tab);
mGroupExpandPolicyCombo = new QComboBox(tab);
tabg->addWidget(mGroupExpandPolicyCombo, 3, 1);
tabg->addWidget(new QLabel(i18n("Threading:"), tab), 4, 0);
mThreadingCombo = new KComboBox(tab);
mThreadingCombo = new QComboBox(tab);
tabg->addWidget(mThreadingCombo, 4, 1);
connect(mThreadingCombo, QOverload<int>::of(&KComboBox::activated), this, &AggregationEditor::threadingComboActivated);
connect(mThreadingCombo, QOverload<int>::of(&QComboBox::activated), this, &AggregationEditor::threadingComboActivated);
tabg->addWidget(new QLabel(i18n("Thread leader:"), tab), 5, 0);
mThreadLeaderCombo = new KComboBox(tab);
mThreadLeaderCombo = new QComboBox(tab);
tabg->addWidget(mThreadLeaderCombo, 5, 1);
tabg->addWidget(new QLabel(i18n("Thread expand policy:"), tab), 6, 0);
mThreadExpandPolicyCombo = new KComboBox(tab);
mThreadExpandPolicyCombo = new QComboBox(tab);
tabg->addWidget(mThreadExpandPolicyCombo, 6, 1);
tabg->setColumnStretch(1, 1);
......@@ -80,7 +80,7 @@ AggregationEditor::AggregationEditor(QWidget *parent)
tabg = new QGridLayout(tab);
tabg->addWidget(new QLabel(i18n("Fill view strategy:"), tab), 0, 0);
mFillViewStrategyCombo = new KComboBox(tab);
mFillViewStrategyCombo = new QComboBox(tab);
tabg->addWidget(mFillViewStrategyCombo, 0, 1);
tabg->setColumnStretch(1, 1);
......
......@@ -23,7 +23,7 @@
#include <utils/optionseteditor.h>
class KComboBox;
class QComboBox;
namespace MessageList {
namespace Core {
......@@ -47,13 +47,13 @@ private:
Core::Aggregation *mCurrentAggregation = nullptr; // shallow, may be null!
// Grouping, Threading and Sorting tab
KComboBox *mGroupingCombo = nullptr;
KComboBox *mGroupExpandPolicyCombo = nullptr;
KComboBox *mThreadingCombo = nullptr;
KComboBox *mThreadLeaderCombo = nullptr;
KComboBox *mThreadExpandPolicyCombo = nullptr;
QComboBox *mGroupingCombo = nullptr;
QComboBox *mGroupExpandPolicyCombo = nullptr;
QComboBox *mThreadingCombo = nullptr;
QComboBox *mThreadLeaderCombo = nullptr;
QComboBox *mThreadExpandPolicyCombo = nullptr;
// Advanced tab
KComboBox *mFillViewStrategyCombo = nullptr;
QComboBox *mFillViewStrategyCombo = nullptr;
public:
/**
......
......@@ -22,11 +22,11 @@
#include <QVariant>
#include <KComboBox>
#include <QComboBox>
using namespace MessageList::Utils;
void ComboBoxUtils::fillIntegerOptionCombo(KComboBox *combo, const QList< QPair< QString, int > > &optionDescriptors)
void ComboBoxUtils::fillIntegerOptionCombo(QComboBox *combo, const QList< QPair< QString, int > > &optionDescriptors)
{
int val = getIntegerOptionComboValue(combo, -1);
combo->clear();
......@@ -58,7 +58,7 @@ void ComboBoxUtils::fillIntegerOptionCombo(KComboBox *combo, const QList< QPair<
}
}
void ComboBoxUtils::setIntegerOptionComboValue(KComboBox *combo, int value)
void ComboBoxUtils::setIntegerOptionComboValue(QComboBox *combo, int value)
{
if (combo->itemData(combo->currentIndex()).toInt() == value) {
return;
......@@ -71,7 +71,7 @@ void ComboBoxUtils::setIntegerOptionComboValue(KComboBox *combo, int value)
}
}
int ComboBoxUtils::getIntegerOptionComboValue(KComboBox *combo, int defaultValue)
int ComboBoxUtils::getIntegerOptionComboValue(QComboBox *combo, int defaultValue)
{
const int idx = combo->currentIndex();
if (idx < 0) {
......
......@@ -24,32 +24,32 @@
#include <QList>
#include <QPair>
class KComboBox;
class QComboBox;
namespace MessageList {
namespace Utils {
/**
* Namespace containing some helper functions for KComboBox widgets.
* Namespace containing some helper functions for QComboBox widgets.
*/
namespace ComboBoxUtils {
/**
* Fills the specified KComboBox with the options available in optionDescriptors.
* Fills the specified QComboBox with the options available in optionDescriptors.
* Each option descriptor contains a description string and a distinct integer (possibly enum)
* identifier value.
*/
void fillIntegerOptionCombo(KComboBox *combo, const QList< QPair< QString, int > > &optionDescriptors);
void fillIntegerOptionCombo(QComboBox *combo, const QList< QPair< QString, int > > &optionDescriptors);
/**
* Returns the identifier of the currently selected option in the specified combo.
* If the combo has no current selection or something goes wrong then the defaultValue
* is returned instead.
*/
int getIntegerOptionComboValue(KComboBox *combo, int defaultValue);
int getIntegerOptionComboValue(QComboBox *combo, int defaultValue);
/**
* Sets the currently selected option in the specified combo.
*/
void setIntegerOptionComboValue(KComboBox *combo, int value);
void setIntegerOptionComboValue(QComboBox *combo, int value);
} // namespace ComboBoxUtils
} // namespace Utils
} // namespace MessageList
......
......@@ -30,7 +30,7 @@ using namespace MessageList::Core;
using namespace MessageList::Utils;
ThemeComboBox::ThemeComboBox(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
, d(new ThemeComboBoxPrivate(this))
{
if (Manager::instance()) {
......
......@@ -20,7 +20,7 @@
#define MESSAGELIST_UTILS_THEMECOMBOBOX_H
#include <messagelist_export.h>
#include <KComboBox>
#include <QComboBox>
#include <collection.h>
namespace MessageList {
namespace Core {
......@@ -32,9 +32,9 @@ namespace Utils {
class ThemeComboBoxPrivate;
/**
* A specialized KComboBox that lists all message list themes.
* A specialized QComboBox that lists all message list themes.
*/
class MESSAGELIST_EXPORT ThemeComboBox : public KComboBox
class MESSAGELIST_EXPORT ThemeComboBox : public QComboBox
{
Q_OBJECT
......
......@@ -48,7 +48,7 @@
#include <QMimeData>
#include <QColorDialog>
#include <KComboBox>
#include <QComboBox>
#include <KLineEdit>
#include <KLocalizedString>
#include <QMenu>
......@@ -92,7 +92,7 @@ ThemeColumnPropertiesDialog::ThemeColumnPropertiesDialog(QWidget *parent, Theme:
l = new QLabel(i18n("Header click sorts messages:"), base);
g->addWidget(l, 1, 0);
mMessageSortingCombo = new KComboBox(base);
mMessageSortingCombo = new QComboBox(base);
mMessageSortingCombo->setToolTip(i18n("The sorting order that clicking on this column header will switch to."));
g->addWidget(mMessageSortingCombo, 1, 1);
......@@ -1459,7 +1459,7 @@ ThemeEditor::ThemeEditor(QWidget *parent)
l = new QLabel(i18n("Header:"), tab);
tabg->addWidget(l, 0, 0);
mViewHeaderPolicyCombo = new KComboBox(tab);
mViewHeaderPolicyCombo = new QComboBox(tab);
tabg->addWidget(mViewHeaderPolicyCombo, 0, 1);
l = new QLabel(i18n("Icon size:"), tab);
......
......@@ -33,7 +33,7 @@
class QCheckBox;
class KComboBox;
class QComboBox;
class KPluralHandlingSpinBox;
class KLineEdit;
......@@ -58,7 +58,7 @@ protected:
KLineEdit *mNameEdit = nullptr;
QCheckBox *mVisibleByDefaultCheck = nullptr;
QCheckBox *mIsSenderOrReceiverCheck = nullptr;
KComboBox *mMessageSortingCombo = nullptr;
QComboBox *mMessageSortingCombo = nullptr;
protected Q_SLOTS:
void slotOkButtonClicked();
......@@ -225,7 +225,7 @@ private:
ThemePreviewWidget *mPreviewWidget = nullptr;
// Advanced tab
KComboBox *mViewHeaderPolicyCombo = nullptr;
QComboBox *mViewHeaderPolicyCombo = nullptr;
KPluralHandlingSpinBox *mIconSizeSpinBox = nullptr;
};
} // namespace Utils
......
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