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. Creating Dynamic Properties in a custom widget that shows in Qt Designer
Forum Update on Monday, May 27th 2025

Creating Dynamic Properties in a custom widget that shows in Qt Designer

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 3.5k Views
  • 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.
  • L Offline
    L Offline
    Lallen
    wrote on 10 Oct 2011, 11:40 last edited by
    #1

    I need to add dynamic properties that shows in Qt Designer to a custom widget at runtime.

    I can create a dynamic property using
    @QObject::setProperty("myDynamicProp", QVariant(1234))@
    But this property does not show up in Qt Designer

    If I manually create the dynamic propety in Qt designer I can change it with
    @QDesignerFormWindowInterface * formWindow = QDesignerFormWindowInterface::findFormWindow(this);
    formWindow->cursor()->setWidgetProperty(this, QString("myDynamicProp"), QVariant(4321));@
    But if the property does not already exist in Qt designer this fails.

    Any ideas how to create Dynamic Properties that shows up in Qt Designers property editor?

    (I don't know what properties I need at compile time so Q_PROP.. is not an alternative.)

    1 Reply Last reply
    0

    1/1

    10 Oct 2011, 11:40

    • Login

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