Results 1 to 2 of 2

Thread: How to significally change the itens in the same QDialog or QWidget

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How to significally change the itens in the same QDialog or QWidget

    Hello everybody!


    I have a doubt about how efficiently change the layout of a QDialog or QWidget.

    As you may know, there are some moments in which we want to complete change the buttons and lists and everything else in the same window. For example, normally when we are installing a software, a window appears with a first look, than you click "Next" and a complete different look appears, with new texts, widgets and buttons, than you may click "Next" once again, than other things appears, and so on till the moment when you say the last "OK" or "Cancel".

    Now I know how to do that, but the say doesn't seems fine. Now what I do is to create a QGridLayout with all the buttons and labels and so forth, but in the moment that the window is shown, I use the hide() function in the undesirable items. When the "Next" button is clicked, everything that I do is to use hide() once again and show() in the other items, and so forth.

    Is this right? Or is there a better way of doing this? I imagine that it would be better if I could create a different QGridLayout for each "page" of the window and each time the "next" button is clicked, it simple changes the layout.


    So, does somebody knows a better idea or the "correct" way of doing this?


    Thanks!


    Momergil

  2. #2
    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: How to significally change the itens in the same QDialog or QWidget

    QWizard is almost exactly what your are describing

Similar Threads

  1. removing duplicate itens from QList<int>
    By john_god in forum Qt Programming
    Replies: 6
    Last Post: 7th August 2014, 06:56
  2. QDialog to QWidget
    By baray98 in forum Qt Programming
    Replies: 2
    Last Post: 3rd June 2008, 07:55
  3. remove the top left icon on qwidget\qdialog
    By Equilibrium in forum Qt Programming
    Replies: 3
    Last Post: 9th November 2007, 02:40
  4. qApp->processEvents() question QWidget/QDialog
    By patrik08 in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2007, 19:30
  5. Confused QWidget and QDialog behavior
    By munna in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2006, 12:14

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.