qtquick: Start using the WidgetResizeHandler

It's no longer commented out in FloatingWindow.
Doesn't do much for QtQuick, but at least we don't have different
code paths

Making it work is next.
This commit is contained in:
Sergio Martins
2020-11-26 23:13:46 +00:00
parent 08eab8882f
commit e0aa547393
5 changed files with 19 additions and 9 deletions

View File

@@ -12,7 +12,8 @@
#ifndef KD_WIDGET_RESIZE_HANDLER_P_H
#define KD_WIDGET_RESIZE_HANDLER_P_H
#include <QWidget>
#include "QWidgetAdapter.h"
#include <QPoint>
#include <QDebug>
@@ -28,10 +29,10 @@ class WidgetResizeHandler : public QObject
{
Q_OBJECT
public:
explicit WidgetResizeHandler(QWidget *target = nullptr);
explicit WidgetResizeHandler(QWidgetOrQuick *target = nullptr);
~WidgetResizeHandler() override;
void setTarget(QWidget *w);
void setTarget(QWidgetOrQuick *w);
#ifdef Q_OS_WIN
static bool handleWindowsNativeEvent(FloatingWindow *w, const QByteArray &eventType, void *message, long *result);
@@ -55,7 +56,7 @@ private:
void mouseMoveEvent(QMouseEvent *e);
void updateCursor(CursorPosition m);
CursorPosition cursorPosition(QPoint) const;
QWidget *mTarget = nullptr;
QWidgetOrQuick *mTarget = nullptr;
CursorPosition mCursorPos = CursorPosition::Undefined;
QPoint mNewPosition;
bool mResizeWidget = false;