(C++) Qt examples
August 7, 2019 · View on GitHub
(C++)
Qt examples
These Qt examples show how to use Qt, with or without the Qt Creator GUI designer. Note that these (that is: with or without using the Qt Creator GUI designer) can be converted without much trouble.
- Example 1: moving a sprite over a background in 2D
- Example 2: moving many sprites over a background in 2D
- Example 3: a changing background in 2D
- Example 4: moving many sprites over a changing background in 2D
- Example 5: moving many changing sprites over a changing background in 2D
- Example 6: moving customly-drawn and partially transparent sprites over a changing background in 2D
- Example 7: let customly-drawn and partially transparent sprites move and collide over a changing background in 2D
- Example 8: simple 2D SIR simulation
- Example 9: custom sprites over custom background
- Example 10: change label when dialog is resized
- Example 11: creating a QDialog with QLayout on the
fly
- screenshot (png)
- uses QDialog, QPushButton, QVBoxLayout, setWindowTitle, setGeometry
- Example 12: creating a custom QDialog with
slot
- screenshot (png)
- uses QDialog, slots
- Example 13: creating a more complete custom QDialog with
slot
- screenshot (png)
- uses QDialog, slots
- Example 14: creating a more complete custom QDialog with slot with
shorter compilation time
- screenshot (png)
- uses QDialog, slots
- Example 15: pop-up windows from pop-up windows
- screenshot (png)
- uses QDialog, slots, setModal
- Example 16: using resources
- screenshot (png)
- uses QDialog, QPixmap, resources
- Example 17: clickable QLabels showing an image
- screenshot (png)
- uses QDialog, QLabel, QPixmap, shows creating a custom signal
- Example 18: stretchDraw and rotate an image
- Example 19: GUI around image rotation
- Example 20: a sketch widget
- screenshot (png)
- uses QDialog, QPainter
- Example 21: a transparent-like dialog
- screenshot (png)
- uses QDialog, QPainter, QPixmap
- Example 22: a transparent dialog
- screenshot (png)
- uses QDialog, setMask
- Example 23: grab a widget as an image
- screenshot (png)
- uses QDialog, QPixmap
- Example 24: create a simple text positioning widget
- Example 25: a transparent sketch widget
- screenshot (png)
- uses QDialog, setMask
- Example 26: create a text positioning widget
- Example 27: create a simple gravity widget
- Example 28: bouncing rectangles widget
- Example 29: bouncing balls widget
- Example 30: controlling program flow with a Singleton
- Example 31: moveable thin lines
- Example 32: moveable and selectable thin lines
- Example 33: moveable and selectable arrows
- Example 34: moveable, selectable and editable arrows
- Example 35: arrows with an angle
- Example 36: arrows with multiple midpoints
- Example 37: rounded rectangle item
- Moving line example
- Qwt example 2: QwtPlot as QGraphicsItem
- QGraphicsItemGroup example 1: basic
- QGraphicsObject example 1: basic
- QGraphicsObject example 2: flashing
- QGraphicsObject example 3: flashing only
- QGraphicsPathItem example 1: basic
- QGraphicsPathItem example 2: Bezier quadratic arrows
- QGraphicsPathItem example 3: Bezier quadratic lines again
- QGraphicsPathItem example 4: Bezier quadratic lines with arrow heads
- QGraphicsPathItem example 5: Bezier quadratic lines with arrow heads again
- QGraphicsPixmapItem example 1: basic
- QGraphicsPixmapItem example 2: clickable pixmap
- QGraphicsPixmapItem example 3: clickable and selectable pixmap
- QGraphicsPixmapItem example 4: pixmap that changes cursor
- QGraphicsPixmapItem example 5: respond to cursor moving over pixmap
- QGraphicsPixmapItem example 6: let the view respond to cursor moving over pixmap
- QGraphicsPixmapItem example 7: respond to cursor moving over pixmap while holding the cursor still
- QGraphicsProxyWidget example 1
- QGraphicsProxyWidget example 2
- QGraphicsProxyWidget example 3
- QGraphicsProxyWidget example 4
- QGraphicsProxyWidget example 5
- QGraphicsProxyWidget example 6
- QGraphicsRectItem example 1: basic
- QGraphicsRectItem example 2: coordinat display
- QGraphicsRectItem example 3: coordinat display on a linear gradient
- QGraphicsSimpleTextItem example 1: Hello World
- QGraphicsSimpleTextItem example 2: coordinat display
- QGraphicsSimpleTextItem example 3: use tab to change focus
- QGraphicsSimpleTextItem example 4: use arrows to change focus
- QGraphicsSimpleTextItem example 5: keyboard-friendly view
- QGraphicsSimpleTextItem example 6: remote texting