1
0
mirror of https://github.com/jaredtao/TaoQuick.git synced 2025-01-19 20:22:56 +08:00
2020-11-07 00:51:12 +08:00

39 lines
1.3 KiB
C++

#pragma once
#include <QObject>
#include <QVariant>
#include <QRect>
#include <QCursor>
#include "TaoCommonGlobal.h"
class TAO_API QuickTool : public QObject
{
Q_OBJECT
public:
explicit QuickTool(QObject *parent = nullptr);
explicit QuickTool(QObject *rootObject, QObject *parent = nullptr);
virtual ~QuickTool() override;
void setRootObjet(QObject *rootObj) { pRootObject = rootObj; }
QObject *rootObject() const { return pRootObject; }
void findRootByNode(QObject *nodeObject);
public slots:
QObject *getObject(const QString &targetObjName) const;
QVariant getObjectProperty(QObject *targetObj, const QString &propertyName) const;
void setObjectProperty(QObject *targetObj, const QString &propertyName,
const QVariant &value) const;
QVariant getObjectProperty(const QString &targetObjName, const QString &propertyName) const;
void setObjectProperty(const QString &targetObjName, const QString &propertyName,
const QVariant &value) const;
QRect getItemGeometryToScene(const QString &targetObjName) const;
void setAppOverrideCursor(QCursor cursor);
void restoreAppOverrideCursor();
QPoint cursorGlobalPos() const;
private:
QObject *pRootObject = nullptr;
};