
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQDesignerFormWindowCursorInterface class allows you to query and modify a form window's widget selection, and in addition modify the properties of all the form's widgets.More...
| Header: | #include <QDesignerFormWindowCursorInterface> |
| enum | MoveMode { MoveAnchor, KeepAnchor } |
| enum | MoveOperation { NoMove, Start, End, Next, ..., Down } |
| virtual | ~QDesignerFormWindowCursorInterface() |
| virtual QWidget * | current() const = 0 |
| virtual QDesignerFormWindowInterface * | formWindow() const = 0 |
| virtual bool | hasSelection() const = 0 |
| bool | isWidgetSelected(QWidget * widget) const |
| virtual bool | movePosition(MoveOperation operation, MoveMode mode = MoveAnchor) = 0 |
| virtual int | position() const = 0 |
| virtual void | resetWidgetProperty(QWidget * widget, const QString & name) = 0 |
| virtual QWidget * | selectedWidget(int index) const = 0 |
| virtual int | selectedWidgetCount() const = 0 |
| virtual void | setPosition(int position, MoveMode mode = MoveAnchor) = 0 |
| virtual void | setProperty(const QString & name, const QVariant & value) = 0 |
| virtual void | setWidgetProperty(QWidget * widget, const QString & name, const QVariant & value) = 0 |
| virtual QWidget * | widget(int index) const = 0 |
| virtual int | widgetCount() const = 0 |
TheQDesignerFormWindowCursorInterface class allows you to query and modify a form window's widget selection, and in addition modify the properties of all the form's widgets.
QDesignerFormWindowCursorInterface is a convenience class that provides an interface to the associated form window's text cursor; it provides a collection of functions that enables you to query a given form window's selection and change the selection's focus according to defined modes (MoveMode) and movements (MoveOperation). You can also use the interface to query the form's widgets and change their properties.
The interface is not intended to be instantiated directly, but to provide access to the selections and widgets ofQt Designer's current form windows.QDesignerFormWindowInterface always provides an associated cursor interface. The form window for a given widget can be retrieved using the staticQDesignerFormWindowInterface::findFormWindow() functions. For example:
QDesignerFormWindowInterface*formWindow=0; formWindow=QDesignerFormWindowInterface::findFormWindow(myWidget); formWindow->cursor()->setProperty(myWidget, myProperty, newValue);
You can retrieve any ofQt Designer's current form windows throughQt Designer'sform window manager.
Once you have a form window's cursor interface, you can check if the form window has a selection at all using thehasSelection() function. You can query the form window for its totalwidgetCount() andselectedWidgetCount(). You can retrieve the currently selected widget (or widgets) using thecurrent() orselectedWidget() functions.
You can retrieve any of the form window's widgets using thewidget() function, and check if a widget is selected using theisWidgetSelected() function. You can use thesetProperty() function to set the selected widget's properties, and thesetWidgetProperty() orresetWidgetProperty() functions to modify the properties of any given widget.
Finally, you can change the selection by changing the text cursor'sposition() using thesetPosition() andmovePosition() functions.
See alsoQDesignerFormWindowInterface andQDesignerFormWindowManagerInterface.
This enum describes the different modes that are used when the text cursor moves.
| Constant | Value | Description |
|---|---|---|
QDesignerFormWindowCursorInterface::MoveAnchor | 0 | The anchor moves with the cursor to its new location. |
QDesignerFormWindowCursorInterface::KeepAnchor | 1 | The anchor remains at the cursor's old location. |
This enum describes the types of text cursor operation that can occur in a form window.
| Constant | Value | Description |
|---|---|---|
QDesignerFormWindowCursorInterface::NoMove | 0 | The cursor does not move. |
QDesignerFormWindowCursorInterface::Start | 1 | Moves the cursor to the start of the focus chain. |
QDesignerFormWindowCursorInterface::End | 2 | Moves the cursor to the end of the focus chain. |
QDesignerFormWindowCursorInterface::Next | 3 | Moves the cursor to the next widget in the focus chain. |
QDesignerFormWindowCursorInterface::Prev | 4 | Moves the cursor to the previous widget in the focus chain. |
QDesignerFormWindowCursorInterface::Left | 5 | The cursor moves to the left. |
QDesignerFormWindowCursorInterface::Right | 6 | The cursor moves to the right. |
QDesignerFormWindowCursorInterface::Up | 7 | The cursor moves upwards. |
QDesignerFormWindowCursorInterface::Down | 8 | The cursor moves downwards. |
[virtual]QDesignerFormWindowCursorInterface::~QDesignerFormWindowCursorInterface()Destroys the cursor interface.
[pure virtual]QWidget * QDesignerFormWindowCursorInterface::current() constReturns the currently selected widget in the form window.
See alsoselectedWidget().
[pure virtual]QDesignerFormWindowInterface * QDesignerFormWindowCursorInterface::formWindow() constReturns the form window interface associated with this cursor interface.
[pure virtual]bool QDesignerFormWindowCursorInterface::hasSelection() constReturns true if the form window contains a selection; otherwise returns false.
Returns true if the specifiedwidget is selected; otherwise returns false.
[pure virtual]bool QDesignerFormWindowCursorInterface::movePosition(MoveOperation operation,MoveMode mode = MoveAnchor)Performs the givenoperation on the cursor using the specifiedmode, and returns true if it completed successfully; otherwise returns false.
See alsoposition() andsetPosition().
[pure virtual]int QDesignerFormWindowCursorInterface::position() constReturns the cursor position.
See alsosetPosition() andmovePosition().
[pure virtual]void QDesignerFormWindowCursorInterface::resetWidgetProperty(QWidget * widget, constQString & name)Resets the property with the givenname for the specifiedwidget to its default value.
See alsosetProperty() andsetWidgetProperty().
[pure virtual]QWidget * QDesignerFormWindowCursorInterface::selectedWidget(int index) constReturns the widget with the givenindex in the list of selected widgets.
See alsocurrent() andwidget().
[pure virtual]int QDesignerFormWindowCursorInterface::selectedWidgetCount() constReturns the number of selected widgets in the form window.
See alsowidgetCount().
[pure virtual]void QDesignerFormWindowCursorInterface::setPosition(int position,MoveMode mode = MoveAnchor)Sets the position of the cursor to the givenposition using themode to specify how it is moved there.
See alsoposition() andmovePosition().
[pure virtual]void QDesignerFormWindowCursorInterface::setProperty(constQString & name, constQVariant & value)Sets the property with the givenname for the currently selected widget to the specifiedvalue.
See alsosetWidgetProperty() andresetWidgetProperty().
[pure virtual]void QDesignerFormWindowCursorInterface::setWidgetProperty(QWidget * widget, constQString & name, constQVariant & value)Sets the property with the givenname for the givenwidget to the specifiedvalue.
See alsoresetWidgetProperty() andsetProperty().
[pure virtual]QWidget * QDesignerFormWindowCursorInterface::widget(int index) constReturns the widget with the givenindex in the list of widgets in the form window.
See alsoselectedWidget().
[pure virtual]int QDesignerFormWindowCursorInterface::widgetCount() constReturns the number of widgets in the form window.
See alsoselectedWidgetCount().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.