添加dashboard拖拽时目标位置的高亮提示
This commit is contained in:
parent
8526de90b8
commit
19c381c1df
|
|
@ -41,6 +41,7 @@ public:
|
||||||
Dashboard* getDashboard(const QString&);
|
Dashboard* getDashboard(const QString&);
|
||||||
Dashboard* takeDashboard(const QString&);
|
Dashboard* takeDashboard(const QString&);
|
||||||
DashboardFrame* getDashboardFrame(const QString&);
|
DashboardFrame* getDashboardFrame(const QString&);
|
||||||
|
void setDashboardAreaHighlight(bool);
|
||||||
void moveDashboardToNewDVIEWindow(const QString&, QPoint);
|
void moveDashboardToNewDVIEWindow(const QString&, QPoint);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -84,6 +85,7 @@ private:
|
||||||
dashboardFrame::frameType m_type;
|
dashboardFrame::frameType m_type;
|
||||||
QWidget* m_pParentWindow;
|
QWidget* m_pParentWindow;
|
||||||
TransparentMask* m_pTransparentMask;
|
TransparentMask* m_pTransparentMask;
|
||||||
|
QWidget* m_pDashboardHighlight;
|
||||||
MessageDialog* m_pMessageDialog;
|
MessageDialog* m_pMessageDialog;
|
||||||
CustomTabBar* m_pDashboardTabBar;
|
CustomTabBar* m_pDashboardTabBar;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ DashboardFrame::DashboardFrame(const QString& strName, dashboardFrame::frameType
|
||||||
, ui(new Ui::dashboardFrame)
|
, ui(new Ui::dashboardFrame)
|
||||||
, m_pParentWindow(nullptr)
|
, m_pParentWindow(nullptr)
|
||||||
, m_pTransparentMask(nullptr)
|
, m_pTransparentMask(nullptr)
|
||||||
|
, m_pDashboardHighlight(nullptr)
|
||||||
, m_pMessageDialog(nullptr)
|
, m_pMessageDialog(nullptr)
|
||||||
, m_pDashboardTabBar(nullptr)
|
, m_pDashboardTabBar(nullptr)
|
||||||
, m_pDashboardNamingDialog(nullptr)
|
, m_pDashboardNamingDialog(nullptr)
|
||||||
|
|
@ -86,6 +87,7 @@ void DashboardFrame::dragEnterEvent(QDragEnterEvent* event)
|
||||||
if( mimeData->hasFormat("dragData/customTab") )
|
if( mimeData->hasFormat("dragData/customTab") )
|
||||||
{
|
{
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
|
setDashboardAreaHighlight(true);
|
||||||
//qDebug() << "dragEnterEvent-frame";
|
//qDebug() << "dragEnterEvent-frame";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -93,11 +95,13 @@ void DashboardFrame::dragEnterEvent(QDragEnterEvent* event)
|
||||||
}
|
}
|
||||||
void DashboardFrame::dragLeaveEvent(QDragLeaveEvent* event)
|
void DashboardFrame::dragLeaveEvent(QDragLeaveEvent* event)
|
||||||
{
|
{
|
||||||
|
setDashboardAreaHighlight(false);
|
||||||
//qDebug() << "dragLeaveEvent-frame";
|
//qDebug() << "dragLeaveEvent-frame";
|
||||||
}
|
}
|
||||||
void DashboardFrame::dropEvent(QDropEvent* event)
|
void DashboardFrame::dropEvent(QDropEvent* event)
|
||||||
{
|
{
|
||||||
//qDebug() << "dropEvent-frame";
|
//qDebug() << "dropEvent-frame";
|
||||||
|
setDashboardAreaHighlight(false);
|
||||||
event->setDropAction(Qt::MoveAction);
|
event->setDropAction(Qt::MoveAction);
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
||||||
|
|
@ -344,6 +348,23 @@ void DashboardFrame::setCurrentDashboard(const QString& strName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DashboardFrame::setDashboardAreaHighlight(bool bVisible)
|
||||||
|
{
|
||||||
|
if(m_pDashboardHighlight == nullptr)
|
||||||
|
{
|
||||||
|
m_pDashboardHighlight = new QWidget(this);
|
||||||
|
m_pDashboardHighlight->setStyleSheet("background-color: rgba(0, 141, 212, 85);");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bVisible)
|
||||||
|
{
|
||||||
|
m_pDashboardHighlight->setGeometry(ui->mainStack->geometry());
|
||||||
|
m_pDashboardHighlight->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_pDashboardHighlight->hide();
|
||||||
|
}
|
||||||
|
|
||||||
void DashboardFrame::moveDashboardToNewDVIEWindow(const QString& strDashboard, QPoint pos)
|
void DashboardFrame::moveDashboardToNewDVIEWindow(const QString& strDashboard, QPoint pos)
|
||||||
{
|
{
|
||||||
Dashboard* dashboard = takeDashboard(strDashboard);
|
Dashboard* dashboard = takeDashboard(strDashboard);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue