Results 1 to 9 of 9

Thread: Qt GUI Application

  1. #1
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    4
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Question Qt GUI Application

    Hi Everybody,
    I am new to Qt development.I have to develop a Qt GUI Application with one parent and multiple windows.what i want exactly one main window called home window like one frame which contains home page and menus,controls.when i click a menu,a new panel has to come and remove a home panel and data has to be transfer between panels.i know java swing,thats why i am talking about panels and frames.what is the equivalent of frame and panels in qt.i referred some qt mainwindow examples.i referred layouts.but i couldn't develop anything.i am able to create separate window applications.And i am facing difficulty with layout also.

    Anybody help me to develop a GUI Application with multiple panels or windows(i referred MDI also.that is not applicable for me).can u give small applicatin source or what alse i have to do?guide me please...

    Qt version: 4.8
    Os :fedora 16

  2. #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: Qt GUI Application

    If you want a window to have different content depending on the application state have a look at QStackedWidget.
    It is basically a stack of pages and the program decides which page is "on top" and thus visible.

    If I remember Swing correctly, a panel is just a container so the euqivalent would be QWidget.
    If you need a top level window just pass 0 as the parent argument to the constructor of any QWidget class.

    Cheers,
    _

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

    selva kumar (31st July 2013)

  4. #3
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    4
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt GUI Application

    Thank you for your reply.

    Which is equivalent to component?.because i have to remove old widget,while loading new widget.
    I need one home page.so i will make home page as QMainwindow.how do i change home page to next window or widget?.

  5. #4
    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: Qt GUI Application

    I guess the closest thing is QWidget.

    But I am not sure why you need to remove something? Conserving memory?

    Cheers,
    _

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

    selva kumar (5th August 2013)

  7. #5
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    4
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt GUI Application

    I am not going to remove a window.just overriding the new window or hide the old one,show the new one.
    how to do it?.

  8. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt GUI Application

    You already have the answer: QStackedWidget

  9. The following user says thank you to ChrisW67 for this useful post:

    selva kumar (7th August 2013)

  10. #7
    Join Date
    Jul 2013
    Posts
    4
    Thanks
    4
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt GUI Application

    I have a mainwindow,which contains header on top,frame in center and statusbar on the bottom.i tired to add some layout on the frame.but i could not add,and it says "QLayout: Attempting to add QLayout "" to MainWindow "MainWindow", which already has a layout".how to add my layout on the frame?.

    ->i have one more frame with some layouts.i want to remove or hide that previous frame,and show the new frame.how to do it?.

  11. #8
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt GUI Application

    Just read how QWidget::setLayout is working.

  12. #9
    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: Qt GUI Application

    Quote Originally Posted by selva kumar View Post
    I have a mainwindow,which contains header on top,frame in center and statusbar on the bottom.i tired to add some layout on the frame.but i could not add,and it says "QLayout: Attempting to add QLayout "" to MainWindow "MainWindow", which already has a layout".how to add my layout on the frame?.
    by setting the layout on the frame, not on the main window.
    or by passing the frame to the layout's constructor, which basically does the same. Just don't use the main window if you don't want to affect the main window.

    Quote Originally Posted by selva kumar View Post
    ->i have one more frame with some layouts.i want to remove or hide that previous frame,and show the new frame.how to do it?.
    You know, this is getting old.
    Repeating the question will not change the answer, it is just becoming very annoying.

    Cheers,
    _

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

    selva kumar (21st August 2013)

Similar Threads

  1. Replies: 4
    Last Post: 19th November 2012, 14:35
  2. Replies: 9
    Last Post: 18th July 2012, 12:45
  3. Replies: 2
    Last Post: 7th September 2011, 13:12
  4. Replies: 1
    Last Post: 30th May 2011, 13:46
  5. Replies: 3
    Last Post: 6th January 2010, 16:55

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.