Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QDesignerFormWindowCursorInterface Class Reference
[QtDesigner module]

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...

 #include <QDesignerFormWindowCursorInterface>

This class is not part of the Qt GUI Framework Edition.


Public Types

enum MoveMode { MoveAnchor, KeepAnchor }
enum MoveOperation { NoMove, Start, End, Next, ..., Down }

Public Functions

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

Detailed Description

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.

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 Designer's current form windows. QDesignerFormWindowInterface always provides an associated cursor interface. The form window for a given widget can be retrieved using the static QDesignerFormWindowInterface::findFormWindow() functions. For example:

     QDesignerFormWindowInterface *formWindow = 0;
     formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget);

     formWindow->cursor()->setProperty(myWidget, myProperty, newValue);

You can retrieve any of Qt Designer's current form windows through Qt 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 total widgetCount() and selectedWidgetCount(). You can retrieve the currently selected widget (or widgets) using the current() or selectedWidget() functions.

You can retrieve any of the form window's widgets using the widget() function, and check if a widget is selected using the isWidgetSelected() function. You can use the setProperty() function to set the selected widget's properties, and the setWidgetProperty() or resetWidgetProperty() functions to modify the properties of any given widget.

Finally, you can change the selection by changing the text cursor's position() using the setPosition() and movePosition() functions.

See also QDesignerFormWindowInterface and QDesignerFormWindowManagerInterface.


Member Type Documentation

enum QDesignerFormWindowCursorInterface::MoveMode

This enum describes the different modes that are used when the text cursor moves.

ConstantValueDescription
QDesignerFormWindowCursorInterface::MoveAnchor0The anchor moves with the cursor to its new location.
QDesignerFormWindowCursorInterface::KeepAnchor1The anchor remains at the cursor's old location.

enum QDesignerFormWindowCursorInterface::MoveOperation

This enum describes the types of text cursor operation that can occur in a form window.

ConstantValueDescription
QDesignerFormWindowCursorInterface::NoMove0The cursor does not move.
QDesignerFormWindowCursorInterface::Start1Moves the cursor to the start of the focus chain.
QDesignerFormWindowCursorInterface::End2Moves the cursor to the end of the focus chain.
QDesignerFormWindowCursorInterface::Next3Moves the cursor to the next widget in the focus chain.
QDesignerFormWindowCursorInterface::Prev4Moves the cursor to the previous widget in the focus chain.
QDesignerFormWindowCursorInterface::Left5The cursor moves to the left.
QDesignerFormWindowCursorInterface::Right6The cursor moves to the right.
QDesignerFormWindowCursorInterface::Up7The cursor moves upwards.
QDesignerFormWindowCursorInterface::Down8The cursor moves downwards.


Member Function Documentation

QDesignerFormWindowCursorInterface::~QDesignerFormWindowCursorInterface ()   [virtual]

Destroys the cursor interface.

QWidget * QDesignerFormWindowCursorInterface::current () const   [pure virtual]

Returns the currently selected widget in the form window.

See also selectedWidget().

QDesignerFormWindowInterface * QDesignerFormWindowCursorInterface::formWindow () const   [pure virtual]

Returns the form window interface associated with this cursor interface.

bool QDesignerFormWindowCursorInterface::hasSelection () const   [pure virtual]

Returns true if the form window contains a selection; otherwise returns false.

bool QDesignerFormWindowCursorInterface::isWidgetSelected ( QWidget * widget ) const

Returns true if the specified widget is selected; otherwise returns false.

bool QDesignerFormWindowCursorInterface::movePosition ( MoveOperation operation, MoveMode mode = MoveAnchor )   [pure virtual]

Performs the given operation on the cursor using the specified mode, and returns true if it completed successfully; otherwise returns false.

See also position() and setPosition().

int QDesignerFormWindowCursorInterface::position () const   [pure virtual]

Returns the cursor position.

See also setPosition() and movePosition().

void QDesignerFormWindowCursorInterface::resetWidgetProperty ( QWidget * widget, const QString & name )   [pure virtual]

Resets the property with the given name for the specified widget to its default value.

See also setProperty() and setWidgetProperty().

QWidget * QDesignerFormWindowCursorInterface::selectedWidget ( int index ) const   [pure virtual]

Returns the widget with the given index in the list of selected widgets.

See also current() and widget().

int QDesignerFormWindowCursorInterface::selectedWidgetCount () const   [pure virtual]

Returns the number of selected widgets in the form window.

See also widgetCount().

void QDesignerFormWindowCursorInterface::setPosition ( int position, MoveMode mode = MoveAnchor )   [pure virtual]

Sets the position of the cursor to the given position using the mode to specify how it is moved there.

See also position() and movePosition().

void QDesignerFormWindowCursorInterface::setProperty ( const QString & name, const QVariant & value )   [pure virtual]

Sets the property with the given name for the currently selected widget to the specified value.

See also setWidgetProperty() and resetWidgetProperty().

void QDesignerFormWindowCursorInterface::setWidgetProperty ( QWidget * widget, const QString & name, const QVariant & value )   [pure virtual]

Sets the property with the given name for the given widget to the specified value.

See also resetWidgetProperty() and setProperty().

QWidget * QDesignerFormWindowCursorInterface::widget ( int index ) const   [pure virtual]

Returns the widget with the given index in the list of widgets in the form window.

See also selectedWidget().

int QDesignerFormWindowCursorInterface::widgetCount () const   [pure virtual]

Returns the number of widgets in the form window.

See also selectedWidgetCount().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 44
  2. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.6
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web