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

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()?


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.

There is no difference. They are just different ways of achieving the same thing. (Actually setShown isn't really part of the API, it looks like it's a compatibility thing from Qt 3, so best not to use it.)

Need Your Help

How to load training data in PyBrain?

python neural-network pybrain

I am trying to use PyBrain for some simple NN training. What I don't know how to do is to load the training data from a file. It is not explained in their website anywhere. I don't care about the f...

Custom fonts and XML layouts (Android)

java android user-interface interface fonts

I'm trying to define a GUI layout using XML files in Android. As far as I can find out, there is no way to specify that your widgets should use a custom font (e.g. one you've placed in assets/font/...