Results 1 to 3 of 3

Thread: Is is possible to add variables and functions to a ui generated from QtDesigner ?

  1. #1
    Join Date
    Oct 2008
    Posts
    28
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Is is possible to add variables and functions to a ui generated from QtDesigner ?

    Is that possible ? Or the suggested way is to call the Ui from a different, custom class and then play with the variables inside Ui ?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is is possible to add variables and functions to a ui generated from QtDesigner ?

    I've shown in another thread to you how to get access to members in ui.
    if you use the first method then all members from ui will be inherited.
    if you use the second one then using member m_ui you can get access.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Oct 2006
    Location
    Hawaii
    Posts
    130
    Thanks
    48
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is is possible to add variables and functions to a ui generated from QtDesigner ?

    one way is to access the existing members in the widgets of the UI, but if you want to add more functions to a widget or use a custom widget, you can put a similar placeholder widget in the UI and "promote" it to your custom widget. Heres a post I had not too long ago in the programming thread where I wanted to get the drag and drop functionality out of a QTableWidget that I inserted in a UI file. Since i wanted a custom signal, i needed to put the placeholder and promote it.

    Heres the link, it shows code for drag and drop, but you can use the same concept for other widgets/adding other functions.

    http://www.qtcentre.org/forum/f-qt-p...ile-17536.html

  4. The following user says thank you to tpf80 for this useful post:

    Cruz (20th January 2009)

Similar Threads

  1. DLL exporting functions, variables, class
    By Shuchi Agrawal in forum Newbie
    Replies: 1
    Last Post: 25th April 2007, 11:40

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.