Results 1 to 2 of 2

Thread: Proper way to manually set the layout of a window

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    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: Proper way to manually set the layout of a window

    Quote Originally Posted by Oleksandr View Post
    Or I can make all widgets in layout members of MainWindow class and access them directly.
    That's the way to do it.
    Member variables exist for the purpose of having access to data from all methods of an object.

    Quote Originally Posted by Oleksandr View Post
    However, I feel that neither of these is the right way.
    Why? This is how object oriented language are designed to work.

    Quote Originally Posted by Oleksandr View Post
    Is there a way to pass the widgets to ui?
    ui is a pointer to an object of a generated class.
    You can of course derive from that class, add your additional members to that and then create an instance of it.

    Or you use a second container object of a custom class.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    Oleksandr (20th September 2015)

Similar Threads

  1. QT program start without proper main window
    By s_eye in forum Qt Programming
    Replies: 6
    Last Post: 2nd July 2014, 13:06
  2. Window Layout - Custom Sizing
    By 2lights in forum Newbie
    Replies: 1
    Last Post: 10th July 2013, 18:03
  3. Help needed for proper Layout mangment
    By sikander243 in forum Newbie
    Replies: 3
    Last Post: 27th February 2013, 11:25
  4. layout's widget does not autofit to window.
    By Niamita in forum Qt Programming
    Replies: 11
    Last Post: 19th October 2011, 13:09
  5. Window Layout issue.
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2008, 21:46

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.