修正大量demo

This commit is contained in:
feiyangqingyun
2021-03-08 09:04:48 +08:00
parent 2f5f9bd427
commit 23a32e6d32
32 changed files with 428 additions and 209 deletions

View File

@@ -3,9 +3,8 @@
#include <QWidget>
namespace Ui
{
class frmMoveWidget;
namespace Ui {
class frmMoveWidget;
}
class frmMoveWidget : public QWidget

View File

@@ -55,14 +55,6 @@ bool MoveWidget::eventFilter(QObject *watched, QEvent *event)
return QObject::eventFilter(watched, event);
}
void MoveWidget::setWidget(QWidget *widget)
{
if (this->widget == 0) {
this->widget = widget;
this->widget->installEventFilter(this);
}
}
void MoveWidget::setLeftButton(bool leftButton)
{
this->leftButton = leftButton;
@@ -72,3 +64,11 @@ void MoveWidget::setInControl(bool inControl)
{
this->inControl = inControl;
}
void MoveWidget::setWidget(QWidget *widget)
{
if (this->widget == 0) {
this->widget = widget;
this->widget->installEventFilter(this);
}
}

View File

@@ -3,21 +3,15 @@
/**
* 通用控件移动类 作者:feiyangqingyun(QQ:517216493) 2019-9-28
* 1:可以指定需要移动的widget
* 2:可设置是否限定鼠标左键拖动
* 3:支持任意widget控件
* 1. 可以指定需要移动的widget
* 2. 可设置是否限定鼠标左键拖动
* 3. 支持任意widget控件
*/
#include <QWidget>
#ifdef quc
#if (QT_VERSION < QT_VERSION_CHECK(5,7,0))
#include <QtDesigner/QDesignerExportWidget>
#else
#include <QtUiPlugin/QDesignerExportWidget>
#endif
class QDESIGNER_WIDGET_EXPORT MoveWidget : public QObject
class Q_DECL_EXPORT MoveWidget : public QObject
#else
class MoveWidget : public QObject
#endif