Results 1 to 3 of 3

Thread: Advanced use of QUiLoader

  1. #1
    Join Date
    Oct 2009
    Location
    Vienna, Austria
    Posts
    57
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Advanced use of QUiLoader

    I'm aware that this is a cross post but I'm not sure what is the appropriate forum.

    I would need to load some ui resources converted from an other application (the ui files are generated form a 3rd party dialog editor) and use the QUiLoader to load the resources and manipulate the creation of widgets by overwriting the QUiLoader::createWidget method.

    I actually need to create some "special" widgets based on some dynamic properties that are added to the ui file but unfortunately the QUiLoader::createWidget method does not seem to offer any information about the properties in the ui file.

    I came only up with a very ugly way to solve this until now (create a temporary parent first to get the dynamic properties, delete it and then start again with the real parent widget) and would be most interested to hear how the Qt gurus would solve this (not so untypical) problem.

    Thank you in advance!
    Last edited by doberkofler; 28th October 2009 at 17:51.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Advanced use of QUiLoader

    the Qt idiom is: create the widget "naked" and then set the properties afterwards with QObject::setProperty(). (Thus the createWidget call does not need to know about properties set in the .ui file).

  3. The following user says thank you to caduel for this useful post:

    doberkofler (29th October 2009)

  4. #3
    Join Date
    Oct 2009
    Location
    Vienna, Austria
    Posts
    57
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Advanced use of QUiLoader

    I understand but what if in my case not only the class name but also some dynamic properties are needed to know what widget needs to be created?

Similar Threads

  1. Advanced use of QUiLoader
    By doberkofler in forum Newbie
    Replies: 0
    Last Post: 27th October 2009, 22:02
  2. slightly more advanced QRubberBand
    By momesana in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2008, 02:00
  3. Trouble with QUiLoader in MSVC++
    By WinchellChung in forum Newbie
    Replies: 1
    Last Post: 20th February 2008, 16:25
  4. Qt advanced plugin system(qtaps)
    By hotsherbert in forum Qt-based Software
    Replies: 16
    Last Post: 25th March 2007, 23:33
  5. Replies: 13
    Last Post: 1st October 2006, 18:02

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