Results 1 to 3 of 3

Thread: Set visible for QProgressBar

  1. #1
    Join Date
    Apr 2017
    Posts
    30
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    9

    Default Set visible for QProgressBar

    Hello.
    On the main window there is a progress bar that I want to change from another class A that works in a different thread.
    I can change the value using the signals and slots that are configured inside class A (there is a public slot setValue(int)), but how do I change the visibility of the bar progress from another thread?
    Qt Code:
    1. connect(this, SIGNAL(progressBarValue(int)), ui_progressBar, SLOT(setValue(int))); //work
    2. connect(this, SIGNAL(setWidgetColor(QString)), ui_infoWidget, SLOT(setStyleSheet(QString))); //work
    3. connect(this, SIGNAL(progressBarVisible(bool)), ui_progressBar, SLOT(setVisible(bool))); //don't work
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    520
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 77 Times in 75 Posts

    Default Re: Set visible for QProgressBar

    Hi, this should work. Are you sure that progressBarVisible() is emitted?

    Ginsengelf

  3. #3
    Join Date
    Apr 2017
    Posts
    30
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    9

    Default Re: Set visible for QProgressBar

    Quote Originally Posted by Ginsengelf View Post
    Hi, this should work. Are you sure that progressBarVisible() is emitted?

    Ginsengelf
    I'm stupid, I'm sorry ... The code works. Thanks!

Similar Threads

  1. Replies: 3
    Last Post: 2nd January 2018, 14:04
  2. How to use a QProgressbar
    By Niamita in forum Qt Programming
    Replies: 5
    Last Post: 16th March 2012, 13:05
  3. Using QProgressBar
    By gutiory in forum Qt Programming
    Replies: 6
    Last Post: 5th May 2010, 07:59
  4. QProgressBar + Mac OS X
    By THRESHE in forum Qt Programming
    Replies: 5
    Last Post: 14th December 2007, 14:41
  5. QProgressBar & 200%
    By Dmitry in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 12:33

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.