What s the difference in Qt between setVisible setShown and show hide

0 votes
Please excuse this potentially noobish question but when trying to hide a QWidget what is the difference between calling setVisible(False), setShown(False) and hide()?
Apr 17, 2018 in Python by aryya
• 7,460 points
8,005 views

1 answer to this question.

0 votes
show() is just a convenience function for setVisible(true).

Similarly hide() is equivalent to setVisible(false)

Internally, the same code is used to render your view.

See http://doc.qt.io/archives/qt-4.7/qwidget.html#show as an example. According to it,

void QWidget::show () [slot] Shows the widget and its child widgets. This function is equivalent to setVisible(true).

You'll find lots of such functions in Qt to just make things more intuitive, especially when it comes to widgets and views.
answered Apr 17, 2018 by anonymous

Related Questions In Python

+1 vote
1 answer

What's the difference between eval, exec, and compile in Python?

exec is not an expression: a statement ...READ MORE

answered Aug 28, 2018 in Python by Priyaj
• 58,020 points
5,062 views
0 votes
2 answers

What's the difference between %s and %d in Python string formatting?

The reason is that they are using ...READ MORE

answered Feb 8, 2022 in Python by Rahul
• 9,680 points
22,780 views
+1 vote
2 answers

What is the difference between classes and labels in machine learning?

Classes and Labels both are almost same things ...READ MORE

answered Apr 3, 2019 in Python by SA
• 1,090 points
7,670 views
+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 58,020 points
2,394 views
0 votes
5 answers
+2 votes
2 answers

What is the difference between print and return in python?

Return statements end the execution of a ...READ MORE

answered Aug 26, 2019 in Python by anonymous
8,034 views
0 votes
0 answers

What is the difference between isdigit, isnumeric and isdecimal in python?

Can you give examples for each of ...READ MORE

May 31, 2019 in Python by Waseem
• 4,540 points
2,256 views
0 votes
1 answer

How to hide a window in the constructor immediately after creation?

You can use QtCore.QTimer class Example(QWidget):     def __init__(self, app):         QWidget.__init__(self)         QTimer.singleShot(0, ...READ MORE

answered Apr 17, 2018 in Python by anonymous
902 views
0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
3,458 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP