Skip to content

Commit f074ea9

Browse files
2 parents 2e8137a + 4d2de7b commit f074ea9

File tree

8 files changed

+72
-11
lines changed

8 files changed

+72
-11
lines changed

setup.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def build_extension(self, ext):
214214
# /usr/bin/rcc -name ads ../../Qt-Advanced-Docking-System/src/ads.qrc -o release/qrc_ads.cpp
215215

216216
cppsources = [source for source in ext.sources if source.endswith(".cpp")]
217+
headersources = ['src/DockAreaTitleBar_p.h']
217218

218219
dir_util.mkpath(self.build_temp, dry_run=self.dry_run)
219220

@@ -247,6 +248,30 @@ def get_moc_args(out_file, source):
247248
if os.path.getsize(out_file) > 0:
248249
ext.sources.append(out_file)
249250

251+
# Run moc on all orphan header files.
252+
for source in headersources:
253+
# *.cpp -> *.moc
254+
moc_file = os.path.basename(source).replace(".h", ".moc")
255+
out_file = os.path.join(self.build_temp, moc_file)
256+
257+
if newer(source, out_file) or self.force:
258+
spawn.spawn(get_moc_args(out_file, source),
259+
dry_run=self.dry_run)
260+
261+
header = source
262+
if os.path.exists(header):
263+
# *.h -> moc_*.cpp
264+
moc_file = "moc_" + os.path.basename(header).replace(
265+
".h", ".cpp")
266+
out_file = os.path.join(self.build_temp, moc_file)
267+
268+
if newer(header, out_file) or self.force:
269+
spawn.spawn(get_moc_args(out_file, header),
270+
dry_run=self.dry_run)
271+
272+
if os.path.getsize(out_file) > 0:
273+
ext.sources.append(out_file)
274+
250275
# Add the temp build directory to include path, for compiler to find
251276
# the created .moc files
252277
ext.include_dirs += [self._sip_output_dir()]

sip/DockAreaTitleBar_p.sip

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
%Import QtWidgets/QtWidgetsmod.sip
2+
3+
%If (Qt_5_0_0 -)
4+
5+
namespace ads
6+
{
7+
8+
class CTitleBarButton : QToolButton
9+
{
10+
%TypeHeaderCode
11+
#include <DockAreaTitleBar_p.h>
12+
%End
13+
14+
protected:
15+
bool event(QEvent *ev);
16+
17+
public:
18+
CTitleBarButton(bool visible = true, QWidget* parent /TransferThis/ = Q_NULLPTR );
19+
virtual void setVisible(bool visible);
20+
};
21+
22+
23+
class CSpacerWidget : QWidget
24+
{
25+
%TypeHeaderCode
26+
#include <DockAreaTitleBar_p.h>
27+
%End
28+
29+
public:
30+
CSpacerWidget(QWidget* Parent /TransferThis/ = 0 );
31+
virtual QSize sizeHint() const;
32+
virtual QSize minimumSizeHint() const;
33+
};
34+
35+
};
36+
37+
%End

sip/DockAreaWidget.sip

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace ads
66
{
7-
7+
88
class CDockAreaWidget : QFrame
99
{
1010

@@ -32,6 +32,7 @@ public:
3232
virtual ~CDockAreaWidget();
3333
ads::CDockManager* dockManager() const;
3434
ads::CDockContainerWidget* dockContainer() const;
35+
virtual QSize minimumSizeHint() const;
3536
QRect titleBarGeometry() const;
3637
QRect contentAreaGeometry() const;
3738
int dockWidgetsCount() const;

sip/DockManager.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ public:
194194
const QList<ads::CDockContainerWidget*> dockContainers() const;
195195
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
196196
unsigned int zOrderIndex() const;
197-
QByteArray saveState(int version = 1) const;
198-
bool restoreState(const QByteArray &state, int version = 1);
197+
QByteArray saveState(int version = 0) const;
198+
bool restoreState(const QByteArray &state, int version = 0);
199199
void addPerspective(const QString& UniquePrespectiveName);
200200
void removePerspective(const QString& Name);
201201
void removePerspectives(const QStringList& Names);

sip/FloatingDockContainer.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public:
2727

2828
virtual void moveFloating() = 0;
2929
virtual void finishDragging() = 0;
30+
virtual ~IFloatingWidget();
3031
};
3132

3233

@@ -56,6 +57,10 @@ protected:
5657
virtual void closeEvent(QCloseEvent *event);
5758
virtual void hideEvent(QHideEvent *event);
5859
virtual void showEvent(QShowEvent *event);
60+
%If (WS_WIN)
61+
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
62+
%End
63+
5964

6065
public:
6166
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);

sip/FloatingDragPreview.sip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class CFloatingDragPreview : QWidget, ads::IFloatingWidget
1313
%End
1414

1515
protected:
16-
virtual void moveEvent(QMoveEvent *event);
1716
virtual void paintEvent(QPaintEvent *e);
1817
CFloatingDragPreview(QWidget* Content /TransferThis/, QWidget* parent /TransferThis/);
1918

sip/ads.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
%Include ads_globals.sip
66
%Include DockWidget.sip
77
%Include DockAreaTabBar.sip
8+
%Include DockAreaTitleBar_p.sip
89
%Include DockAreaTitleBar.sip
910
%Include DockAreaWidget.sip
1011
%Include DockComponentsFactory.sip

sip/ads_globals.sip

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ namespace ads
88
#include <ads_globals.h>
99
%End
1010

11-
enum eStateFileVersion
12-
{
13-
InitialVersion,
14-
Version1,
15-
CurrentVersion
16-
};
17-
1811
enum DockWidgetArea
1912
{
2013
NoDockWidgetArea,

0 commit comments

Comments
 (0)