diff --git a/libkdecorations/kcommondecoration.cpp b/libkdecorations/kcommondecoration.cpp index 31bf397579..546e93d63b 100644 --- a/libkdecorations/kcommondecoration.cpp +++ b/libkdecorations/kcommondecoration.cpp @@ -334,6 +334,11 @@ void KCommonDecoration::objDestroyed(QObject *obj) m_previewWidget = 0; } +QRegion KCommonDecoration::region(KDecorationDefines::Region r) +{ + return QRegion(); +} + int KCommonDecoration::buttonsLeftWidth() const { return buttonContainerWidth(m_buttonsLeft); diff --git a/libkdecorations/kcommondecoration.h b/libkdecorations/kcommondecoration.h index 6919f292c4..2f9443de6b 100644 --- a/libkdecorations/kcommondecoration.h +++ b/libkdecorations/kcommondecoration.h @@ -376,6 +376,16 @@ private Q_SLOTS: /* look out for buttons that have been destroyed. */ void objDestroyed(QObject *obj); + /** + * This slot can be reimplemented to return the regions defined + * by KDecorationDefines::Region. + * + * The default implementation always returns an empty region. + * + * @since 4.10 + */ + QRegion region(KDecorationDefines::Region r); + private: void resetLayout(); diff --git a/libkdecorations/kcommondecoration_p.cpp b/libkdecorations/kcommondecoration_p.cpp index 2e24ebddb2..5851c546fd 100644 --- a/libkdecorations/kcommondecoration_p.cpp +++ b/libkdecorations/kcommondecoration_p.cpp @@ -126,3 +126,13 @@ void KCommonDecorationWrapper::wrapSetAlphaEnabled(bool enabled) setAlphaEnabled(enabled); } +QRegion KCommonDecorationWrapper::region(KDecorationDefines::Region r) +{ + QRegion region; + QMetaObject::invokeMethod(decoration, "region", + Qt::DirectConnection, + Q_RETURN_ARG(QRegion, region), + Q_ARG(KDecorationDefines::Region, + KDecorationDefines::ExtendedBorderRegion)); + return region; +} diff --git a/libkdecorations/kcommondecoration_p.h b/libkdecorations/kcommondecoration_p.h index a462987f4d..df4d4b398c 100644 --- a/libkdecorations/kcommondecoration_p.h +++ b/libkdecorations/kcommondecoration_p.h @@ -62,6 +62,16 @@ public: virtual void padding(int &left, int &right, int &top, int &bottom) const; void wrapSetAlphaEnabled(bool enabled); + +public Q_SLOTS: + /** + * This slot can be reimplemented to return the regions defined + * by KDecorationDefines::Region. + * + * @since 4.10 + */ + QRegion region(KDecorationDefines::Region r); + private: KCommonDecoration* decoration; };