diff options
author | Caroline Chao <[email protected]> | 2015-03-12 10:02:36 +0100 |
---|---|---|
committer | Caroline Chao <[email protected]> | 2015-03-13 14:59:12 +0000 |
commit | 95abac09523df5f0563f46ceb5365f80cb87a18c (patch) | |
tree | cab91b55cebb14df0bfb20b44ec426b860308c4c /src | |
parent | d04eb32908cfa7c6692bacfc292494b85ce3cd8a (diff) |
Doc: Fix qml method signatures
So the return value and parameters can be seen in the documentation.
+ Fix minor doc issues
Change-Id: I99e520c103bb0faeb88b26eb7b9ff73922851abc
Reviewed-by: J-P Nurmi <[email protected]>
Reviewed-by: Martin Smith <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/Calendar.qml | 4 | ||||
-rw-r--r-- | src/controls/ComboBox.qml | 8 | ||||
-rw-r--r-- | src/controls/SplitView.qml | 6 | ||||
-rw-r--r-- | src/controls/StackView.qml | 30 | ||||
-rw-r--r-- | src/controls/StackViewDelegate.qml | 4 | ||||
-rw-r--r-- | src/controls/Styles/Base/CircularGaugeStyle.qml | 2 | ||||
-rw-r--r-- | src/controls/Styles/Base/DialStyle.qml | 2 | ||||
-rw-r--r-- | src/controls/Styles/Base/MenuBarStyle.qml | 4 | ||||
-rw-r--r-- | src/controls/Styles/Base/MenuStyle.qml | 4 | ||||
-rw-r--r-- | src/controls/Styles/Base/PieMenuStyle.qml | 3 | ||||
-rw-r--r-- | src/controls/TabView.qml | 15 | ||||
-rw-r--r-- | src/controls/TableView.qml | 2 | ||||
-rw-r--r-- | src/controls/TableViewColumn.qml | 3 | ||||
-rw-r--r-- | src/controls/TextArea.qml | 26 | ||||
-rw-r--r-- | src/controls/TextField.qml | 22 | ||||
-rw-r--r-- | src/controls/qquickaction.cpp | 2 | ||||
-rw-r--r-- | src/controls/qquickmenuitem.cpp | 2 | ||||
-rw-r--r-- | src/extras/Tumbler.qml | 16 |
18 files changed, 98 insertions, 57 deletions
diff --git a/src/controls/Calendar.qml b/src/controls/Calendar.qml index 9958068a1..b5dadc0b3 100644 --- a/src/controls/Calendar.qml +++ b/src/controls/Calendar.qml @@ -290,6 +290,7 @@ Control { signal pressAndHold(date date) /*! + \qmlmethod void Calendar::showPreviousMonth() Sets visibleMonth to the previous month. */ function showPreviousMonth() { @@ -302,6 +303,7 @@ Control { } /*! + \qmlmethod void Calendar::showNextMonth() Sets visibleMonth to the next month. */ function showNextMonth() { @@ -314,6 +316,7 @@ Control { } /*! + \qmlmethod void Calendar::showPreviousYear() Sets visibleYear to the previous year. */ function showPreviousYear() { @@ -323,6 +326,7 @@ Control { } /*! + \qmlmethod void Calendar::showNextYear() Sets visibleYear to the next year. */ function showNextYear() { diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 9eb63fe76..7de1b7385 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -166,7 +166,8 @@ Control { */ readonly property alias count: popupItems.count - /*! Returns the text for a given \a index. + /*! \qmlmethod string ComboBox::textAt(int index) + Returns the text for a given \a index. If an invalid index is provided, \c null is returned \since QtQuick.Controls 1.1 */ @@ -176,7 +177,8 @@ Control { return popupItems.objectAt(index).text; } - /*! Finds and returns the index of a given \a text + /*! \qmlmethod int ComboBox::find(string text) + Finds and returns the index of a given \a text If no match is found, \c -1 is returned. The search is case sensitive. \since QtQuick.Controls 1.1 */ @@ -298,7 +300,7 @@ Control { signal activated(int index) /*! - \qmlmethod ComboBox::selectAll() + \qmlmethod void ComboBox::selectAll() \since QtQuick.Controls 1.1 Causes all \l editText to be selected. diff --git a/src/controls/SplitView.qml b/src/controls/SplitView.qml index be1a9e923..41c50329a 100644 --- a/src/controls/SplitView.qml +++ b/src/controls/SplitView.qml @@ -177,7 +177,8 @@ Item { onHeightChanged: d.updateLayout() onOrientationChanged: d.changeOrientation() - /*! Add an item to the end of the view. + /*! \qmlmethod void SplitView::addItem(Item item) + Add an item to the end of the view. \since QtQuick.Controls 1.3 */ function addItem(item) { d.updateLayoutGuard = true @@ -187,7 +188,8 @@ Item { d.updateFillIndex() } - /*! Remove \a item from the view. + /*! \qmlmethod void SplitView::removeItem(Item item) + Remove \a item from the view. \since QtQuick.Controls 1.4 */ function removeItem(item) { d.updateLayoutGuard = true diff --git a/src/controls/StackView.qml b/src/controls/StackView.qml index 77dc4ea7c..5f774969b 100644 --- a/src/controls/StackView.qml +++ b/src/controls/StackView.qml @@ -117,7 +117,7 @@ import QtQuick.Controls.Private 1.0 \li \l{pop()}{pop(A)} => [A] - "pop" transition between C and A \endlist - \note Note that when the stack is empty, a push() will not perform a + \note When the stack is empty, a push() will not perform a transition animation because there is nothing to transition from (typically during application start-up). A pop() on a stack with depth 1 or 0 is a no-operation. If removing all items from the stack is needed, a separate function clear() is @@ -217,7 +217,7 @@ import QtQuick.Controls.Private 1.0 \endcode - \note Note that if an item is declared inside another item, and if that parent gets destroyed, + \note If an item is declared inside another item, and if that parent gets destroyed, (even if a component was used), that child item will also be destroyed. This follows normal Qt parent-child destruction rules, but sometimes comes as a surprise for developers. @@ -509,7 +509,10 @@ FocusScope { \sa {Transitions} */ property StackViewDelegate delegate: StackViewSlideDelegate {} - /*! Pushes an item onto the stack. The function takes a property list as argument, which + /*! \qmlmethod Item StackView::push(Item item) + Pushes an item onto the stack. + + The function can also take a property list as argument - \c {Item StackView::push(jsobject dict)}, which should contain one or more of the following properties: \list \li \c item: this property is required, and holds the item you want to push. @@ -545,7 +548,7 @@ FocusScope { \li stackView.push([{item:anitem, immediate:true}, {item:aURL}]) \endlist - \note Note: if the only argument needed is "item", you can apply the following short- + \note If the only argument needed is "item", you can apply the following short- hand notation: \c{stackView.push(anItem)}. Returns the item that became current. @@ -599,7 +602,10 @@ FocusScope { return __currentItem } - /*! Pops one or more items off the stack. The function takes a property list as argument + /*! \qmlmethod Item StackView::pop(Item item = undefined) + Pops one or more items off the stack. + + The function can also take a property list as argument - \c {Item StackView::pop(jsobject dict)}, which can contain one or more of the following properties: \list \li \c item: if specified, all items down to (but not including) \a item will be @@ -617,7 +623,7 @@ FocusScope { \li stackView.pop(null) \endlist - \note Note: If the only argument needed is "item", you can apply the following short- + \note If the only argument needed is "item", you can apply the following short- hand notation: \c{stackView.pop(anItem)}. Returns the item that was popped off @@ -671,7 +677,8 @@ FocusScope { return outElement.item; } - /*! Remove all items from the stack. No animations will be applied. */ + /*! \qmlmethod void StackView::clear() + Remove all items from the stack. No animations will be applied. */ function clear() { if (__recursionGuard(true)) return @@ -687,7 +694,8 @@ FocusScope { __recursionGuard(false) } - /*! Search for a specific item inside the stack. \a func will + /*! \qmlmethod Item StackView::find(function, bool onlySearchLoadedItems = false) + Search for a specific item inside the stack. \a func will be called for each item in the stack (with the item as argument) until the function returns true. Return value will be the item found. For example: @@ -707,7 +715,8 @@ FocusScope { return null; } - /*! Returns the item at position \a index in + /*! \qmlmethod Item StackView::get(int index, bool dontLoad = false) + Returns the item at position \a index in the stack. If \a dontLoad is true, the item will not be forced to load (and \c null will be returned if not yet loaded) */ @@ -726,7 +735,8 @@ FocusScope { } } - /*! Immediately completes any ongoing transition. + /*! \qmlmethod void StackView::completeTransition() + Immediately completes any ongoing transition. /sa Animation.complete */ function completeTransition() diff --git a/src/controls/StackViewDelegate.qml b/src/controls/StackViewDelegate.qml index 1d4c2969d..c837c2815 100644 --- a/src/controls/StackViewDelegate.qml +++ b/src/controls/StackViewDelegate.qml @@ -50,7 +50,7 @@ QtObject { id: root /*! - \qmlmethod StackViewDelegate::getTransition(properties) + \qmlmethod Transition StackViewDelegate::getTransition(properties) The base implementation of this function just looks for a property named properties.name inside itself. \sa {Transitions} @@ -61,7 +61,7 @@ QtObject { } /*! - \qmlmethod StackViewDelegate::transitionFinished(properties) + \qmlmethod void StackViewDelegate::transitionFinished(properties) The base implementation of this function is empty. \sa {Transitions} diff --git a/src/controls/Styles/Base/CircularGaugeStyle.qml b/src/controls/Styles/Base/CircularGaugeStyle.qml index 99b0091bc..5abe14692 100644 --- a/src/controls/Styles/Base/CircularGaugeStyle.qml +++ b/src/controls/Styles/Base/CircularGaugeStyle.qml @@ -238,7 +238,7 @@ Style { */ readonly property int labelCount: control.__panel.circularTickmarkLabel.labelCount - /*! + /*! \qmlmethod real CircularGaugeStyle::valueToAngle(real value) Returns \a value as an angle in degrees. This function is useful for custom drawing or positioning of items in diff --git a/src/controls/Styles/Base/DialStyle.qml b/src/controls/Styles/Base/DialStyle.qml index dc4f370de..6c9a68d3a 100644 --- a/src/controls/Styles/Base/DialStyle.qml +++ b/src/controls/Styles/Base/DialStyle.qml @@ -144,7 +144,7 @@ Style { */ readonly property int labelCount: control.__panel.circularTickmarkLabel.labelCount - /*! + /*! \qmlmethod real DialStyle::valueToAngle(real value) Returns \a value as an angle in degrees. This function is useful for custom drawing or positioning of items in diff --git a/src/controls/Styles/Base/MenuBarStyle.qml b/src/controls/Styles/Base/MenuBarStyle.qml index aaad65e82..541dd7f9f 100644 --- a/src/controls/Styles/Base/MenuBarStyle.qml +++ b/src/controls/Styles/Base/MenuBarStyle.qml @@ -52,7 +52,9 @@ import QtQuick.Controls.Private 1.0 Style { id: root - /*! Returns a formatted string to render mnemonics for a given menu item. + /*! + \qmlmethod string MenuBarStyle::formatMnemonic(string text, bool underline = false) + Returns a formatted string to render mnemonics for a given menu item. The mnemonic character is prefixed by an ampersand in the original string. diff --git a/src/controls/Styles/Base/MenuStyle.qml b/src/controls/Styles/Base/MenuStyle.qml index 6e9f8b0ef..a2a3862f8 100644 --- a/src/controls/Styles/Base/MenuStyle.qml +++ b/src/controls/Styles/Base/MenuStyle.qml @@ -93,7 +93,9 @@ Style { /*! The number of milliseconds to wait before opening a submenu. */ property int submenuPopupDelay: 200 - /*! Returns a rich-text string to render mnemonics for a given menu item. + /*! + \qmlmethod string MenuStyle::formatMnemonic(string text, bool underline = false) + Returns a rich-text string to render mnemonics for a given menu item. The mnemonic character is prefixed by an ampersand in the original string. diff --git a/src/controls/Styles/Base/PieMenuStyle.qml b/src/controls/Styles/Base/PieMenuStyle.qml index 916a0c9ec..fdfa92e7e 100644 --- a/src/controls/Styles/Base/PieMenuStyle.qml +++ b/src/controls/Styles/Base/PieMenuStyle.qml @@ -165,6 +165,7 @@ Style { property real endAngle: 90 /*! + \qmlmethod real PieMenuStyle::sectionStartAngle(int itemIndex) Returns the start of the section at \a itemIndex as an angle in degrees. */ function sectionStartAngle(itemIndex) { @@ -172,6 +173,7 @@ Style { } /*! + \qmlmethod real PieMenuStyle::sectionCenterAngle(int itemIndex) Returns the center of the section at \a itemIndex as an angle in degrees. */ @@ -180,6 +182,7 @@ Style { } /*! + \qmlmethod real PieMenuStyle::sectionEndAngle(int itemIndex) Returns the end of the section at \a itemIndex as an angle in degrees. */ function sectionEndAngle(itemIndex) { diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml index 84e5331b6..bd043be9f 100644 --- a/src/controls/TabView.qml +++ b/src/controls/TabView.qml @@ -115,14 +115,16 @@ FocusScope { /*! \internal */ default property alias data: stack.data - /*! Adds a new tab page with title with and optional Component. + /*! \qmlmethod Tab TabView::addTab(string title, Component component) + Adds a new tab page with title with and optional Component. Returns the newly added tab. */ function addTab(title, component) { return insertTab(__tabs.count, title, component) } - /*! Inserts a new tab with title at index, with an optional Component. + /*! \qmlmethod Tab TabView::insertTab(int index, string title, Component component) + Inserts a new tab with title at index, with an optional Component. Returns the newly added tab. */ function insertTab(index, title, component) { @@ -139,7 +141,8 @@ FocusScope { return tab } - /*! Removes and destroys a tab at the given \a index. */ + /*! \qmlmethod void TabView::removeTab(int index) + Removes and destroys a tab at the given \a index. */ function removeTab(index) { var tab = __tabs.get(index).tab __willRemoveIndex(index) @@ -148,7 +151,8 @@ FocusScope { __setOpacities() } - /*! Moves a tab \a from index \a to another. */ + /*! \qmlmethod void TabView::moveTab(int from, int to) + Moves a tab \a from index \a to another. */ function moveTab(from, to) { __tabs.move(from, to, 1) @@ -166,7 +170,8 @@ FocusScope { } } - /*! Returns the \l Tab item at \a index. */ + /*! \qmlmethod Tab TabView::getTab(int index) + Returns the \l Tab item at \a index. */ function getTab(index) { var data = __tabs.get(index) return data && data.tab diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml index e35f41878..a5d67faff 100644 --- a/src/controls/TableView.qml +++ b/src/controls/TableView.qml @@ -199,7 +199,7 @@ BasicTableView { signal pressAndHold(int row) /*! - \qmlmethod TableView::positionViewAtRow( int row, PositionMode mode ) + \qmlmethod void TableView::positionViewAtRow( int row, PositionMode mode ) Positions the view such that the specified \a row is at the position defined by \a mode: \list diff --git a/src/controls/TableViewColumn.qml b/src/controls/TableViewColumn.qml index 53b9ed774..9bcdfe6d5 100644 --- a/src/controls/TableViewColumn.qml +++ b/src/controls/TableViewColumn.qml @@ -134,7 +134,8 @@ QtObject { Accessible.role: Accessible.ColumnHeader - /*! Resizes the column so that the implicitWidth of the contents on every row will fit. + /*! \qmlmethod void TableViewColumn::resizeToContents() + Resizes the column so that the implicitWidth of the contents on every row will fit. \since QtQuick.Controls 1.2 */ function resizeToContents() { var minWidth = 0 diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml index 54a297069..299b18134 100644 --- a/src/controls/TextArea.qml +++ b/src/controls/TextArea.qml @@ -443,7 +443,7 @@ ScrollView { property Component menu: editMenu.defaultMenu /*! - \qmlmethod TextArea::append(string) + \qmlmethod void TextArea::append(string text) Appends \a string as a new line to the end of the text area. */ @@ -453,7 +453,7 @@ ScrollView { } /*! - \qmlmethod TextArea::copy() + \qmlmethod void TextArea::copy() Copies the currently selected text to the system clipboard. */ @@ -462,7 +462,7 @@ ScrollView { } /*! - \qmlmethod TextArea::cut() + \qmlmethod void TextArea::cut() Moves the currently selected text to the system clipboard. */ @@ -471,7 +471,7 @@ ScrollView { } /*! - \qmlmethod TextArea::deselect() + \qmlmethod void TextArea::deselect() Removes active text selection. */ @@ -502,7 +502,7 @@ ScrollView { } /*! - \qmlmethod TextArea::insert(int position, string text) + \qmlmethod void TextArea::insert(int position, string text) Inserts \a text into the TextArea at position. */ @@ -511,7 +511,7 @@ ScrollView { } /*! - \qmlmethod TextArea::isRightToLeft(int start, int end) + \qmlmethod bool TextArea::isRightToLeft(int start, int end) Returns true if the natural reading direction of the editor text found between positions \a start and \a end is right to left. @@ -521,7 +521,7 @@ ScrollView { } /*! - \qmlmethod TextArea::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters) + \qmlmethod void TextArea::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters) Moves the cursor to \a position and updates the selection according to the optional \a mode parameter. (To only move the cursor, set the \l cursorPosition property.) @@ -562,7 +562,7 @@ ScrollView { } /*! - \qmlmethod TextArea::paste() + \qmlmethod void TextArea::paste() Replaces the currently selected text by the contents of the system clipboard. */ @@ -594,7 +594,7 @@ ScrollView { } /*! - \qmlmethod TextArea::redo() + \qmlmethod void TextArea::redo() Redoes the last operation if redo is \l {canRedo}{available}. */ @@ -612,7 +612,7 @@ ScrollView { } /*! - \qmlmethod TextArea::select(int start, int end) + \qmlmethod void TextArea::select(int start, int end) Causes the text from \a start to \a end to be selected. @@ -629,7 +629,7 @@ ScrollView { } /*! - \qmlmethod TextArea::selectAll() + \qmlmethod void TextArea::selectAll() Causes all text to be selected. */ @@ -638,7 +638,7 @@ ScrollView { } /*! - \qmlmethod TextArea::selectWord() + \qmlmethod void TextArea::selectWord() Causes the word closest to the current cursor position to be selected. */ @@ -647,7 +647,7 @@ ScrollView { } /*! - \qmlmethod TextArea::undo() + \qmlmethod void TextArea::undo() Undoes the last operation if undo is \l {canUndo}{available}. Deselects any current selection, and updates the selection start to the current cursor diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml index 010561d39..589869d35 100644 --- a/src/controls/TextField.qml +++ b/src/controls/TextField.qml @@ -466,7 +466,7 @@ Control { signal editingFinished() /*! - \qmlmethod TextField::copy() + \qmlmethod void TextField::copy() Copies the currently selected text to the system clipboard. */ @@ -475,7 +475,7 @@ Control { } /*! - \qmlmethod TextField::cut() + \qmlmethod void TextField::cut() Moves the currently selected text to the system clipboard. */ @@ -484,7 +484,7 @@ Control { } /*! - \qmlmethod TextField::deselect() + \qmlmethod void TextField::deselect() Removes active text selection. */ @@ -503,7 +503,7 @@ Control { } /*! - \qmlmethod TextField::insert(int position, string text) + \qmlmethod void TextField::insert(int position, string text) Inserts \a text into the TextField at \a position. */ @@ -522,7 +522,7 @@ Control { } /*! - \qmlmethod TextField::paste() + \qmlmethod void TextField::paste() Replaces the currently selected text by the contents of the system clipboard. @@ -532,7 +532,7 @@ Control { } /*! - \qmlmethod TextField::redo() + \qmlmethod void TextField::redo() Performs the last operation if redo is \l {canRedo}{available}. */ @@ -541,7 +541,7 @@ Control { } /*! - \qmlmethod TextField::remove(int start, int end) + \qmlmethod void TextField::remove(int start, int end) \since QtQuick.Controls 1.4 Removes the section of text that is between the start and end positions. @@ -551,7 +551,7 @@ Control { } /*! - \qmlmethod TextField::select(int start, int end) + \qmlmethod void TextField::select(int start, int end) Causes the text from \a start to \a end to be selected. @@ -568,7 +568,7 @@ Control { } /*! - \qmlmethod TextField::selectAll() + \qmlmethod void TextField::selectAll() Causes all text to be selected. */ @@ -577,7 +577,7 @@ Control { } /*! - \qmlmethod TextField::selectWord() + \qmlmethod void TextField::selectWord() Causes the word closest to the current cursor position to be selected. */ @@ -586,7 +586,7 @@ Control { } /*! - \qmlmethod TextField::undo() + \qmlmethod void TextField::undo() Reverts the last operation if undo is \l {canUndo}{available}. undo() deselects any current selection and updates the selection start to the diff --git a/src/controls/qquickaction.cpp b/src/controls/qquickaction.cpp index e3512baf8..6dc07f874 100644 --- a/src/controls/qquickaction.cpp +++ b/src/controls/qquickaction.cpp @@ -172,7 +172,7 @@ QT_BEGIN_NAMESPACE The corresponding handler is \c onTriggered. */ -/*! \qmlmethod Action::trigger(QObject *source) +/*! \qmlmethod void Action::trigger(QObject *source) Will emit the \l triggered signal if the action is enabled. You may provide a source object if the Action would benefit from knowing the origin of the triggering (e.g. diff --git a/src/controls/qquickmenuitem.cpp b/src/controls/qquickmenuitem.cpp index 83577d415..8093c5fe5 100644 --- a/src/controls/qquickmenuitem.cpp +++ b/src/controls/qquickmenuitem.cpp @@ -377,7 +377,7 @@ void QQuickMenuText::updateIcon() The corresponding handler is \c onTriggered. */ -/*! \qmlmethod MenuItem::trigger() +/*! \qmlmethod void MenuItem::trigger() Manually trigger a menu item. Will also trigger the item's bound action. diff --git a/src/extras/Tumbler.qml b/src/extras/Tumbler.qml index 4743322b7..7cba6ed0e 100644 --- a/src/extras/Tumbler.qml +++ b/src/extras/Tumbler.qml @@ -136,6 +136,11 @@ import QtQuick.Layouts 1.0 Control { id: tumbler + /* + \qmlproperty Component Tumbler::style + + The style Component for this control. + */ style: Settings.styleComponent(Settings.style, "TumblerStyle.qml", tumbler) ListModel { @@ -160,6 +165,7 @@ Control { } /*! + \qmlmethod int Tumbler::currentIndexAt(int columnIndex) Returns the current index of the column at \a columnIndex, or \c null if the \a index is invalid. */ @@ -171,6 +177,7 @@ Control { } /*! + \qmlmethod void Tumbler::setCurrentIndexAt(int columnIndex, int itemIndex) Sets the current index of the column at \a columnIndex to \a itemIndex. Does nothing if \a columnIndex or \a itemIndex are invalid. @@ -190,7 +197,8 @@ Control { } /*! - Returns the column at \a columnIndex or \c null if the \a index is + \qmlmethod TumblerColumn Tumbler::getColumn(int columnIndex) + Returns the column at \a columnIndex or \c null if the index is invalid. */ function getColumn(columnIndex) { @@ -201,10 +209,11 @@ Control { } /*! + \qmlmethod TumblerColumn Tumbler::addColumn(TumblerColumn column) Adds a \a column and returns the added column. The \a column argument can be an instance of TumblerColumn, - or a Component. The component has to contain a TumblerColumn. + or a \l Component. The component has to contain a TumblerColumn. Otherwise \c null is returned. */ function addColumn(column) { @@ -212,10 +221,11 @@ Control { } /*! + \qmlmethod TumblerColumn Tumbler::insertColumn(int index, TumblerColumn column) Inserts a \a column at the given \a index and returns the inserted column. The \a column argument can be an instance of TumblerColumn, - or a Component. The component has to contain a TumblerColumn. + or a \l Component. The component has to contain a TumblerColumn. Otherwise, \c null is returned. */ function insertColumn(index, column) { |