Results 1 to 3 of 3

Thread: Making QWidgets(QSpinBox, QComboBox etc.) Dynamically Visible/Hidden

  1. #1
    Join Date
    Jul 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Making QWidgets(QSpinBox, QComboBox etc.) Dynamically Visible/Hidden

    Hi all. I have a QToolBar, and several QWidgets (QSpinBox, QComboBox etc.) created as a child widget on it. When my main application is open and I can see all those toolbar and childs, I want to be able to make some of them both disabled and hidden, then again make the same ones enabled and visible throughout the program's life. setEnabled() works but setHidden(true) or setVisible(false) methods do not work. I can see a widget gets disabled, but although I set its isVisible to false, it is even seen on the QToolBar. Is there anybody knows the way to handle this?

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

    Default Re: Making QWidgets(QSpinBox, QComboBox etc.) Dynamically Visible/Hidden

    If you place widgets on a toolbar then you should be manipulating them through QWidgetAction and not directly.
    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
    Jul 2010
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Making QWidgets(QSpinBox, QComboBox etc.) Dynamically Visible/Hidden

    Thak you very much. It works.

Similar Threads

  1. Replies: 4
    Last Post: 27th April 2012, 10:12
  2. making qmainwindow dynamically resizable to fit to screen
    By Amit_3117 in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 12:59
  3. qwidget how to set visible/hidden ?
    By ricky in forum Newbie
    Replies: 4
    Last Post: 12th August 2009, 08:07
  4. get all QListWidgetItem*(visible and hidden )
    By Levon Nikoghosyan in forum Qt Programming
    Replies: 2
    Last Post: 24th October 2006, 22:02
  5. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00

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.