Results 1 to 5 of 5

Thread: Retractable GUI Area

  1. #1
    Join Date
    Aug 2012
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Retractable GUI Area

    Good Evening,

    First off I would like to apologise for my question. Typically I code command line C++ so the GUI is giving me a little trouble. I want to code a "collapsible" section within my GUI. Something like the collapsible sections on this website (vBulletin) on the forum home page.

    The section is always there but only expands and moves everything else down the page when a button is triggered. If anyone needs a better explanation I will attach a jpg.

    Want to know if this something pre-programmed for Qt or if it's a from scratch project. I am assuming there is some function I can just call to make this all very simple.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Retractable GUI Area

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2012
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: Retractable GUI Area

    Thankyou for the reply, I have played around with it and seams a little bit of overkill for what I want.

    Is there a way to make a custom widget or for example a lineEdit become visable or hidden in a few lines of simple code. Something like

    Qt Code:
    1. void MainWindow::on_checkBox_clicked()
    2. {
    3. if (ui->checkBox->isChecked()){
    4. // custom widget or lineedit visable
    5. }
    6. else{
    7. // custom widget or lineedit invisable
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 

    Thankyou for your time.

  4. #4
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Qt products
    Qt4 Qt5
    Platforms
    Windows
    Thanks
    92
    Thanked 16 Times in 16 Posts

    Default Re: Retractable GUI Area

    Qt Code:
    1. QWidget *customWidget = new QWidget(); // Assuming this as your custom widget or QLineEdit
    2.  
    3. void MainWindow::on_checkBox_clicked()
    4. {
    5. if (ui->checkBox->isChecked())
    6. {
    7. widget->show();
    8. }
    9. else
    10. {
    11. widget->hide();
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Retractable GUI Area

    Quote Originally Posted by QT++ View Post
    Is there a way to make a custom widget or for example a lineEdit become visable or hidden in a few lines of simple code. Something like
    Qt Code:
    1. connect(ui->checkBox, SIGNAL(toggled(bool)), customWidget, SLOT(setVisible(bool)));
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. how to draw area
    By stevocz in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2013, 13:42
  2. mdi area and subwindow
    By sajis997 in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2012, 15:51
  3. Scroll bars in scroll area not comming in scroll area
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 4th January 2012, 07:50
  4. Area that can be stretched
    By pippo42 in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2010, 09:46
  5. About visual area
    By calmspeaker in forum Qt Programming
    Replies: 0
    Last Post: 16th March 2009, 14:14

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.