自动打开两个窗口

This commit is contained in:
w-mj committed 2017-12-24 16:38:43 +08:00
1 parent 9ec3bb2b4b
commit b56efd21b9
4 files changed
+17 -1

No files matched your search

+12
View File
@@ -45,6 +45,18 @@ Monitor::Monitor(MainWindow *parent) :
CarList::getInstance()->setAdapter(adapter);
}
void Monitor::showEvent(QShowEvent *event)
{
QWidget::showEvent(event);
QTimer *timer = new QTimer(this);
timer->setSingleShot(true);
connect(timer, &QTimer::timeout, [this]() {
emit this->ui->showList->toggle();
emit this->ui->showLog->toggle();
});
timer->start(100); // 延时100ms,等待窗口创建完毕后执行,哈哈哈哈哈
}
Monitor::~Monitor()
{
delete ui;