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. Q_PROPERTY : problems with DESIGNABLE flag
Forum Updated to NodeBB v4.3 + New Features

Q_PROPERTY : problems with DESIGNABLE flag

Scheduled Pinned Locked Moved Solved General and Desktop
qpropertydesignable
5 Posts 2 Posters 1.6k 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.
  • G Offline
    G Offline
    Gianluca86
    wrote on 19 Jun 2017, 09:58 last edited by
    #1

    Hi everyone,
    I'm using the Q_PROPERTY to create a table, and using the DESIGNABLE flag I want to make sure that one page is visible while in another no.

    Q_PROPERTY(QPointF Position READ Position DESIGNABLE false)
    

    With this code works, while if I try to replace with a function it will not work anymore.
    Can I put a function? Is there a way to custom it?

    Thank you

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Jun 2017, 22:02 last edited by
      #2

      Hi,

      You can't use a function there, it's a constant. Either you can use designer to modify that property or you can't.

      What exactly are you trying to achieve ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gianluca86
        wrote on 20 Jun 2017, 06:35 last edited by
        #3

        I will try to explain it with a practical example.
        I have a rectangular object that has the property of the position. I create a property table where I insert the properties. This procedure is used in 2 separate pages, but I would like a page, such as a "print preview", not to display the position, but only other properties.
        The class I use to generate the table is always the same.

        I hope I have explained myself better.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 20 Jun 2017, 06:43 last edited by
          #4

          Then what about having a method in your class returning a list of the "previewable" properties ? Then you'd query only these properties in your "print preview" page and if you modify your class you only have to update that list of properties.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • G Offline
            G Offline
            Gianluca86
            wrote on 20 Jun 2017, 07:20 last edited by
            #5

            I would have preferred a quicker way using Q_PROPERTY, but I think the only way is what you've suggested to me.
            Thanks so much

            1 Reply Last reply
            1

            1/5

            19 Jun 2017, 09:58

            • Login

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