qmdiarea.sip 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // qmdiarea.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 QMdiArea : public QAbstractScrollArea
  22. {
  23. %TypeHeaderCode
  24. #include <qmdiarea.h>
  25. %End
  26. public:
  27. enum AreaOption /BaseType=Flag/
  28. {
  29. DontMaximizeSubWindowOnActivation,
  30. };
  31. typedef QFlags<QMdiArea::AreaOption> AreaOptions;
  32. enum ViewMode
  33. {
  34. SubWindowView,
  35. TabbedView,
  36. };
  37. enum WindowOrder
  38. {
  39. CreationOrder,
  40. StackingOrder,
  41. ActivationHistoryOrder,
  42. };
  43. QMdiArea(QWidget *parent /TransferThis/ = 0);
  44. virtual ~QMdiArea();
  45. virtual QSize sizeHint() const;
  46. virtual QSize minimumSizeHint() const;
  47. QMdiSubWindow *activeSubWindow() const;
  48. QMdiSubWindow *addSubWindow(QWidget *widget /Transfer/, Qt::WindowFlags flags = Qt::WindowFlags());
  49. QList<QMdiSubWindow *> subWindowList(QMdiArea::WindowOrder order = QMdiArea::CreationOrder) const;
  50. QMdiSubWindow *currentSubWindow() const;
  51. void removeSubWindow(QWidget *widget /GetWrapper/);
  52. %MethodCode
  53. // We need to implement /TransferBack/ on the argument, but it might be the
  54. // QMdiSubWindow that wraps the widget we are really after.
  55. QMdiSubWindow *swin = qobject_cast<QMdiSubWindow *>(a0);
  56. if (swin)
  57. {
  58. QWidget *w = swin->widget();
  59. a0Wrapper = (w ? sipGetPyObject(w, sipType_QWidget) : 0);
  60. }
  61. else
  62. a0Wrapper = 0;
  63. Py_BEGIN_ALLOW_THREADS
  64. sipCpp->removeSubWindow(a0);
  65. Py_END_ALLOW_THREADS
  66. if (a0Wrapper)
  67. sipTransferBack(a0Wrapper);
  68. %End
  69. QBrush background() const;
  70. void setBackground(const QBrush &background);
  71. void setOption(QMdiArea::AreaOption option, bool on = true);
  72. bool testOption(QMdiArea::AreaOption opton) const;
  73. signals:
  74. void subWindowActivated(QMdiSubWindow *);
  75. public slots:
  76. void setActiveSubWindow(QMdiSubWindow *window);
  77. void tileSubWindows();
  78. void cascadeSubWindows();
  79. void closeActiveSubWindow();
  80. void closeAllSubWindows();
  81. void activateNextSubWindow();
  82. void activatePreviousSubWindow();
  83. protected:
  84. virtual void setupViewport(QWidget *viewport);
  85. virtual bool event(QEvent *event);
  86. virtual bool eventFilter(QObject *object, QEvent *event);
  87. virtual void paintEvent(QPaintEvent *paintEvent);
  88. virtual void childEvent(QChildEvent *childEvent);
  89. virtual void resizeEvent(QResizeEvent *resizeEvent);
  90. virtual void timerEvent(QTimerEvent *timerEvent);
  91. virtual void showEvent(QShowEvent *showEvent);
  92. virtual bool viewportEvent(QEvent *event);
  93. virtual void scrollContentsBy(int dx, int dy);
  94. public:
  95. QMdiArea::WindowOrder activationOrder() const;
  96. void setActivationOrder(QMdiArea::WindowOrder order);
  97. void setViewMode(QMdiArea::ViewMode mode);
  98. QMdiArea::ViewMode viewMode() const;
  99. void setTabShape(QTabWidget::TabShape shape);
  100. QTabWidget::TabShape tabShape() const;
  101. void setTabPosition(QTabWidget::TabPosition position);
  102. QTabWidget::TabPosition tabPosition() const;
  103. bool documentMode() const;
  104. void setDocumentMode(bool enabled);
  105. void setTabsClosable(bool closable);
  106. bool tabsClosable() const;
  107. void setTabsMovable(bool movable);
  108. bool tabsMovable() const;
  109. };