Results 1 to 8 of 8

Thread: Q_PROPERTY with binding to designer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Q_PROPERTY with binding to designer

    As the documentation says: properties that are marked as designable (most of them), will be displayed in the QtDesigner's property editor.

    Cheers,
    _

  2. #2
    Join Date
    Apr 2016
    Location
    Ravensburg, Germany
    Posts
    4
    Thanks
    8
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Q_PROPERTY with binding to designer

    What the documentation doesn't give away:
    WHERE will it be displayed in the QtDesigner's property editor?

    Robby

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Q_PROPERTY with binding to designer

    I am not sure what you mean.

    The property editor iterates over the properties and displays them grouped by the class they are declared in, starting with QObject, ending with the actual class itself.

    E.g. if you look at the properties of a QPushButton, the first section has the properties of QObject, then QWidget, then QAbstractButton, then QPushButton.

    So if you derive from QPushButton and add another property, it will be in its own section, following the QPushButton section.

    Cheers,
    _

  4. #4
    Join Date
    Apr 2016
    Location
    Ravensburg, Germany
    Posts
    4
    Thanks
    8
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Q_PROPERTY with binding to designer

    That's exactly my problem:
    My ui is a
    Qt Code:
    1. mainWindow : QMainWindow
    To copy to clipboard, switch view to plain text mode 
    when I select the mainWindow in the object-tree, there are only three categories in the property editor: QObject, QWidget and QMainWindow. There is no Category as the name of my class "mainWindow" (see following pic).
    PropertyEditor.PNG
    even if I build two new classes (Form1 : QWidget AND Form2 : Form1) and i set a Q_Property with the name smallText in Form1, i see in the property-editor of "Form2" neither a category "Form1" nor a property "smallText" in any other category.

    What am i doing wrong?
    Thanks for your help

    Robby

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Q_PROPERTY with binding to designer

    Quote Originally Posted by Big_Stone88 View Post
    That's exactly my problem:
    My ui is a
    Qt Code:
    1. mainWindow : QMainWindow
    To copy to clipboard, switch view to plain text mode 
    when I select the mainWindow in the object-tree, there are only three categories in the property editor: QObject, QWidget and QMainWindow. There is no Category as the name of my class "mainWindow" (see following pic).
    The type is QMainWindow, as you can see in the second column in the object tree view.


    Quote Originally Posted by Big_Stone88 View Post
    even if I build two new classes (Form1 : QWidget AND Form2 : Form1) and i set a Q_Property with the name smallText in Form1, i see in the property-editor of "Form2" neither a category "Form1" nor a property "smallText" in any other category.
    Does the designer plugin that provides "Form1" create instances of Form1 or maybe just QWidget?
    Does Form1 have the Q_OBJECT macro additional to the Q_PROPERTY macro?

    Cheers,
    _

Similar Threads

  1. Q_property
    By Ini in forum Qt Programming
    Replies: 1
    Last Post: 4th April 2016, 08:39
  2. Pointer in Q_PROPERTY
    By pkorzeniewski in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2012, 09:32
  3. Q_property
    By micky in forum Qt Programming
    Replies: 2
    Last Post: 23rd April 2012, 18:51
  4. Why and when to use Q_PROPERTY
    By Vanir in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2007, 09:25
  5. How to Use Q_PROPERTY
    By mitesh_modi in forum Qt Programming
    Replies: 7
    Last Post: 20th June 2006, 14:49

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.