3 ms·
Getting started with Qt is pretty easy I'd say, at least when you use Python and not C++: import sys from PyQt4 import QtGui def window(): app
by wotstowaway 10y ago
Getting started with Qt is pretty easy I'd say, at least when you use Python and not C++:
import sys
from PyQt4 import QtGui
def window():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
b = QtGui.QLabel(w)
b.setText("Hello World!")
w.setGeometry(100,100,200,50)
b.move(50,20)
w.setWindowTitle(“PyQt”)
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
window()
In general I think Qt is one of the best-documented UI toolkits out there, and while it surely is complex it offers a lot of modern features and is able to produce pretty great UIs.
- witty_username 10y agoBTW, a nice PyQt feature is that you can set properties in the class initializer: b = QtGui.QLabel(w) b.setText("Hello World!") can be replaced with b = QtGui.QLabel(w, text = "Hello World!")