QDesignerFormWindowCursorInterface Class
La classe QDesignerFormWindowCursorInterface consente di interrogare e modificare la selezione dei widget di una finestra di modulo, oltre a modificare le proprietà di tutti i widget del modulo. Per saperne di più...
| Intestazione: | #include <QDesignerFormWindowCursorInterface> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Designer) target_link_libraries(mytarget PRIVATE Qt6::Designer) |
| qmake: | QT += designer |
Tipi pubblici
| enum | MoveMode { MoveAnchor, KeepAnchor } |
| enum | MoveOperation { NoMove, Start, End, Next, Prev, …, Down } |
Funzioni pubbliche
| QDesignerFormWindowCursorInterface() | |
| QDesignerFormWindowCursorInterface(const QDesignerFormWindowCursorInterface &) | |
| QDesignerFormWindowCursorInterface(QDesignerFormWindowCursorInterface &&) | |
| 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 |
| QDesignerFormWindowCursorInterface & | operator=(QDesignerFormWindowCursorInterface &&) |
| QDesignerFormWindowCursorInterface & | operator=(const QDesignerFormWindowCursorInterface &) |
Descrizione dettagliata
QDesignerFormWindowCursorInterface è una classe di utilità che fornisce un'interfaccia per il cursore di testo della finestra del modulo associata; offre una serie di funzioni che consentono di interrogare la selezione di una determinata finestra del modulo e di modificare il focus della selezione in base alle modalità definite (MoveMode) e ai movimenti (MoveOperation). È inoltre possibile utilizzare l’interfaccia per interrogare i widget del modulo e modificarne le proprietà.
L’interfaccia non è pensata per essere istanziata direttamente, ma per fornire accesso alle selezioni e ai widget delle finestre del modulo correnti di ` Qt Widgets Designer`. ` QDesignerFormWindowInterface ` fornisce sempre un’interfaccia cursore associata. La finestra del modulo relativa a un determinato widget può essere recuperata utilizzando le funzioni statiche ` QDesignerFormWindowInterface::findFormWindow()`. Ad esempio:
auto *formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget);
formWindow->cursor()->setProperty(myWidget, myProperty, newValue);È possibile recuperare qualsiasi finestra di modulo corrente di Qt Widgets Designer tramite la funzione form window manager di Qt Widgets Designer.
Una volta ottenuta l’interfaccia del cursore di una finestra del modulo, è possibile verificare se la finestra del modulo presenta una selezione utilizzando la funzione ` hasSelection()`. È possibile interrogare la finestra del modulo per ottenere il numero totale di ` widgetCount()` e ` selectedWidgetCount()`. È possibile recuperare il widget (o i widget) attualmente selezionato utilizzando le funzioni ` current()` o ` selectedWidget()`.
È possibile recuperare qualsiasi widget della finestra del modulo utilizzando la funzione widget(), e verificare se un widget è selezionato utilizzando la funzione isWidgetSelected(). È possibile utilizzare la funzione setProperty() per impostare le proprietà del widget selezionato, e le funzioni setWidgetProperty() o resetWidgetProperty() per modificare le proprietà di un dato widget.
Infine, è possibile modificare la selezione cambiando la posizione del cursore di testo ( position()) utilizzando le funzioni setPosition() e movePosition().
Vedi anche QDesignerFormWindowInterface e QDesignerFormWindowManagerInterface.
Documentazione sui tipi di membro
enum QDesignerFormWindowCursorInterface::MoveMode
Questa enumerazione descrive le diverse modalità utilizzate durante lo spostamento del cursore di testo.
| Costante | Valore | Descrizione |
|---|---|---|
QDesignerFormWindowCursorInterface::MoveAnchor | 0 | L'ancora si sposta con il cursore nella sua nuova posizione. |
QDesignerFormWindowCursorInterface::KeepAnchor | 1 | L'ancora rimane nella posizione precedente del cursore. |
enum QDesignerFormWindowCursorInterface::MoveOperation
Questa enumerazione descrive i tipi di operazioni del cursore di testo che possono verificarsi in una finestra di modulo.
| Costante | Valore | Descrizione |
|---|---|---|
QDesignerFormWindowCursorInterface::NoMove | 0 | Il cursore non si sposta. |
QDesignerFormWindowCursorInterface::Start | 1 | Sposta il cursore all'inizio della catena di focus. |
QDesignerFormWindowCursorInterface::End | 2 | Sposta il cursore alla fine della catena di focus. |
QDesignerFormWindowCursorInterface::Next | 3 | Sposta il cursore sul widget successivo nella catena di focus. |
QDesignerFormWindowCursorInterface::Prev | 4 | Sposta il cursore sul widget precedente nella catena di focus. |
QDesignerFormWindowCursorInterface::Left | 5 | Il cursore si sposta a sinistra. |
QDesignerFormWindowCursorInterface::Right | 6 | Il cursore si sposta a destra. |
QDesignerFormWindowCursorInterface::Up | 7 | Il cursore si sposta verso l'alto. |
QDesignerFormWindowCursorInterface::Down | 8 | Il cursore si sposta verso il basso. |
Documentazione delle funzioni membro
[constexpr noexcept default] QDesignerFormWindowCursorInterface::QDesignerFormWindowCursorInterface()
Crea un'istanza di ` QDesignerFormWindowCursorInterface` con i valori predefiniti.
[delete] QDesignerFormWindowCursorInterface::QDesignerFormWindowCursorInterface(const QDesignerFormWindowCursorInterface &)
Crea una copia di un'istanza di ` QDesignerFormWindowCursorInterface`. Questa funzione è stata eliminata.
[delete] QDesignerFormWindowCursorInterface::QDesignerFormWindowCursorInterface(QDesignerFormWindowCursorInterface &&)
Crea un'istanza di ` QDesignerFormWindowCursorInterface`. Questa funzione è stata eliminata.
[virtual constexpr noexcept default] QDesignerFormWindowCursorInterface::~QDesignerFormWindowCursorInterface()
Elimina l'interfaccia del cursore.
[pure virtual] QWidget *QDesignerFormWindowCursorInterface::current() const
Restituisce il widget attualmente selezionato nella finestra del modulo.
Vedi anche selectedWidget().
[pure virtual] QDesignerFormWindowInterface *QDesignerFormWindowCursorInterface::formWindow() const
Restituisce l'interfaccia della finestra del modulo associata a questa interfaccia del cursore.
[pure virtual] bool QDesignerFormWindowCursorInterface::hasSelection() const
Restituisce true se la finestra del modulo contiene una selezione; altrimenti restituisce false.
bool QDesignerFormWindowCursorInterface::isWidgetSelected(QWidget *widget) const
Restituisce "true" se l'widget e specificato è selezionato; altrimenti restituisce "false".
[pure virtual] bool QDesignerFormWindowCursorInterface::movePosition(QDesignerFormWindowCursorInterface::MoveOperation operation, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor)
Esegue l'operation specificato sul cursore utilizzando l'mode specificato e restituisce true se l'operazione è stata completata con successo; in caso contrario, restituisce false.
Vedi anche position() e setPosition().
[pure virtual] int QDesignerFormWindowCursorInterface::position() const
Restituisce la posizione del cursore.
Vedi anche setPosition() e movePosition().
[pure virtual] void QDesignerFormWindowCursorInterface::resetWidgetProperty(QWidget *widget, const QString &name)
Reimposta la proprietà con l'name e specificato per l'widget e indicato al suo valore predefinito.
Vedi anche setProperty() e setWidgetProperty().
[pure virtual] QWidget *QDesignerFormWindowCursorInterface::selectedWidget(int index) const
Restituisce il widget con l'index specificato nell'elenco dei widget selezionati.
Vedi anche current() e widget().
[pure virtual] int QDesignerFormWindowCursorInterface::selectedWidgetCount() const
Restituisce il numero di widget selezionati nella finestra del modulo.
Vedi anche widgetCount().
[pure virtual] void QDesignerFormWindowCursorInterface::setPosition(int position, QDesignerFormWindowCursorInterface::MoveMode mode = MoveAnchor)
Imposta la posizione del cursore sull'position specificato, utilizzando l'mode per specificare come spostarlo in quel punto.
Vedi anche ` position()` e ` movePosition()`.
[pure virtual] void QDesignerFormWindowCursorInterface::setProperty(const QString &name, const QVariant &value)
Imposta la proprietà con l'name specificato per il widget attualmente selezionato sul valore specificato value.
Vedi anche setWidgetProperty() e resetWidgetProperty().
[pure virtual] void QDesignerFormWindowCursorInterface::setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value)
Imposta la proprietà con l'name specificato per l'widget specificato sul valore value specificato.
Vedi anche resetWidgetProperty() e setProperty().
[pure virtual] QWidget *QDesignerFormWindowCursorInterface::widget(int index) const
Restituisce il widget con l'index e specificato nell'elenco dei widget nella finestra del modulo.
Vedi anche selectedWidget().
[pure virtual] int QDesignerFormWindowCursorInterface::widgetCount() const
Restituisce il numero di widget presenti nella finestra del modulo.
Vedi anche selectedWidgetCount().
[delete] QDesignerFormWindowCursorInterface &QDesignerFormWindowCursorInterface::operator=(QDesignerFormWindowCursorInterface &&)
Assegna " other " a questa istanza di " QDesignerFormWindowCursorInterface ". Questa funzione viene eliminata.
[delete] QDesignerFormWindowCursorInterface &QDesignerFormWindowCursorInterface::operator=(const QDesignerFormWindowCursorInterface &)
Copia e assegna other a questa istanza di QDesignerFormWindowCursorInterface. Questa funzione viene eliminata.
© 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.