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. Expose Q_PROPERTY variable in QT Designer?
Forum Updated to NodeBB v4.3 + New Features

Expose Q_PROPERTY variable in QT Designer?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 432 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.
  • C Offline
    C Offline
    Calicoder
    wrote on last edited by
    #1

    Hello fellow QT'ers, I'm keeping myself busy lately reading the QT docs and trying out the different classes. Incredible stuff. I'm just wondering as I don't see this posted anywhere, is it possible to expose an int variable for example from a C++ class to QT Designer so I can set it in there?

    I tried the following by adding it to the header file but I don't see it when I open QT Designer:

    Q_PROPERTY(bool clickEnabled READ getClickEnabled WRITE setClickEnabled)
    

    Thanks a million for the tips.

    M 1 Reply Last reply
    0
    • C Calicoder

      Hello fellow QT'ers, I'm keeping myself busy lately reading the QT docs and trying out the different classes. Incredible stuff. I'm just wondering as I don't see this posted anywhere, is it possible to expose an int variable for example from a C++ class to QT Designer so I can set it in there?

      I tried the following by adding it to the header file but I don't see it when I open QT Designer:

      Q_PROPERTY(bool clickEnabled READ getClickEnabled WRITE setClickEnabled)
      

      Thanks a million for the tips.

      M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      @Calicoder
      You can add a property in the Property editor panel:
      add-custom-properties

      Or create a plug-in:
      adding-plugins

      C 1 Reply Last reply
      1
      • M mpergand

        @Calicoder
        You can add a property in the Property editor panel:
        add-custom-properties

        Or create a plug-in:
        adding-plugins

        C Offline
        C Offline
        Calicoder
        wrote on last edited by
        #3

        @mpergand said in Expose Q_PROPERTY variable in QT Designer?:

        @Calicoder
        You can add a property in the Property editor panel:
        add-custom-properties

        Cool I'll give that a try.

        Or create a plug-in:
        adding-plugins

        This one intrigues me for sure, I see from the docs that this plugin is what is listed on the left side in Qt Designer right? Is it as simple as adding a Q_PROPERTY with a READ and WRITE to that same plugin?

        Appreciate the tips btw, thanks!

        M 1 Reply Last reply
        0
        • C Calicoder

          @mpergand said in Expose Q_PROPERTY variable in QT Designer?:

          @Calicoder
          You can add a property in the Property editor panel:
          add-custom-properties

          Cool I'll give that a try.

          Or create a plug-in:
          adding-plugins

          This one intrigues me for sure, I see from the docs that this plugin is what is listed on the left side in Qt Designer right? Is it as simple as adding a Q_PROPERTY with a READ and WRITE to that same plugin?

          Appreciate the tips btw, thanks!

          M Offline
          M Offline
          mpergand
          wrote on last edited by mpergand
          #4

          @Calicoder
          To create a plugin is a lot of work.
          I tried a few years ago with Qt 5.3 or something and after working hard on it, I realised that on Mac it makes QCreator to crash that's all !
          and only works with the stand-alone version of QDesigner.
          So i gave up.
          Anyway, for complex interfaces, i'm building all by code, overall is much easier if you have many custom widgets with a lot of properties to set.
          I'm using QDesigner only for simple interfaces with standard widgets like Preferences dialog and things like that.

          C 1 Reply Last reply
          1
          • M mpergand

            @Calicoder
            To create a plugin is a lot of work.
            I tried a few years ago with Qt 5.3 or something and after working hard on it, I realised that on Mac it makes QCreator to crash that's all !
            and only works with the stand-alone version of QDesigner.
            So i gave up.
            Anyway, for complex interfaces, i'm building all by code, overall is much easier if you have many custom widgets with a lot of properties to set.
            I'm using QDesigner only for simple interfaces with standard widgets like Preferences dialog and things like that.

            C Offline
            C Offline
            Calicoder
            wrote on last edited by
            #5

            @mpergand That's good to know, I'll stick with using dynamic properties after all. Thinking I would have to add these manually to each widget I want? Couldn't be as easy as setting a dynamic property for say a class and use that and have it show up in Qt Designer.

            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