diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-22 15:20:04 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-23 13:37:12 +0000 |
commit | 3bbd90c753fba9cc43c34ca9c509bcc35858b566 (patch) | |
tree | 2701ecf16fdad2c6131795ede0842f03432a53a0 /src/templates/qquickcombobox.cpp | |
parent | 4d26036772f897c293d8f71d728ed41c720a85e8 (diff) |
Add Popup::parent
The parent defaults to the QML parent object where Popup is declared.
Popup::x/y are relative to the parent, and the popup also automatically
follows the parent as appropriate. QQuickPopupPositioner has been
adapted from Qt Quick Controls 1. It was called QQuickScenePosListener,
and it was implemented for the text selection handle popups.
ComboBox's popup now follows the control eg. when scrolling, but the
below/above positioning feature is temporarily gone missing. It will
be restored in a follow up commit.
Change-Id: I8a6b58cd74e07f33930abc35d0ab9da056685128
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates/qquickcombobox.cpp')
-rw-r--r-- | src/templates/qquickcombobox.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/templates/qquickcombobox.cpp b/src/templates/qquickcombobox.cpp index aa1ecec8..e3e02212 100644 --- a/src/templates/qquickcombobox.cpp +++ b/src/templates/qquickcombobox.cpp @@ -332,6 +332,13 @@ QQuickComboBox::QQuickComboBox(QQuickItem *parent) : setAcceptedMouseButtons(Qt::LeftButton); } +QQuickComboBox::~QQuickComboBox() +{ + Q_D(QQuickComboBox); + delete d->popup; + d->popup = Q_NULLPTR; +} + /*! \readonly \qmlproperty int Qt.labs.controls::ComboBox::count |