2021-09-07 02:48:17 +08:00
|
|
|
%Import QtWidgets/QtWidgetsmod.sip
|
|
|
|
|
|
|
|
%If (Qt_5_0_0 -)
|
|
|
|
|
|
|
|
%ModuleHeaderCode
|
|
|
|
PyObject *qtads_FindParent(PyObject* type, const QWidget *child);
|
|
|
|
%End
|
|
|
|
|
|
|
|
%ModuleCode
|
|
|
|
PyObject *qtads_FindParent(PyObject* type, const QWidget *w)
|
|
|
|
{
|
|
|
|
// Check that the types checking was successful.
|
|
|
|
if (!type)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
QWidget* parentWidget = w->parentWidget();
|
|
|
|
|
|
|
|
while (parentWidget)
|
|
|
|
{
|
|
|
|
PyObject *ParentImpl = sipConvertFromType(parentWidget, sipType_QObject, 0);
|
|
|
|
if (!ParentImpl)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (PyObject_IsInstance(ParentImpl, type))
|
|
|
|
return ParentImpl;
|
|
|
|
|
|
|
|
Py_DECREF(ParentImpl);
|
|
|
|
|
|
|
|
parentWidget = parentWidget->parentWidget();
|
|
|
|
}
|
|
|
|
|
|
|
|
Py_INCREF(Py_None);
|
|
|
|
return Py_None;
|
|
|
|
}
|
|
|
|
%End
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <ads_globals.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
enum DockWidgetArea
|
|
|
|
{
|
|
|
|
NoDockWidgetArea,
|
|
|
|
LeftDockWidgetArea,
|
|
|
|
RightDockWidgetArea,
|
|
|
|
TopDockWidgetArea,
|
|
|
|
BottomDockWidgetArea,
|
|
|
|
CenterDockWidgetArea,
|
2023-08-03 02:23:49 +08:00
|
|
|
LeftAutoHideArea,
|
|
|
|
RightAutoHideArea,
|
|
|
|
TopAutoHideArea,
|
|
|
|
BottomAutoHideArea,
|
2021-09-07 02:48:17 +08:00
|
|
|
InvalidDockWidgetArea,
|
|
|
|
OuterDockAreas,
|
2023-08-03 02:23:49 +08:00
|
|
|
AutoHideDockAreas,
|
2021-09-07 02:48:17 +08:00
|
|
|
AllDockAreas
|
|
|
|
};
|
|
|
|
typedef QFlags<ads::DockWidgetArea> DockWidgetAreas;
|
|
|
|
|
|
|
|
|
2023-08-03 02:23:49 +08:00
|
|
|
enum eTabIndex
|
|
|
|
{
|
|
|
|
TabDefaultInsertIndex,
|
|
|
|
TabInvalidIndex
|
|
|
|
};
|
|
|
|
|
2021-09-07 02:48:17 +08:00
|
|
|
enum TitleBarButton
|
|
|
|
{
|
|
|
|
TitleBarButtonTabsMenu,
|
|
|
|
TitleBarButtonUndock,
|
2023-03-21 13:04:19 +08:00
|
|
|
TitleBarButtonClose,
|
|
|
|
TitleBarButtonAutoHide
|
2021-09-07 02:48:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum eDragState
|
|
|
|
{
|
|
|
|
DraggingInactive,
|
|
|
|
DraggingMousePressed,
|
|
|
|
DraggingTab,
|
|
|
|
DraggingFloatingWidget
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eIcon
|
|
|
|
{
|
|
|
|
TabCloseIcon,
|
2023-03-21 13:04:19 +08:00
|
|
|
AutoHideIcon,
|
2021-09-07 02:48:17 +08:00
|
|
|
DockAreaMenuIcon,
|
|
|
|
DockAreaUndockIcon,
|
|
|
|
DockAreaCloseIcon,
|
|
|
|
IconCount,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eBitwiseOperator
|
|
|
|
{
|
|
|
|
BitwiseAnd,
|
|
|
|
BitwiseOr
|
|
|
|
};
|
|
|
|
|
2023-03-21 13:04:19 +08:00
|
|
|
enum SideBarLocation
|
|
|
|
{
|
|
|
|
SideBarTop,
|
|
|
|
SideBarLeft,
|
|
|
|
SideBarRight,
|
|
|
|
SideBarBottom,
|
|
|
|
SideBarNone
|
|
|
|
};
|
|
|
|
|
2021-09-07 02:48:17 +08:00
|
|
|
namespace internal
|
|
|
|
{
|
|
|
|
void replaceSplitterWidget(QSplitter* Splitter, QWidget* From, QWidget* To);
|
|
|
|
void hideEmptyParentSplitters(ads::CDockSplitter* FirstParentSplitter);
|
|
|
|
|
|
|
|
class CDockInsertParam
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <ads_globals.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
Qt::Orientation orientation() const;
|
|
|
|
bool append() const;
|
|
|
|
int insertOffset() const;
|
|
|
|
};
|
|
|
|
ads::internal::CDockInsertParam dockAreaInsertParameters(ads::DockWidgetArea Area);
|
2023-08-03 02:23:49 +08:00
|
|
|
ads::SideBarLocation toSideBarLocation(ads::DockWidgetArea Area);
|
|
|
|
bool isHorizontalSideBarLocation(ads::SideBarLocation Location);
|
|
|
|
bool isSideBarArea(ads::DockWidgetArea Area);
|
2021-09-07 02:48:17 +08:00
|
|
|
|
|
|
|
SIP_PYOBJECT findParent(SIP_PYTYPE type, const QWidget *w) const /TypeHint="QObject"/;
|
|
|
|
%MethodCode
|
|
|
|
sipRes = qtads_FindParent(a0, a1);
|
|
|
|
|
|
|
|
if (!sipRes)
|
|
|
|
{
|
|
|
|
sipIsErr = 1;
|
|
|
|
}
|
|
|
|
%End
|
|
|
|
|
|
|
|
QPixmap createTransparentPixmap(const QPixmap& Source, qreal Opacity);
|
|
|
|
|
|
|
|
QPoint globalPositionOf(QMouseEvent* ev);
|
|
|
|
|
|
|
|
void setButtonIcon(QAbstractButton* Button, QStyle::StandardPixmap StandarPixmap, ads::eIcon CustomIconId);
|
|
|
|
|
|
|
|
enum eRepolishChildOptions
|
|
|
|
{
|
|
|
|
RepolishIgnoreChildren,
|
|
|
|
RepolishDirectChildren,
|
|
|
|
RepolishChildrenRecursively
|
|
|
|
};
|
|
|
|
|
|
|
|
void repolishStyle(QWidget* w, ads::internal::eRepolishChildOptions Options = ads::internal::RepolishIgnoreChildren);
|
2023-03-21 13:04:19 +08:00
|
|
|
QRect globalGeometry(QWidget* w);
|
2021-09-07 02:48:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
%End
|