Results 1 to 3 of 3

Thread: Is QT ui inheritable?

  1. #1
    Join Date
    Sep 2009
    Location
    Surrey, BC, Canada
    Posts
    110
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Is QT ui inheritable?

    Hi, all:

    I'm wondering if QT ui inheritable?
    Say, I've got one .ui named "father.ui",
    In "son.ui", I just added up some other widgets upon existing "father.ui".

    I'm just wondering, if I can inherit "father.ui" in "son.ui"?

    If it's possible, how to deal with it?

    Best Regards
    JIA
    Welcome to Vision Open
    http://www.visionopen.com

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is QT ui inheritable?

    You can use son.ui to create a QWidget derived object and then use that object in father.ui, if thats what you mean.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Is QT ui inheritable?

    you are mixing tings.
    The *.ui files are files, you can't "inherit" them in C++.
    (although you can load them dynamically in code, and extract the classes they contain, and inherit those classes)

    These files however contain classes and you can inherit these classes, and yes, also in other ui's.
    Though from the way you are asking, I am not sure what do you understand by "inheriting".
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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.