Skip to content

Commit edbc5c9

Browse files
committed
add to docs
1 parent c39caff commit edbc5c9

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

docs/widgets/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ The following are QWidget subclasses:
3333
| Widget | Description |
3434
| ----------- | --------------------- |
3535
| [`QCollapsible`](./qcollapsible.md) | A collapsible widget to hide and unhide child widgets. |
36+
| [`QFlowLayout`](./qflowlayout.md) | A layout that rearranges items based on parent width. |

docs/widgets/qflowlayout.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# QFlowLayout
2+
3+
QLayout that rearranges items based on parent width.
4+
5+
```python
6+
from qtpy.QtWidgets import QApplication, QPushButton, QWidget
7+
8+
from superqt import QFlowLayout
9+
10+
app = QApplication([])
11+
12+
wdg = QWidget()
13+
14+
layout = QFlowLayout(wdg)
15+
layout.addWidget(QPushButton("Short"))
16+
layout.addWidget(QPushButton("Longer"))
17+
layout.addWidget(QPushButton("Different text"))
18+
layout.addWidget(QPushButton("More text"))
19+
layout.addWidget(QPushButton("Even longer button text"))
20+
21+
wdg.setWindowTitle("Flow Layout")
22+
wdg.show()
23+
24+
app.exec()
25+
```
26+
27+
{{ show_widget(350) }}
28+
29+
{{ show_members('superqt.QFlowLayout') }}

src/superqt/utils/_flow_layout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ class QFlowLayout(QLayout):
1010
The widget placement changes depending on the width of the application window.
1111
1212
Code translated from C++ at:
13-
https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/layouts/flowlayout?h=6.8
13+
<https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/layouts/flowlayout>
1414
15-
described at: https://doc.qt.io/qt-6/qtwidgets-layouts-flowlayout-example.html
15+
described at: <https://doc.qt.io/qt-6/qtwidgets-layouts-flowlayout-example.html>
1616
17-
See also: https://doc.qt.io/qt-6/layout.html
17+
See also: <https://doc.qt.io/qt-6/layout.html>
1818
1919
Parameters
2020
----------

0 commit comments

Comments
 (0)