Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is it possible to replace a single editor of the default QItemEditorFactory?
Qt 6.11 is out! See what's new in the release blog

Is it possible to replace a single editor of the default QItemEditorFactory?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 579 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I want to replace an editor of the default QItemEditorFactory for a single type. This editor should be used application wide in all views.

    When I create a new QItemEditorFactory with an editor for the double type:
    @
    QItemEditorFactory *itemFactory = new QItemEditorFactory;
    QItemEditorCreatorBase *editorCreator =
    new QStandardItemEditorCreator<QCustomQDoubleSpinbox>();
    itemFactory->registerEditor(QVariant::Double, editorCreator);
    QItemEditorFactory::setDefaultFactory(itemFactory);
    @

    The editors of all other default types are "removed".
    Is there a way to replace the editor of a single type?
    Or do I need to re-register all supported types?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved