Overview

In all applications:

  • All PyQT applications have 1 instance of QApplication.

    from PyQt5.QtWidgets import QApplication
    app = QApplication([]) # [] are the command line arguments
  • Hand control to Qt and actually run the app after it has been created until the user closes the application

app.exec_()

Layout/Widgets

  • Need a window to place widgets like buttons

from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout
app = QApplication([])

window = QWidget() # Acts as a container (no fancy behaviour)
layout = QVBoxLayout()
layout.addWidget(QPushButton("Button"))
window.setLayout(layout)
window.show()

app.exec_()

Style

  • Examples: Fusion, Windows, Macintosh, WindowsVista (dependent on platform)

Signals/Slots

  • Reaction to events (like when user clicks a button)

Compiling App

  • How do you give this app to others (without the source code)?

    • Create binary exectuable

Note: Only for people with the same OS as you.

Last updated

Was this helpful?