Graphics View Flow Layout Example

Demonstrates flow layout on a graphics view scene.

The Graphics View Flow Layout example shows the use of a flow layout in a Graphics View widget.

../_images/graphicsflowlayout-example.png

This example uses a Graphics View to display the widget, which is a more customizable approach than displaying the flow layout in the application window (See Flow Layout Example ).

Graphics View Flow Layout snippet:

from window import *
from PySide6.QtWidgets import QApplication
from PySide6.QtWidgets import QGraphicsView
if __name__ == "__main__":

    app = QApplication([])
    scene = QGraphicsScene()
    view = QGraphicsView(scene)
    w = Window()
    scene.addItem(w)
    view.resize(400, 300)
    view.show()
    sys.exit(app.exec())

Flow Layout Example snippet:

from PySide6.QtWidgets import QApplication
from window import *
if __name__ == "__main__":

    app = QApplication([])
    window = Window()
    window.show()
    sys.exit(app.exec())

Example project @ code.qt.io