aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcombobox.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-05-05 03:00:08 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-05-07 14:18:09 +0200
commitde9c38dd61ce29f549e2b13871e981209a0fed9e (patch)
tree9c1824fc361d7039d297cbf9a56002cea52f8c23 /src/quicktemplates2/qquickcombobox.cpp
parent3b5143bb67cdaaff6b0eabedff1034e4add7ec87 (diff)
parentbf39c3ce5524d151532d89efef40ff1a8e25f4c0 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/quicktemplates2/qquickabstractbutton_p_p.h src/quicktemplates2/qquickcombobox.cpp src/quicktemplates2/qquickcontainer.cpp src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickcontrol_p_p.h src/quicktemplates2/qquickdialog_p_p.h src/quicktemplates2/qquickdialogbuttonbox.cpp src/quicktemplates2/qquickdialogbuttonbox_p_p.h src/quicktemplates2/qquickdrawer.cpp src/quicktemplates2/qquickmenubar.cpp src/quicktemplates2/qquickmenubar_p_p.h src/quicktemplates2/qquickpage.cpp src/quicktemplates2/qquickpage_p_p.h src/quicktemplates2/qquickpane.cpp src/quicktemplates2/qquickpane_p_p.h src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquickrangeslider.cpp src/quicktemplates2/qquickscrollview.cpp src/quicktemplates2/qquickslider.cpp src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquickswipeview.cpp src/quicktemplates2/qquicktabbar.cpp src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p_p.h src/quicktemplates2/qquicktheme_p.h Change-Id: I6e2b8fe99e51e3e26c87546aa66af045bc429ec4
Diffstat (limited to 'src/quicktemplates2/qquickcombobox.cpp')
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp67
1 files changed, 21 insertions, 46 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index d4280b30..d018be44 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -187,7 +187,7 @@ public:
QString stringValue(int index, const QString &role) override;
private:
- QQuickComboBox *combo;
+ QQuickComboBox *combo = nullptr;
};
QQuickComboBoxDelegateModel::QQuickComboBoxDelegateModel(QQuickComboBox *combo)
@@ -220,8 +220,6 @@ class QQuickComboBoxPrivate : public QQuickControlPrivate
Q_DECLARE_PUBLIC(QQuickComboBox)
public:
- QQuickComboBoxPrivate();
-
bool isPopupVisible() const;
void showPopup();
void hidePopup(bool accept);
@@ -266,62 +264,37 @@ public:
void itemImplicitWidthChanged(QQuickItem *item) override;
void itemImplicitHeightChanged(QQuickItem *item) override;
- bool flat;
- bool down;
- bool hasDown;
- bool pressed;
- bool ownModel;
- bool keyNavigating;
- bool hasDisplayText;
- bool hasCurrentIndex;
- int highlightedIndex;
- int currentIndex;
+ bool flat = false;
+ bool down = false;
+ bool hasDown = false;
+ bool pressed = false;
+ bool ownModel = false;
+ bool keyNavigating = false;
+ bool hasDisplayText = false;
+ bool hasCurrentIndex = false;
+ int highlightedIndex = -1;
+ int currentIndex = -1;
QVariant model;
QString textRole;
QString currentText;
QString displayText;
- QQuickItem *pressedItem;
- QQmlInstanceModel *delegateModel;
- QQmlComponent *delegate;
+ QQuickItem *pressedItem = nullptr;
+ QQmlInstanceModel *delegateModel = nullptr;
+ QQmlComponent *delegate = nullptr;
QQuickDeferredPointer<QQuickItem> indicator;
QQuickDeferredPointer<QQuickPopup> popup;
struct ExtraData {
- ExtraData()
- : editable(false),
- accepting(false),
- allowComplete(false),
- inputMethodHints(Qt::ImhNone),
- validator(nullptr) { }
-
- bool editable;
- bool accepting;
- bool allowComplete;
- Qt::InputMethodHints inputMethodHints;
+ bool editable = false;
+ bool accepting = false;
+ bool allowComplete = false;
+ Qt::InputMethodHints inputMethodHints = Qt::ImhNone;
QString editText;
- QValidator *validator;
+ QValidator *validator = nullptr;
};
QLazilyAllocated<ExtraData> extra;
};
-QQuickComboBoxPrivate::QQuickComboBoxPrivate()
- : flat(false),
- down(false),
- hasDown(false),
- pressed(false),
- ownModel(false),
- keyNavigating(false),
- hasDisplayText(false),
- hasCurrentIndex(false),
- highlightedIndex(-1),
- currentIndex(-1),
- delegateModel(nullptr),
- delegate(nullptr),
- indicator(nullptr),
- popup(nullptr)
-{
-}
-
bool QQuickComboBoxPrivate::isPopupVisible() const
{
return popup && popup->isVisible();
@@ -920,6 +893,8 @@ int QQuickComboBox::highlightedIndex() const
This property holds the index of the current item in the combo box.
+ The default value is \c -1 when \l count is \c 0, and \c 0 otherwise.
+
\sa activated(), currentText, highlightedIndex
*/
int QQuickComboBox::currentIndex() const