Add a button to Topbar to call out WarningMessage above mainwindow , make the WarningMEssagewidget be popup widget.

This commit is contained in:
chenhuijun
2024-04-19 14:10:47 +08:00
parent 7dc0404481
commit e4eb325c40
4 changed files with 25 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
#include "models/User.h"
#include "appvals/AppGlobalValues.h"
#include "components/UTextEdit.h"
#include "components/WarningMessageWidget.h"
#include "json/jsonobject.h"
@@ -130,7 +131,14 @@ void MainWindow::initializeLayout()
auto layout = new QVBoxLayout(mUI->mCentralWidget);
layout->setMargin(0);
layout->setSpacing(0);
QWidget* topBarWidget = new TopBarWidget(this);
TopBarWidget* topBarWidget = new TopBarWidget(this);
auto popNotifications = new WarningMessageWidget(this);
popNotifications->hide();
connect(topBarWidget,&TopBarWidget::warnBtnClicked,[=](){
auto pos = topBarWidget->mapToGlobal(QPoint(topBarWidget->width(),topBarWidget->height()));
popNotifications->setPopupArgs(height(),pos.x(),pos.y());
popNotifications->show();
});
layout->addWidget(topBarWidget);
layout->addWidget(mTabWidget);
layout->addWidget(mInitializWidget);