界面停靠
This commit is contained in:
@@ -17,14 +17,9 @@ tools_Index4::tools_Index4(QWidget *parent) :
|
||||
this->setStyleSheet(stylesheet);
|
||||
file.close();
|
||||
|
||||
|
||||
setWindowTitle(tr("Servos Inspector"));
|
||||
|
||||
|
||||
//this->setFloating(true);
|
||||
|
||||
//this->setWindowFlags(Qt::Tool);
|
||||
|
||||
//setWindowFlags(Qt::Dialog);
|
||||
}
|
||||
|
||||
tools_Index4::~tools_Index4()
|
||||
@@ -32,23 +27,37 @@ tools_Index4::~tools_Index4()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void tools_Index4::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << event;
|
||||
}
|
||||
|
||||
|
||||
void tools_Index4::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
this->setParent(nullptr);
|
||||
this->setGeometry(m_parent->geometry());
|
||||
this->show();
|
||||
if(this->parent())
|
||||
{
|
||||
this->setParent(nullptr);
|
||||
this->setWindowFlags(Qt::Dialog);
|
||||
this->move(0,10);
|
||||
this->show();
|
||||
}
|
||||
|
||||
qDebug() << "Move" << event;
|
||||
}
|
||||
|
||||
void tools_Index4::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
//this->setParent(m_parent);
|
||||
this->setParent(m_parent);
|
||||
|
||||
setWindowFlags(Qt::Widget);
|
||||
this->setGeometry(m_parent->geometry());
|
||||
this->move(0,10);
|
||||
this->show();
|
||||
|
||||
//this->setGeometry(m_parent->geometry());
|
||||
qDebug() << "DoubleClick" << event;
|
||||
|
||||
//this->show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "QFile"
|
||||
#include "QTextStream"
|
||||
#include "QDebug"
|
||||
#include "QCloseEvent"
|
||||
|
||||
namespace Ui {
|
||||
class tools_Index4;
|
||||
@@ -28,6 +29,8 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user