diff options
author | Liang Qi <liang.qi@qt.io> | 2017-09-26 16:08:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-09-26 16:14:54 +0200 |
commit | aadfe7d634de04519102c5827ca885dc2e2199c9 (patch) | |
tree | d92db346ca95332b177036a53f1f6beb2e24fb74 /examples/sql/doc/src/drilldown.qdoc | |
parent | 4b6c1448047362b8c38d265e6414f0e3e59b8d37 (diff) | |
parent | a732e16d5fd9dbf8a0289fec9f948b12e9ba2c19 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
src/gui/kernel/qguiapplication.cpp
src/platformsupport/input/libinput/qlibinputpointer.cpp
src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
src/plugins/platforms/cocoa/qcocoawindow.h
src/testlib/qtestsystem.h
Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
Diffstat (limited to 'examples/sql/doc/src/drilldown.qdoc')
-rw-r--r-- | examples/sql/doc/src/drilldown.qdoc | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/examples/sql/doc/src/drilldown.qdoc b/examples/sql/doc/src/drilldown.qdoc index 29c0b613f6..7a8aa2037a 100644 --- a/examples/sql/doc/src/drilldown.qdoc +++ b/examples/sql/doc/src/drilldown.qdoc @@ -172,11 +172,20 @@ \snippet drilldown/informationwindow.cpp 4 Finally, we connect the "something's changed" signals in the - editors to our custom \c enableButtons() slot, enabling the users - to either submit or revert their changes. We add all the widgets - into a layout, store the item ID and the name of the displayed - image file for future reference, and set the window title and - initial size. + editors to our custom \c enableButtons slot, enabling the users + to either submit or revert their changes. + We need to use lambdas for connecting the \c enableButtons slot + because its signature does not match \c QTextEdit::textChanged + and \c QComboBox::currentIndexChanged. + Since the latter has another overload with the signature + \c {const QString &} and the selected signal would be ambiguous, + we need to use \c QOverload<int>::of to select a specific overload + for \c currentIndexChanged. + + We add all the widgets into a layout, store the item ID and the + name of the displayed image file for future reference, and set + the window title and initial size. + Note that we also set the Qt::Window window flag to indicate that our widget is in fact a window, with a window system frame and a @@ -389,19 +398,21 @@ \snippet drilldown/view.cpp 6 The \c showInformation() function is given an \c ImageItem object - as argument, and starts off by extracting the item's item - ID. Then it determines if there already is created an information - window for this location. If it is, and the window is visible, it - ensures that the window is raised to the top of the widget stack - and activated. If the window exists but is hidden, calling its \l - {QWidget::}{show()} slot gives the same result. + as argument, and starts off by extracting the item's item ID. + Then it determines if there already is created an information + window for this location. If no window for the given location exists, we create one by passing the item ID, a pointer to the model, and our view as a parent, to the \c InformationWindow constructor. Note that we connect the information window's \c imageChanged() signal to \e this widget's \c updateImage() slot, before we give it a suitable position and add it to the list of existing windows. + If there is a window for the given location, and that window is + visible, it ensures that the window is raised to the top of the + widget stack and activated. If it is hidden, calling its \l + {QWidget::}{show()} slot gives the same result. + \snippet drilldown/view.cpp 7 |