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. Exposing Q_PROPERTY in Qt Designer with class deriving from an object with Q_GADGET
Forum Updated to NodeBB v4.3 + New Features

Exposing Q_PROPERTY in Qt Designer with class deriving from an object with Q_GADGET

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 408 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.
  • R Offline
    R Offline
    RiceWhi
    wrote on last edited by
    #1

    I have several widgets I am exposing in the Qt Designer. I have been going through and changing many of them to use Q_PROPERTY to expose properties in the property editor in Qt designer. Some of these widgets are derived both from QWidget, and other non-QObject based classes. There are some properties in these non-QObject based classes I would also like to expose to the property editor. I have attempted to do so by adding the Q_GADGET macro:

    class CCustomEditor: public QLineEdit, public CBaseInformation
    {
    	Q_OBJECT
    
    class CBaseInformation
    {
    	Q_GADGET
    	Q_PROPERTY(QString owner  READ GetOwner WRITE SetOwner)
    

    However, the property does not appear in the Qt Designer property editor pane. Is it possible to expose properties in this manner, or is it only possible to expose properties in classes derived from QObject?

    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