This commit is contained in:
Uwe Kindler 2020-06-05 07:40:10 +02:00
commit f074ea9d67
8 changed files with 72 additions and 11 deletions

View File

@ -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
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)
@ -247,6 +248,30 @@ class build_ext(sipdistutils.build_ext):
if os.path.getsize(out_file) > 0:
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
# the created .moc files
ext.include_dirs += [self._sip_output_dir()]

View 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

View File

@ -4,7 +4,7 @@
namespace ads
{
class CDockAreaWidget : QFrame
{
@ -32,6 +32,7 @@ public:
virtual ~CDockAreaWidget();
ads::CDockManager* dockManager() const;
ads::CDockContainerWidget* dockContainer() const;
virtual QSize minimumSizeHint() const;
QRect titleBarGeometry() const;
QRect contentAreaGeometry() const;
int dockWidgetsCount() const;

View File

@ -194,8 +194,8 @@ public:
const QList<ads::CDockContainerWidget*> dockContainers() const;
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
unsigned int zOrderIndex() const;
QByteArray saveState(int version = 1) const;
bool restoreState(const QByteArray &state, int version = 1);
QByteArray saveState(int version = 0) const;
bool restoreState(const QByteArray &state, int version = 0);
void addPerspective(const QString& UniquePrespectiveName);
void removePerspective(const QString& Name);
void removePerspectives(const QStringList& Names);

View File

@ -27,6 +27,7 @@ public:
virtual void moveFloating() = 0;
virtual void finishDragging() = 0;
virtual ~IFloatingWidget();
};
@ -56,6 +57,10 @@ protected:
virtual void closeEvent(QCloseEvent *event);
virtual void hideEvent(QHideEvent *event);
virtual void showEvent(QShowEvent *event);
%If (WS_WIN)
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
%End
public:
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);

View File

@ -13,7 +13,6 @@ class CFloatingDragPreview : QWidget, ads::IFloatingWidget
%End
protected:
virtual void moveEvent(QMoveEvent *event);
virtual void paintEvent(QPaintEvent *e);
CFloatingDragPreview(QWidget* Content /TransferThis/, QWidget* parent /TransferThis/);

View File

@ -5,6 +5,7 @@
%Include ads_globals.sip
%Include DockWidget.sip
%Include DockAreaTabBar.sip
%Include DockAreaTitleBar_p.sip
%Include DockAreaTitleBar.sip
%Include DockAreaWidget.sip
%Include DockComponentsFactory.sip

View File

@ -8,13 +8,6 @@ namespace ads
#include <ads_globals.h>
%End
enum eStateFileVersion
{
InitialVersion,
Version1,
CurrentVersion
};
enum DockWidgetArea
{
NoDockWidgetArea,