IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QItemEditorCreator Class

The QItemEditorCreator class makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QItemEditorCreator Class

  • Header: QItemEditorCreator

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Widgets)

    target_link_libraries(mytarget PRIVATE Qt6::Widgets)

  • qmake: QT += widgets

  • Inherits: QItemEditorCreatorBase

  • Group: QItemEditorCreator is part of model-view

Detailed Description

QItemEditorCreator is a convenience template class. It uses the template class to create editors for QItemEditorFactory. This way, it is not necessary to subclass QItemEditorCreatorBase.

 
Sélectionnez
QItemEditorCreator<MyEditor> *itemCreator =
    new QItemEditorCreator<MyEditor>("myProperty");

QItemEditorFactory *factory = new QItemEditorFactory;

The constructor takes the name of the property that contains the editing data. QStyledItemDelegate can then access the property by name when it sets and retrieves editing data. Only use this class if your editor does not define a user property (using the USER keyword in the Q_PROPERTY macro). If the widget has a user property, you should use QStandardItemEditorCreator instead.

See Also

Member Function Documentation

 

[explicit] QItemEditorCreator::QItemEditorCreator(const QByteArray &valuePropertyName)

Constructs an editor creator object using valuePropertyName as the name of the property to be used for editing. The property name is used by QStyledItemDelegate when setting and getting editor data.

Note that the valuePropertyName is only used if the editor widget does not have a user property defined.

[override virtual] QWidget *QItemEditorCreator::createWidget(QWidget *parent) const

[override virtual] QByteArray QItemEditorCreator::valuePropertyName() const

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+