summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qformlayout.cpp
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-09-03 14:02:13 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-10-15 10:55:18 +0000
commit1f6bfc220774e9407fe88916843b76ed103cff72 (patch)
tree8d6157d5b974e6045d75a716f8eb0db4daefa35f /src/widgets/kernel/qformlayout.cpp
parent02a214442781bf112c1cc85d2470c6fcec8ed207 (diff)
Doc: Move literal code block to a separate file
We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/widgets/kernel/qformlayout.cpp')
-rw-r--r--src/widgets/kernel/qformlayout.cpp48
1 files changed, 6 insertions, 42 deletions
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 595ff3eb6e..66e8858e21 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1435,13 +1435,7 @@ static void clearAndDestroyQLayoutItem(QLayoutItem *item)
up one row and the freed vertical space is redistributed amongst the remaining rows.
You can use this function to undo a previous addRow() or insertRow():
- \code
- QFormLayout *flay = ...;
- QPointer<QLineEdit> le = new QLineEdit;
- flay->insertRow(2, "User:", le);
- // later:
- flay->removeRow(2); // le == nullptr at this point
- \endcode
+ \snippet code/src_gui_kernel_qformlayout.cpp 3
If you want to remove the row from the layout without deleting the widgets, use takeRow() instead.
@@ -1467,13 +1461,7 @@ void QFormLayout::removeRow(int row)
up one row and the freed vertical space is redistributed amongst the remaining rows.
You can use this function to undo a previous addRow() or insertRow():
- \code
- QFormLayout *flay = ...;
- QPointer<QLineEdit> le = new QLineEdit;
- flay->insertRow(2, "User:", le);
- // later:
- flay->removeRow(le); // le == nullptr at this point
- \endcode
+ \snippet code/src_gui_kernel_qformlayout.cpp 4
If you want to remove the row from the layout without deleting the widgets, use takeRow() instead.
@@ -1499,13 +1487,7 @@ void QFormLayout::removeRow(QWidget *widget)
up one row and the freed vertical space is redistributed amongst the remaining rows.
You can use this function to undo a previous addRow() or insertRow():
- \code
- QFormLayout *flay = ...;
- QPointer<QVBoxLayout> vbl = new QVBoxLayout;
- flay->insertRow(2, "User:", vbl);
- // later:
- flay->removeRow(layout); // vbl == nullptr at this point
- \endcode
+ \snippet code/src_gui_kernel_qformlayout.cpp 5
If you want to remove the row from the form layout without deleting the inserted layout,
use takeRow() instead.
@@ -1532,13 +1514,7 @@ void QFormLayout::removeRow(QLayout *layout)
up one row and the freed vertical space is redistributed amongst the remaining rows.
You can use this function to undo a previous addRow() or insertRow():
- \code
- QFormLayout *flay = ...;
- QPointer<QLineEdit> le = new QLineEdit;
- flay->insertRow(2, "User:", le);
- // later:
- QFormLayout::TakeRowResult result = flay->takeRow(2);
- \endcode
+ \snippet code/src_gui_kernel_qformlayout.cpp 6
If you want to remove the row from the layout and delete the widgets, use removeRow() instead.
@@ -1583,13 +1559,7 @@ QFormLayout::TakeRowResult QFormLayout::takeRow(int row)
After this call, rowCount() is decremented by one. All following rows are shifted
up one row and the freed vertical space is redistributed amongst the remaining rows.
- \code
- QFormLayout *flay = ...;
- QPointer<QLineEdit> le = new QLineEdit;
- flay->insertRow(2, "User:", le);
- // later:
- QFormLayout::TakeRowResult result = flay->takeRow(widget);
- \endcode
+ \snippet code/src_gui_kernel_qformlayout.cpp 7
If you want to remove the row from the layout and delete the widgets, use removeRow() instead.
@@ -1628,13 +1598,7 @@ QFormLayout::TakeRowResult QFormLayout::takeRow(QWidget *widget)
After this call, rowCount() is decremented by one. All following rows are shifted
up one row and the freed vertical space is redistributed amongst the remaining rows.
- \code
- QFormLayout *flay = ...;
- QPointer<QVBoxLayout> vbl = new QVBoxLayout;
- flay->insertRow(2, "User:", vbl);
- // later:
- QFormLayout::TakeRowResult result = flay->takeRow(widget);
- \endcode
+ \snippet code/src_gui_kernel_qformlayout.cpp 8
If you want to remove the row from the form layout and delete the inserted layout,
use removeRow() instead.