qgraphicslinearlayout.sip 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // qgraphicslinearlayout.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QGraphicsLinearLayout : public QGraphicsLayout
  22. {
  23. %TypeHeaderCode
  24. #include <qgraphicslinearlayout.h>
  25. %End
  26. public:
  27. QGraphicsLinearLayout(QGraphicsLayoutItem *parent /TransferThis/ = 0);
  28. QGraphicsLinearLayout(Qt::Orientation orientation, QGraphicsLayoutItem *parent /TransferThis/ = 0);
  29. virtual ~QGraphicsLinearLayout();
  30. void setOrientation(Qt::Orientation orientation);
  31. Qt::Orientation orientation() const;
  32. void addItem(QGraphicsLayoutItem *item /Transfer/);
  33. void addStretch(int stretch = 1);
  34. void insertItem(int index, QGraphicsLayoutItem *item /Transfer/);
  35. void insertStretch(int index, int stretch = 1);
  36. void removeItem(QGraphicsLayoutItem *item /TransferBack/);
  37. virtual void removeAt(int index);
  38. %MethodCode
  39. // The ownership of any existing item must be passed back to Python.
  40. QGraphicsLayoutItem *itm;
  41. if (a0 < sipCpp->count())
  42. itm = sipCpp->itemAt(a0);
  43. else
  44. itm = 0;
  45. Py_BEGIN_ALLOW_THREADS
  46. sipSelfWasArg ? sipCpp->QGraphicsLinearLayout::removeAt(a0)
  47. : sipCpp->removeAt(a0);
  48. Py_END_ALLOW_THREADS
  49. // The Qt documentation isn't quite correct as ownership isn't always passed
  50. // back to the caller.
  51. if (itm && !itm->parentLayoutItem())
  52. {
  53. PyObject *itmo = sipGetPyObject(itm, sipType_QGraphicsLayoutItem);
  54. if (itmo)
  55. sipTransferBack(itmo);
  56. }
  57. %End
  58. void setSpacing(qreal spacing);
  59. qreal spacing() const;
  60. void setItemSpacing(int index, qreal spacing);
  61. qreal itemSpacing(int index) const;
  62. void setStretchFactor(QGraphicsLayoutItem *item, int stretch);
  63. int stretchFactor(QGraphicsLayoutItem *item) const;
  64. void setAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment);
  65. Qt::Alignment alignment(QGraphicsLayoutItem *item) const;
  66. virtual void setGeometry(const QRectF &rect);
  67. virtual int count() const;
  68. virtual QGraphicsLayoutItem *itemAt(int index) const;
  69. virtual void invalidate();
  70. virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
  71. };