Merge pull request #52 from xing9634/master

Fixs bug
This commit is contained in:
chenlelin 2020-11-10 09:25:52 +08:00 committed by GitHub
commit 559cd98903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 5 deletions

View File

@ -30,7 +30,7 @@
extern QString llname, lwname;
ConfForm::ConfForm(QWidget *parent) :
QWidget(parent),
QDialog(parent),
ui(new Ui::ConfForm)
{
ui->setupUi(this);
@ -92,6 +92,12 @@ ConfForm::ConfForm(QWidget *parent) :
// ui->btnCancel->setStyleSheet(btnOffQss);
// ui->btnOk->setStyleSheet(btnOnQss);
// ui->btnCreate->setStyleSheet(btnOnQss);
ui->leAddr->setContextMenuPolicy(Qt::NoContextMenu);
ui->leName->setContextMenuPolicy(Qt::NoContextMenu);
ui->leDns->setContextMenuPolicy(Qt::NoContextMenu);
ui->leDns2->setContextMenuPolicy(Qt::NoContextMenu);
ui->leGateway->setContextMenuPolicy(Qt::NoContextMenu);
ui->lineUp->setStyleSheet(lineQss);
ui->lineDown->setStyleSheet(lineQss);
ui->lineUp->hide();
@ -148,6 +154,7 @@ void ConfForm::mousePressEvent(QMouseEvent *event)
this->dragPos = event->globalPos();
event->accept();
}
return QDialog::mousePressEvent(event);
}
void ConfForm::mouseReleaseEvent(QMouseEvent *event)
{
@ -159,6 +166,7 @@ void ConfForm::mouseMoveEvent(QMouseEvent *event)
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
}
return QDialog::mouseMoveEvent(event);
}
//网络配置参数设置界面的显示内容

View File

@ -25,13 +25,14 @@
#include <QPoint>
#include <QPainter>
#include <QPainterPath>
#include <QDialog>
#include <QListView>
namespace Ui {
class ConfForm;
}
class ConfForm : public QWidget
class ConfForm : public QDialog
{
Q_OBJECT

View File

@ -13,6 +13,9 @@
<property name="windowTitle">
<string/>
</property>
<property name="toolTip">
<string/>
</property>
<widget class="QWidget" name="centralWidget" native="true">
<property name="geometry">
<rect>

View File

@ -1871,9 +1871,10 @@ void MainWindow::onBtnCreateNetClicked()
QApplication::setQuitOnLastWindowClosed(false);
ConfForm *m_cf = new ConfForm();
m_cf->setAttribute(Qt::WA_DeleteOnClose);
m_cf->cbTypeChanged(3);
m_cf->move(primaryGeometry.width() / 2 - m_cf->width() / 2, primaryGeometry.height() / 2 - m_cf->height() / 2);
m_cf->show();
m_cf->exec();
}

View File

@ -653,7 +653,7 @@ void OneConnForm::on_btnInfo_clicked()
cf->setProp(ui->lbName->text(), v4method, addr, mask, gateway, dns, this->isActive);
cf->move(primaryGeometry.width() / 2 - cf->width() / 2, primaryGeometry.height() / 2 - cf->height() / 2);
cf->show();
cf->exec();
cf->raise();
bt->deleteLater();

View File

@ -373,7 +373,7 @@ void OneLancForm::on_btnInfo_clicked()
connect(cf, SIGNAL(requestRefreshLanList(int)), mw, SLOT(onBtnNetListClicked(int)));
cf->move(primaryGeometry.width() / 2 - cf->width() / 2, primaryGeometry.height() / 2 - cf->height() / 2);
cf->show();
cf->exec();
cf->raise();
cf->activateWindow();
}