Update PyQt bindings for 3.5.0 (#198)

This commit is contained in:
Nicolas Elie 2020-06-10 15:08:31 +02:00 committed by GitHub
parent 80f92e5697
commit fa2ab356e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 3 deletions

View File

@ -160,6 +160,13 @@ class build_ext(sipdistutils.build_ext):
raise SystemExit('Could not find PyQt SIP binary.') raise SystemExit('Could not find PyQt SIP binary.')
def _sip_sipfiles_dir(self):
sip_dir = super()._sip_sipfiles_dir()
if os.path.exists(sip_dir):
return sip_dir
return os.path.join(sys.prefix, 'sip', 'PyQt5')
def _sip_compile(self, sip_bin, source, sbf): def _sip_compile(self, sip_bin, source, sbf):
cmd = [sip_bin] cmd = [sip_bin]
if hasattr(self, 'sip_opts'): if hasattr(self, 'sip_opts'):
@ -211,8 +218,6 @@ class build_ext(sipdistutils.build_ext):
return super().swig_sources(sources, extension) return super().swig_sources(sources, extension)
def build_extension(self, ext): def build_extension(self, 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")] cppsources = [source for source in ext.sources if source.endswith(".cpp")]
headersources = ['src/DockAreaTitleBar_p.h'] headersources = ['src/DockAreaTitleBar_p.h']

View File

@ -0,0 +1,31 @@
%Import QtWidgets/QtWidgetsmod.sip
%If (Qt_5_0_0 -)
namespace ads
{
/**
* Manages focus styling of dock widgets and handling of focus changes
*/
class CDockFocusController : QObject
{
%TypeHeaderCode
#include <DockFocusController.h>
%End
public:
CDockFocusController(ads::CDockManager* DockManager);
virtual ~CDockFocusController();
void notifyWidgetOrAreaRelocation(QWidget* RelocatedWidget);
void notifyFloatingWidgetDrop(ads::CFloatingDockContainer* FloatingWidget);
public slots:
void setDockWidgetFocused(ads::CDockWidget* focusedNow);
}; // class DockFocusController
};
// namespace ads
%End

View File

@ -133,6 +133,8 @@ protected:
void removeDockContainer(ads::CDockContainerWidget* DockContainer /TransferBack/); void removeDockContainer(ads::CDockContainerWidget* DockContainer /TransferBack/);
ads::CDockOverlay* containerOverlay() const; ads::CDockOverlay* containerOverlay() const;
ads::CDockOverlay* dockAreaOverlay() const; ads::CDockOverlay* dockAreaOverlay() const;
void notifyWidgetOrAreaRelocation(QWidget* RelocatedWidget);
void notifyFloatingWidgetDrop(ads::CFloatingDockContainer* FloatingWidget);
virtual void showEvent(QShowEvent *event); virtual void showEvent(QShowEvent *event);
@ -166,6 +168,7 @@ public:
FloatingContainerHasWidgetTitle, FloatingContainerHasWidgetTitle,
FloatingContainerHasWidgetIcon, FloatingContainerHasWidgetIcon,
HideSingleCentralWidgetTitleBar, HideSingleCentralWidgetTitleBar,
FocusHighlighting,
DefaultDockAreaButtons, DefaultDockAreaButtons,
DefaultBaseConfig, DefaultBaseConfig,
DefaultOpaqueConfig, DefaultOpaqueConfig,
@ -211,6 +214,7 @@ public:
public slots: public slots:
void openPerspective(const QString& PerspectiveName); void openPerspective(const QString& PerspectiveName);
void setDockWidgetFocused(ads::CDockWidget* DockWidget);
signals: signals:
void perspectiveListChanged(); void perspectiveListChanged();
@ -223,6 +227,7 @@ signals:
void dockAreaCreated(ads::CDockAreaWidget* DockArea); void dockAreaCreated(ads::CDockAreaWidget* DockArea);
void dockWidgetAboutToBeRemoved(ads::CDockWidget* DockWidget); void dockWidgetAboutToBeRemoved(ads::CDockWidget* DockWidget);
void dockWidgetRemoved(ads::CDockWidget* DockWidget); void dockWidgetRemoved(ads::CDockWidget* DockWidget);
void focusedDockWidgetChanged(ads::CDockWidget* old, ads::CDockWidget* now);
}; };
}; };

View File

@ -34,6 +34,7 @@ public:
bool isClosable() const; bool isClosable() const;
virtual bool event(QEvent *e); virtual bool event(QEvent *e);
void setElideMode(Qt::TextElideMode mode); void setElideMode(Qt::TextElideMode mode);
void updateStyle();
public slots: public slots:
virtual void setVisible(bool visible); virtual void setVisible(bool visible);

View File

@ -11,6 +11,7 @@
%Include DockComponentsFactory.sip %Include DockComponentsFactory.sip
%Include DockContainerWidget.sip %Include DockContainerWidget.sip
%Include DockingStateReader.sip %Include DockingStateReader.sip
%Include DockFocusController.sip
%Include DockManager.sip %Include DockManager.sip
%Include DockOverlay.sip %Include DockOverlay.sip
%Include DockSplitter.sip %Include DockSplitter.sip