CustomFrame: Allow to specify a callback for QWindow opt-in
Which QWindows should get a custom frame is up to you. Just return true in the callback.
This commit is contained in:
@@ -124,13 +124,16 @@ public:
|
||||
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
typedef bool (*ShouldUseCustomFrame)(QWindow *);
|
||||
|
||||
class DOCKS_EXPORT CustomFrameHelper
|
||||
: public QObject
|
||||
, public QAbstractNativeEventFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CustomFrameHelper(QObject *parent = nullptr);
|
||||
explicit CustomFrameHelper(ShouldUseCustomFrame shouldUseCustomFrameFunc,
|
||||
QObject *parent = nullptr);
|
||||
~CustomFrameHelper() override;
|
||||
|
||||
public Q_SLOTS:
|
||||
@@ -142,6 +145,7 @@ protected:
|
||||
|
||||
private:
|
||||
bool m_inDtor = false;
|
||||
ShouldUseCustomFrame m_shouldUseCustomFrameFunc = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user