- class QDesignerFormWindowCursorInterface¶
The
QDesignerFormWindowCursorInterface
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…Synopsis¶
Methods¶
def
__init__()
Virtual methods¶
def
current()
def
formWindow()
def
hasSelection()
def
movePosition()
def
position()
def
selectedWidget()
def
setPosition()
def
setProperty()
def
widget()
def
widgetCount()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Warning
This section contains snippets that were automatically translated from C++ to Python and may contain errors.
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 of Qt Widgets Designer’s current form windows.
QDesignerFormWindowInterface
always provides an associated cursor interface. The form window for a given widget can be retrieved using the staticfindFormWindow()
functions. For example:formWindow = QDesignerFormWindowInterface.findFormWindow(myWidget) formWindow.cursor().setProperty(myWidget, myProperty, newValue)
You can retrieve any of Qt Widgets Designer’s current form windows through Qt Widgets Designer’s
form window manager
.Once you have a form window’s cursor interface, you can check if the form window has a selection at all using the
hasSelection()
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 the
widget()
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’s
position()
using thesetPosition()
andmovePosition()
functions.- class MoveOperation¶
This enum describes the types of text cursor operation that can occur in a form window.
Constant
Description
QDesignerFormWindowCursorInterface.NoMove
The cursor does not move.
QDesignerFormWindowCursorInterface.Start
Moves the cursor to the start of the focus chain.
QDesignerFormWindowCursorInterface.End
Moves the cursor to the end of the focus chain.
QDesignerFormWindowCursorInterface.Next
Moves the cursor to the next widget in the focus chain.
QDesignerFormWindowCursorInterface.Prev
Moves the cursor to the previous widget in the focus chain.
QDesignerFormWindowCursorInterface.Left
The cursor moves to the left.
QDesignerFormWindowCursorInterface.Right
The cursor moves to the right.
QDesignerFormWindowCursorInterface.Up
The cursor moves upwards.
QDesignerFormWindowCursorInterface.Down
The cursor moves downwards.
- class MoveMode¶
This enum describes the different modes that are used when the text cursor moves.
Constant
Description
QDesignerFormWindowCursorInterface.MoveAnchor
The anchor moves with the cursor to its new location.
QDesignerFormWindowCursorInterface.KeepAnchor
The anchor remains at the cursor’s old location.
- __init__()¶
Returns the currently selected widget in the form window.
See also
- abstract formWindow()¶
- Return type:
Returns the form window interface associated with this cursor interface.
- abstract hasSelection()¶
- Return type:
bool
Returns true if the form window contains a selection; otherwise returns false.
Returns true if the specified
widget
is selected; otherwise returns false.- abstract movePosition(op[, mode=QDesignerFormWindowCursorInterface.MoveMode.MoveAnchor])¶
- Parameters:
op –
MoveOperation
mode –
MoveMode
- Return type:
bool
Performs the given
operation
on the cursor using the specifiedmode
, and returns true if it completed successfully; otherwise returns false.See also
- abstract position()¶
- Return type:
int
Returns the cursor position.
See also
Resets the property with the given
name
for the specifiedwidget
to its default value.See also
Returns the widget with the given
index
in the list of selected widgets.- abstract selectedWidgetCount()¶
- Return type:
int
Returns the number of selected widgets in the form window.
See also
- abstract setPosition(pos[, mode=QDesignerFormWindowCursorInterface.MoveMode.MoveAnchor])¶
- Parameters:
pos – int
mode –
MoveMode
Sets the position of the cursor to the given
position
using themode
to specify how it is moved there.See also
- abstract setProperty(name, value)¶
- Parameters:
name – str
value – object
Sets the property with the given
name
for the currently selected widget to the specifiedvalue
.See also
- abstract setWidgetProperty(widget, name, value)¶
- Parameters:
widget –
QWidget
name – str
value – object
Sets the property with the given
name
for the givenwidget
to the specifiedvalue
.See also
Returns the widget with the given
index
in the list of widgets in the form window.See also
- abstract widgetCount()¶
- Return type:
int
Returns the number of widgets in the form window.
See also