From 9bd245a678b459c17bebe38a6cd8abd49b7be4e2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 13 Oct 2016 14:15:19 +0200 Subject: Share Control::focusReason notes with TextArea and TextField Change-Id: Icf4feb1e29c40f10f483be63581f178fdc1cbd12 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi --- .../doc/src/includes/qquickcontrol-focusreason.qdocinc | 15 +++++++++++++++ src/quicktemplates2/qquickcontrol.cpp | 16 ++-------------- src/quicktemplates2/qquicktextarea.cpp | 16 +--------------- src/quicktemplates2/qquicktextfield.cpp | 16 +--------------- 4 files changed, 19 insertions(+), 44 deletions(-) create mode 100644 src/imports/controls/doc/src/includes/qquickcontrol-focusreason.qdocinc (limited to 'src') diff --git a/src/imports/controls/doc/src/includes/qquickcontrol-focusreason.qdocinc b/src/imports/controls/doc/src/includes/qquickcontrol-focusreason.qdocinc new file mode 100644 index 00000000..b69e9e60 --- /dev/null +++ b/src/imports/controls/doc/src/includes/qquickcontrol-focusreason.qdocinc @@ -0,0 +1,15 @@ +This property holds the reason of the last focus change. + +\note This property does not indicate whether the control has \l {Item::activeFocus} + {active focus}, but the reason why the control either gained or lost focus. + +\value Qt.MouseFocusReason A mouse action occurred. +\value Qt.TabFocusReason The Tab key was pressed. +\value Qt.BacktabFocusReason A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. +\value Qt.ActiveWindowFocusReason The window system made this window either active or inactive. +\value Qt.PopupFocusReason The application opened/closed a pop-up that grabbed/released the keyboard focus. +\value Qt.ShortcutFocusReason The user typed a label's buddy shortcut +\value Qt.MenuBarFocusReason The menu bar took focus. +\value Qt.OtherFocusReason Another reason, usually application-specific. + +\sa Item::activeFocus diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index 5479d3a3..307227a6 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -871,21 +871,9 @@ void QQuickControl::setFocusPolicy(Qt::FocusPolicy policy) \qmlproperty enumeration QtQuick.Controls::Control::focusReason \readonly - This property holds the reason of the last focus change. + \include qquickcontrol-focusreason.qdocinc - \note This property does not indicate whether the control has \l {Item::activeFocus} - {active focus}, but the reason why the control either gained or lost focus. - - \value Qt.MouseFocusReason A mouse action occurred. - \value Qt.TabFocusReason The Tab key was pressed. - \value Qt.BacktabFocusReason A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. - \value Qt.ActiveWindowFocusReason The window system made this window either active or inactive. - \value Qt.PopupFocusReason The application opened/closed a pop-up that grabbed/released the keyboard focus. - \value Qt.ShortcutFocusReason The user typed a label's buddy shortcut - \value Qt.MenuBarFocusReason The menu bar took focus. - \value Qt.OtherFocusReason Another reason, usually application-specific. - - \sa visualFocus, Item::activeFocus + \sa visualFocus */ Qt::FocusReason QQuickControl::focusReason() const { diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index 053e1099..1b6aef9f 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -448,21 +448,7 @@ void QQuickTextArea::setPlaceholderText(const QString &text) /*! \qmlproperty enumeration QtQuick.Controls::TextArea::focusReason - This property holds the reason of the last focus change. - - \note This property does not indicate whether the control has \l {Item::activeFocus} - {active focus}, but the reason why the control either gained or lost focus. - - \value Qt.MouseFocusReason A mouse action occurred. - \value Qt.TabFocusReason The Tab key was pressed. - \value Qt.BacktabFocusReason A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. - \value Qt.ActiveWindowFocusReason The window system made this window either active or inactive. - \value Qt.PopupFocusReason The application opened/closed a pop-up that grabbed/released the keyboard focus. - \value Qt.ShortcutFocusReason The user typed a label's buddy shortcut - \value Qt.MenuBarFocusReason The menu bar took focus. - \value Qt.OtherFocusReason Another reason, usually application-specific. - - \sa Item::activeFocus + \include qquickcontrol-focusreason.qdocinc */ Qt::FocusReason QQuickTextArea::focusReason() const { diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp index 850bbc58..7882b642 100644 --- a/src/quicktemplates2/qquicktextfield.cpp +++ b/src/quicktemplates2/qquicktextfield.cpp @@ -328,21 +328,7 @@ void QQuickTextField::setPlaceholderText(const QString &text) /*! \qmlproperty enumeration QtQuick.Controls::TextField::focusReason - This property holds the reason of the last focus change. - - \note This property does not indicate whether the control has \l {Item::activeFocus} - {active focus}, but the reason why the control either gained or lost focus. - - \value Qt.MouseFocusReason A mouse action occurred. - \value Qt.TabFocusReason The Tab key was pressed. - \value Qt.BacktabFocusReason A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. - \value Qt.ActiveWindowFocusReason The window system made this window either active or inactive. - \value Qt.PopupFocusReason The application opened/closed a pop-up that grabbed/released the keyboard focus. - \value Qt.ShortcutFocusReason The user typed a label's buddy shortcut - \value Qt.MenuBarFocusReason The menu bar took focus. - \value Qt.OtherFocusReason Another reason, usually application-specific. - - \sa Item::activeFocus + \include qquickcontrol-focusreason.qdocinc */ Qt::FocusReason QQuickTextField::focusReason() const { -- cgit v1.2.3