QDesignerFormWindowCursorInterface Class
La clase QDesignerFormWindowCursorInterface permite consultar y modificar la selección de widgets de una ventana de formulario, y además modificar las propiedades de todos los widgets del formulario. Más...
| Cabecera: | #include <QDesignerFormWindowCursorInterface> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Designer)target_link_libraries(mytarget PRIVATE Qt6::Designer) |
| qmake: | QT += designer |
Tipos Públicos
| enum | MoveMode { MoveAnchor, KeepAnchor } |
| enum | MoveOperation { NoMove, Start, End, Next, Prev, …, Down } |
Funciones Públicas
| 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(QDesignerFormWindowCursorInterface::MoveOperation operation, QDesignerFormWindowCursorInterface::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, QDesignerFormWindowCursorInterface::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 |
Descripción Detallada
QDesignerFormWindowCursorInterface es una clase práctica que proporciona una interfaz para el cursor de texto de la ventana de formulario asociada; proporciona una colección de funciones que permiten consultar la selección de una ventana de formulario dada y cambiar el foco de la selección de acuerdo con los modos (MoveMode) y movimientos (MoveOperation) definidos. También puedes utilizar la interfaz para consultar los widgets del formulario y cambiar sus propiedades.
La interfaz no está pensada para ser instanciada directamente, sino para proporcionar acceso a las selecciones y widgets de las ventanas de formulario actuales de Qt Widgets Designer. QDesignerFormWindowInterface siempre proporciona una interfaz de cursor asociada. La ventana de formulario para un widget dado puede recuperarse utilizando las funciones estáticas QDesignerFormWindowInterface::findFormWindow(). Por ejemplo:
auto *formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget); formWindow->cursor()->setProperty(myWidget, myProperty, newValue);
Puede recuperar cualquiera de las ventanas de formulario actuales de Qt Widgets Designer a través de Qt Widgets Designer's form window manager.
Una vez que tenga la interfaz del cursor de una ventana de formulario, puede comprobar si la ventana de formulario tiene una selección utilizando la función hasSelection(). Puede consultar el total de la ventana de formulario widgetCount() y selectedWidgetCount(). Puede recuperar el widget (o widgets) actualmente seleccionado utilizando las funciones current() o selectedWidget().
Puede recuperar cualquiera de los widgets de la ventana de formulario utilizando la función widget(), y comprobar si un widget está seleccionado utilizando la función isWidgetSelected(). Puede utilizar la función setProperty() para establecer las propiedades del widget seleccionado, y las funciones setWidgetProperty() o resetWidgetProperty() para modificar las propiedades de cualquier widget dado.
Por último, puede modificar la selección cambiando el cursor de texto position() mediante las funciones setPosition() y movePosition().
Véase también QDesignerFormWindowInterface y QDesignerFormWindowManagerInterface.
Documentación de tipos de miembros
enum QDesignerFormWindowCursorInterface::MoveMode
Este enum describe los diferentes modos que se utilizan cuando el cursor de texto se mueve.
| Constante | Valor | Descripción |
|---|---|---|
QDesignerFormWindowCursorInterface::MoveAnchor | 0 | El ancla se mueve con el cursor a su nueva ubicación. |
QDesignerFormWindowCursorInterface::KeepAnchor | 1 | El ancla permanece en la antigua ubicación del cursor. |
enum QDesignerFormWindowCursorInterface::MoveOperation
Este enum describe los tipos de operación del cursor de texto que pueden ocurrir en una ventana de formulario.
| Constante | Valor | Descripción |
|---|---|---|
QDesignerFormWindowCursorInterface::NoMove | 0 | El cursor no se mueve. |
QDesignerFormWindowCursorInterface::Start | 1 | Mueve el cursor al principio de la cadena de enfoque. |
QDesignerFormWindowCursorInterface::End | 2 | Mueve el cursor al final de la cadena de enfoque. |
QDesignerFormWindowCursorInterface::Next | 3 | Mueve el cursor al siguiente widget de la cadena de enfoque. |
QDesignerFormWindowCursorInterface::Prev | 4 | Mueve el cursor al widget anterior de la cadena de enfoque. |
QDesignerFormWindowCursorInterface::Left | 5 | El cursor se desplaza hacia la izquierda. |
QDesignerFormWindowCursorInterface::Right | 6 | El cursor se desplaza hacia la derecha. |
QDesignerFormWindowCursorInterface::Up | 7 | El cursor se desplaza hacia arriba. |
QDesignerFormWindowCursorInterface::Down | 8 | El cursor se desplaza hacia abajo. |
Documentación de las funciones miembro
[virtual constexpr noexcept] QDesignerFormWindowCursorInterface::~QDesignerFormWindowCursorInterface()
Destruye la interfaz del cursor.
[pure virtual] QWidget *QDesignerFormWindowCursorInterface::current() const
Devuelve el widget actualmente seleccionado en la ventana del formulario.
Véase también selectedWidget().
[pure virtual] QDesignerFormWindowInterface *QDesignerFormWindowCursorInterface::formWindow() const
Devuelve la interfaz de la ventana de formulario asociada a esta interfaz de cursor.
[pure virtual] bool QDesignerFormWindowCursorInterface::hasSelection() const
Devuelve true si la ventana del formulario contiene una selección; en caso contrario devuelve false.
bool QDesignerFormWindowCursorInterface::isWidgetSelected(QWidget *widget) const
Devuelve true si el widget especificado está seleccionado; en caso contrario devuelve false.
[pure virtual] bool QDesignerFormWindowCursorInterface::movePosition(QDesignerFormWindowCursorInterface::MoveOperation operation, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor)
Realiza el operation dado en el cursor usando el mode especificado, y devuelve true si se completó con éxito; en caso contrario devuelve false.
Véase también position() y setPosition().
[pure virtual] int QDesignerFormWindowCursorInterface::position() const
Devuelve la posición del cursor.
Véase también setPosition() y movePosition().
[pure virtual] void QDesignerFormWindowCursorInterface::resetWidgetProperty(QWidget *widget, const QString &name)
Restablece la propiedad con el name dado para el widget especificado a su valor por defecto.
Véase también setProperty() y setWidgetProperty().
[pure virtual] QWidget *QDesignerFormWindowCursorInterface::selectedWidget(int index) const
Devuelve el widget con la dirección index en la lista de widgets seleccionados.
Véase también current() y widget().
[pure virtual] int QDesignerFormWindowCursorInterface::selectedWidgetCount() const
Devuelve el número de widgets seleccionados en la ventana del formulario.
Véase también widgetCount().
[pure virtual] void QDesignerFormWindowCursorInterface::setPosition(int position, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor)
Establece la posición del cursor en el position dado utilizando el mode para especificar cómo se mueve hasta allí.
Véase también position() y movePosition().
[pure virtual] void QDesignerFormWindowCursorInterface::setProperty(const QString &name, const QVariant &value)
Establece la propiedad con el name dado para el widget actualmente seleccionado al value especificado.
Véase también setWidgetProperty() y resetWidgetProperty().
[pure virtual] void QDesignerFormWindowCursorInterface::setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value)
Establece la propiedad con el name dado para el widget dado al value especificado .
Véase también resetWidgetProperty() y setProperty().
[pure virtual] QWidget *QDesignerFormWindowCursorInterface::widget(int index) const
Devuelve el widget con el index dado en la lista de widgets de la ventana del formulario.
Véase también selectedWidget().
[pure virtual] int QDesignerFormWindowCursorInterface::widgetCount() const
Devuelve el número de widgets en la ventana del formulario.
Véase también selectedWidgetCount().
© 2026 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 the GNU 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.