Title: Theory / Unimportant / CS / Programming / Python / PyQt
Tags: FromInstruction computer_to_instruction récupéré FromVariables automatedNewLineAfterCommaSpace constant examplesSwitchExample1 hasNotNewEffectReturnsMeaning
On every note of this deck, unless a note says otherwise:
Language: Python

Name: QtCore
Definition: module contains the core non-GUI functionality
Page: http://zetcode.com/gui/pyqt5/introduction/
Example: time, files and directories, various data types, streams, URLs, mime types, threads or processes

Name: QtGui
Definition: Classes for windowing system integration, event handling, 2D graphics, basic imaging, fonts and text.
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtWidgets
Definition: Classes that provide a set of UI elements to create classic desktop-style user interfaces
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtMultimedia
Definition: Classes to handle multimedia content and APIs to access camera and radio functionality.
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtBluetooth
Definition: Classes to scan for bluetooth devices and connect and interact with them.
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtNetwork
Definition: Classes for network programming
Page: http://zetcode.com/gui/pyqt5/introduction/
Context: Qt

Name: QtPositioning
Definition: classes to determine a position by using a variety of possible sources, including satellite, Wi-Fi, or a text file
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: Enginio
Definition: Class for the client-side library for accessing the Qt Cloud Services Managed Application Runtime
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtWebSockets
Definition: classes that implement the WebSocket protocol
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtWebKit
Definition: classes for a web browser implementation based on the WebKit2 library
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtWebKitWidgets
Definition: classes for a WebKit1 based implementation of a web browser for use in QtWidgets based applications.
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtXml
Definition: classes for working with XML files
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtSql
Definition: classes for working with databases
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: QtTest
Definition: functions that enable unit testing of PyQt5 applications
Page: http://zetcode.com/gui/pyqt5/introduction/

Name: omitted
Definition: http://zetcode.com/gui/pyqt5/datetime/
Page: http://zetcode.com/gui/pyqt5/introduction/

Question: Every PyQT5 application must
Answer: create an application object
Page: http://zetcode.com/gui/pyqt5/firstprograms/

Instruction: QApplication(foo)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Start a pyQt application with parameters foo
Assuming: foo is usually sys.argv, the parameters of the python program

Instruction: QWidget()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: None
Returns: A new window

Name: A window
Definition: A widget with no parent
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Context: QT

Instruction: w.move(foo,bar)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Move w to position (foo,bar)
Context: QT
Variables: w a widget

Instruction: w.resize(foo,bar)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Resize w to size (foo,bar)
Context: QT
Variables: w a widget

Instruction: w.show()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: show the widget w as indicated by precedent methods
Context: QT
Variables: w a widget

Instruction: app.exec_()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Start the application
Context: QT
Variables: app a QApplication

Question: When you heritate from a pyqt class, you should
Answer: call its super().__init__() in yours __init__
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Context: QT

Question: How to call the execution of the application
Answer: in Sys.ext()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Context: QT

Instruction: w.setGeometry(a,b,c,d)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Similar to
w.move(a,b)
w.resize(c,d)
Context: QT
Variables: w a widget

Instruction: w.setWindowIcon(foo)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Change the widget's icon to icon foo
Context: QT
Variables: w a widget

Instruction: QFont(foo,bar)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Context: QT
Returns: A font with police foo and size bar

Instruction: QToolTip.setFont(foo)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Set the tool tip font to the font foo
Context: QT

Instruction: w.setToolTip(foo)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Add a tooltip to widget w with text (rich text formatting) foo
Context: QT
Variables: w a widget

Instruction: QPushButton(
foo,
bar
)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: create a button, with text foo and optional parent bar
Context: QT

Instruction: b.sizeHint()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Recommended size for b
Context: QT
Variables: b a button

Instruction: b.clicked
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: The signal corresponding to clicking on b
Context: QT
Variables: b a button

Instruction: s.connect(foo)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: when s occurs, foo is executed
Context: QT
Variables: s a signal

Instruction: QApplication.instance()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: QCoreApplication
Context: QT

Name: QCoreApplication
Definition: Module which contains the main event loop—it processes and dispatches all events
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Context: QT

Instruction: q.quit()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Quit the application
Context: QT
Variables: q the QCoreApplication

Instruction: q.closeEvent(e)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Event handler for a closed window
Context: QT
Variables: w a QtWidget

Constant: QMessageBox.Yes QMessageBox.No
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Language: Python
Context: QT

Instruction: QMessageBox.question(
  dip,foo,
  bar,
  plop,
  miam
)
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Show a message box with parent dip. Title foo, question bar, button as indicated by flags plop and default miam
Context: QT
Returns: What is answered to this box

Instruction: e.accept()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: Accept event e
Context: QT
Variables: e an event

Instruction: e.ignore()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: ignore event e
Context: QT
Variables: e an event

Instruction: w.center()
Page: http://zetcode.com/gui/pyqt5/firstprograms/
Effect: center widget w
Context: QT
Variables: w a widget

Name: menu
Definition: group of commands located in a menubar
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Context: QT

Name: A toolbar
Definition: A widget with buttons with some common commands in the application
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Context: QT

Name: A statusbar
Definition: A widget which shows status information, usually at the bottom of the application window.
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Context: QT

Instruction: QAction(foo,bar,parent)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Context: QT
Returns: An abstraction for actions performed with menu/tool bar or shortcut. It has icon foo and text bar

Instruction: act.setShortcut(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: In act's widget, foo is a shortcut for action act
Context: QT
Variables: act an action

Instruction: act.setStatusTip(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: when the mouse pointer hover over the menu item, foo will be written in the status bar
Context: QT
Variables: act an action

Instruction: act.triggered
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: The signal abstraction associated with this action
Context: QT
Variables: act an action

Name: A submenu
Definition: A menu located inside another menu
Page: http://zetcode.com/gui/pyqt5/menustoolbars/

Instruction: mw.menuBar()
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Returns: This window's menu bar. Creating it if does not exists
Variables: mw a main window

Instruction: mb.addMenu(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: Add a menu with name foo to menu bar
Variables: mw a main window
mb its menu bar

Instruction: l.addAction(act)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: Add action act to the menu
Variables: mw a main window
mb its menu bar
l a menu/toolbar

Instruction: l.addMenu(bar)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: Add submenu bar to menu l
Variables: mw a main window
mb its menu bar
l a menu

Instruction: QMenu(foo,parent)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Returns: A menu abstraction with name foo

Variable: checkable
Meaning: whether to add a check symbol to this action line in the menu
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Language: Python
Typ: optional argument

Name: Context menu
Definition: a list of commands that appears under some context
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Example: Right click on a web page
Name2: a popup menu

Instruction: act.setChecked(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: foo state whether act is now checked or not
Variables: act an action

Instruction: e.pos()
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Returns: The position at which event e occured
Variables: e an event

Instruction: m.exec_(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: Show menu m at position f
Returns: Action returned from the pop-up menu
Variables: m a menu

Instruction: m.mapToGlobal(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Returns: translate coordinate given in the widget's referential to the screen referential
Variables: m a widget

Instruction: m.addAction("foo")
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: Create an action, with text foo, and add it to the menu
Returns: the action created
Variables: m a menu, toolbar

Instruction: w.addToolBar("foo")
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Returns: w's toolbar. Creating it if does not exists.
Variables: w a widget

Instruction: QTextEdit()
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Returns: An abstraction of a zone of text which can be edited

Instruction: w.setCentralWidget(foo)
Page: http://zetcode.com/gui/pyqt5/menustoolbars/
Effect: Put widget foo in the center of widget w
Variables: w a widget