代码拉取完成,页面将自动刷新
同步操作将从 Vanishi/DS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "mFlowButtonWidget.h"
#include "mFlowStepMenuDialog.h"
#include "TaskFlow/mFcModels.h"
#include "mDownArrow.h"
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QMimeData>
#include <QDrag>
#include <QMouseEvent>
#include <QDebug>
MFlowButtonWidget::MFlowButtonWidget(QWidget *parent,MControl *control,MDownArrow *arrow,MFlowStepParams *params,bool bgnormal) : QWidget(parent)
{
setFixedSize(110,30);
setAttribute(Qt::WA_StyledBackground,true);
if(bgnormal){
setStyleSheet(m_stylesheet_QWidget_flowleftwidget_blue_normal);
}else {
setStyleSheet(m_stylesheet_QWidget_flowleftwidget_blue_press);
}
setCursor(Qt::PointingHandCursor);
this->arrow = arrow;
this->data = new MFlowStepData(control,params);
this->data->widget=this;
QVBoxLayout *boxLayout = new QVBoxLayout(this);
boxLayout->setContentsMargins(0,0,0,0);
title = new QLabel(this);
title->setStyleSheet(m_stylesheet_QLabel_title);
title->setText(control->menuTip);
boxLayout->addWidget(title,0,Qt::AlignCenter);
}
MFlowButtonWidget::~MFlowButtonWidget()
{
data->widgetIsDelete = true;
delete data;
}
void MFlowButtonWidget::mousePressEvent(QMouseEvent *event)
{
if(event->button()==Qt::LeftButton){
//左键
this->data->notificationType=MCONNSTANT_NOTIFICATION_TYPE_START;
emit this->notificationToParentWidget(this->data);
setStyleSheet(m_stylesheet_QWidget_flowleftwidget_blue_press);
QPoint offset = event->pos();
QByteArray itemData;
QDataStream dataStream(&itemData, QIODevice::WriteOnly);
dataStream << offset;
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/MFlowButtonWidget", itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
// drag->setPixmap(QPixmap::grabWidget(this));
drag->setHotSpot(offset);
if (drag->exec(Qt::MoveAction, Qt::CopyAction) == Qt::MoveAction) {
this->data->notificationType=MCONNSTANT_NOTIFICATION_TYPE_MOVE_END_SHOWCONTENT;
emit this->notificationToParentWidget(this->data);
} else {
this->data->notificationType=MCONNSTANT_NOTIFICATION_TYPE_OTHER_END_SHOWCONTENT;
emit this->notificationToParentWidget(this->data);
}
}else {
MFlowStepMenuDialog *menu = new MFlowStepMenuDialog(this);
connect(menu->deleteBtn,&QPushButton::clicked,[this,menu](){
this->data->notificationType=MCONNSTANT_NOTIFICATION_TYPE_DELETE_CURRENT_WIDGET;
emit this->notificationToParentWidget(this->data);
menu->deleteLater();
});
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->move(QCursor::pos());
menu->show();
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。