mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +08:00
FIX: Update Python bindings for 3.4.2 and current master. (#193)
* FIX: Update python bindings for 3.4.2.
* FIX: Try to fix windows build.
* FIX: Add const at nativeEvent argument.
* FIX: Adjusting sip bindings for changes from 8b6df4aaa5
.
This commit is contained in:
parent
bcb7118710
commit
4d2de7bb2a
25
setup.py
25
setup.py
@ -214,6 +214,7 @@ class build_ext(sipdistutils.build_ext):
|
|||||||
# /usr/bin/rcc -name ads ../../Qt-Advanced-Docking-System/src/ads.qrc -o release/qrc_ads.cpp
|
# /usr/bin/rcc -name ads ../../Qt-Advanced-Docking-System/src/ads.qrc -o release/qrc_ads.cpp
|
||||||
|
|
||||||
cppsources = [source for source in ext.sources if source.endswith(".cpp")]
|
cppsources = [source for source in ext.sources if source.endswith(".cpp")]
|
||||||
|
headersources = ['src/DockAreaTitleBar_p.h']
|
||||||
|
|
||||||
dir_util.mkpath(self.build_temp, dry_run=self.dry_run)
|
dir_util.mkpath(self.build_temp, dry_run=self.dry_run)
|
||||||
|
|
||||||
@ -247,6 +248,30 @@ class build_ext(sipdistutils.build_ext):
|
|||||||
if os.path.getsize(out_file) > 0:
|
if os.path.getsize(out_file) > 0:
|
||||||
ext.sources.append(out_file)
|
ext.sources.append(out_file)
|
||||||
|
|
||||||
|
# Run moc on all orphan header files.
|
||||||
|
for source in headersources:
|
||||||
|
# *.cpp -> *.moc
|
||||||
|
moc_file = os.path.basename(source).replace(".h", ".moc")
|
||||||
|
out_file = os.path.join(self.build_temp, moc_file)
|
||||||
|
|
||||||
|
if newer(source, out_file) or self.force:
|
||||||
|
spawn.spawn(get_moc_args(out_file, source),
|
||||||
|
dry_run=self.dry_run)
|
||||||
|
|
||||||
|
header = source
|
||||||
|
if os.path.exists(header):
|
||||||
|
# *.h -> moc_*.cpp
|
||||||
|
moc_file = "moc_" + os.path.basename(header).replace(
|
||||||
|
".h", ".cpp")
|
||||||
|
out_file = os.path.join(self.build_temp, moc_file)
|
||||||
|
|
||||||
|
if newer(header, out_file) or self.force:
|
||||||
|
spawn.spawn(get_moc_args(out_file, header),
|
||||||
|
dry_run=self.dry_run)
|
||||||
|
|
||||||
|
if os.path.getsize(out_file) > 0:
|
||||||
|
ext.sources.append(out_file)
|
||||||
|
|
||||||
# Add the temp build directory to include path, for compiler to find
|
# Add the temp build directory to include path, for compiler to find
|
||||||
# the created .moc files
|
# the created .moc files
|
||||||
ext.include_dirs += [self._sip_output_dir()]
|
ext.include_dirs += [self._sip_output_dir()]
|
||||||
|
37
sip/DockAreaTitleBar_p.sip
Normal file
37
sip/DockAreaTitleBar_p.sip
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
%Import QtWidgets/QtWidgetsmod.sip
|
||||||
|
|
||||||
|
%If (Qt_5_0_0 -)
|
||||||
|
|
||||||
|
namespace ads
|
||||||
|
{
|
||||||
|
|
||||||
|
class CTitleBarButton : QToolButton
|
||||||
|
{
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include <DockAreaTitleBar_p.h>
|
||||||
|
%End
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool event(QEvent *ev);
|
||||||
|
|
||||||
|
public:
|
||||||
|
CTitleBarButton(bool visible = true, QWidget* parent /TransferThis/ = Q_NULLPTR );
|
||||||
|
virtual void setVisible(bool visible);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CSpacerWidget : QWidget
|
||||||
|
{
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include <DockAreaTitleBar_p.h>
|
||||||
|
%End
|
||||||
|
|
||||||
|
public:
|
||||||
|
CSpacerWidget(QWidget* Parent /TransferThis/ = 0 );
|
||||||
|
virtual QSize sizeHint() const;
|
||||||
|
virtual QSize minimumSizeHint() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
%End
|
@ -32,6 +32,7 @@ public:
|
|||||||
virtual ~CDockAreaWidget();
|
virtual ~CDockAreaWidget();
|
||||||
ads::CDockManager* dockManager() const;
|
ads::CDockManager* dockManager() const;
|
||||||
ads::CDockContainerWidget* dockContainer() const;
|
ads::CDockContainerWidget* dockContainer() const;
|
||||||
|
virtual QSize minimumSizeHint() const;
|
||||||
QRect titleBarGeometry() const;
|
QRect titleBarGeometry() const;
|
||||||
QRect contentAreaGeometry() const;
|
QRect contentAreaGeometry() const;
|
||||||
int dockWidgetsCount() const;
|
int dockWidgetsCount() const;
|
||||||
|
@ -194,8 +194,8 @@ public:
|
|||||||
const QList<ads::CDockContainerWidget*> dockContainers() const;
|
const QList<ads::CDockContainerWidget*> dockContainers() const;
|
||||||
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
|
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
|
||||||
unsigned int zOrderIndex() const;
|
unsigned int zOrderIndex() const;
|
||||||
QByteArray saveState(int version = 1) const;
|
QByteArray saveState(int version = 0) const;
|
||||||
bool restoreState(const QByteArray &state, int version = 1);
|
bool restoreState(const QByteArray &state, int version = 0);
|
||||||
void addPerspective(const QString& UniquePrespectiveName);
|
void addPerspective(const QString& UniquePrespectiveName);
|
||||||
void removePerspective(const QString& Name);
|
void removePerspective(const QString& Name);
|
||||||
void removePerspectives(const QStringList& Names);
|
void removePerspectives(const QStringList& Names);
|
||||||
|
@ -27,6 +27,7 @@ public:
|
|||||||
|
|
||||||
virtual void moveFloating() = 0;
|
virtual void moveFloating() = 0;
|
||||||
virtual void finishDragging() = 0;
|
virtual void finishDragging() = 0;
|
||||||
|
virtual ~IFloatingWidget();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -56,6 +57,10 @@ protected:
|
|||||||
virtual void closeEvent(QCloseEvent *event);
|
virtual void closeEvent(QCloseEvent *event);
|
||||||
virtual void hideEvent(QHideEvent *event);
|
virtual void hideEvent(QHideEvent *event);
|
||||||
virtual void showEvent(QShowEvent *event);
|
virtual void showEvent(QShowEvent *event);
|
||||||
|
%If (WS_WIN)
|
||||||
|
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
|
||||||
|
%End
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);
|
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);
|
||||||
|
@ -13,7 +13,6 @@ class CFloatingDragPreview : QWidget, ads::IFloatingWidget
|
|||||||
%End
|
%End
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void moveEvent(QMoveEvent *event);
|
|
||||||
virtual void paintEvent(QPaintEvent *e);
|
virtual void paintEvent(QPaintEvent *e);
|
||||||
CFloatingDragPreview(QWidget* Content /TransferThis/, QWidget* parent /TransferThis/);
|
CFloatingDragPreview(QWidget* Content /TransferThis/, QWidget* parent /TransferThis/);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
%Include ads_globals.sip
|
%Include ads_globals.sip
|
||||||
%Include DockWidget.sip
|
%Include DockWidget.sip
|
||||||
%Include DockAreaTabBar.sip
|
%Include DockAreaTabBar.sip
|
||||||
|
%Include DockAreaTitleBar_p.sip
|
||||||
%Include DockAreaTitleBar.sip
|
%Include DockAreaTitleBar.sip
|
||||||
%Include DockAreaWidget.sip
|
%Include DockAreaWidget.sip
|
||||||
%Include DockComponentsFactory.sip
|
%Include DockComponentsFactory.sip
|
||||||
|
@ -8,13 +8,6 @@ namespace ads
|
|||||||
#include <ads_globals.h>
|
#include <ads_globals.h>
|
||||||
%End
|
%End
|
||||||
|
|
||||||
enum eStateFileVersion
|
|
||||||
{
|
|
||||||
InitialVersion,
|
|
||||||
Version1,
|
|
||||||
CurrentVersion
|
|
||||||
};
|
|
||||||
|
|
||||||
enum DockWidgetArea
|
enum DockWidgetArea
|
||||||
{
|
{
|
||||||
NoDockWidgetArea,
|
NoDockWidgetArea,
|
||||||
|
Loading…
Reference in New Issue
Block a user