mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T220, register main widget
This commit is contained in:
@@ -178,6 +178,11 @@ namespace BlackGui
|
||||
return CGuiUtility::mainApplicationWidget();
|
||||
}
|
||||
|
||||
void CGuiApplication::registerMainApplicationWidget(QWidget *mainWidget)
|
||||
{
|
||||
CGuiUtility::registerMainApplicationWidget(mainWidget);
|
||||
}
|
||||
|
||||
QMainWindow *CGuiApplication::mainApplicationWindow()
|
||||
{
|
||||
return qobject_cast<QMainWindow *>(CGuiApplication::mainApplicationWidget());
|
||||
|
||||
@@ -210,6 +210,9 @@ namespace BlackGui
|
||||
//! \copydoc BlackGui::CGuiUtility::mainApplicationWidget
|
||||
static QWidget *mainApplicationWidget();
|
||||
|
||||
//! \copydoc BlackGui::CGuiUtility::registerMainApplicationWidget
|
||||
void registerMainApplicationWidget(QWidget *mainWidget);
|
||||
|
||||
//! Main application window
|
||||
static QMainWindow *mainApplicationWindow();
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ CSwiftData::CSwiftData(QWidget *parent) :
|
||||
CIdentifiable(this),
|
||||
ui(new Ui::CSwiftData)
|
||||
{
|
||||
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
|
||||
sGui->registerMainApplicationWidget(this);
|
||||
ui->setupUi(this);
|
||||
this->init();
|
||||
}
|
||||
|
||||
@@ -72,6 +72,8 @@ SwiftGuiStd::SwiftGuiStd(BlackGui::CEnableForFramelessWindow::WindowMode windowM
|
||||
ui(new Ui::SwiftGuiStd)
|
||||
{
|
||||
// GUI
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
|
||||
sGui->registerMainApplicationWidget(this);
|
||||
ui->setupUi(this);
|
||||
this->setDynamicProperties(windowMode == CEnableForFramelessWindow::WindowFrameless);
|
||||
this->init();
|
||||
|
||||
@@ -49,6 +49,8 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) :
|
||||
CIdentifiable(this),
|
||||
ui(new Ui::CSwiftLauncher)
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
|
||||
sGui->registerMainApplicationWidget(this);
|
||||
ui->setupUi(this);
|
||||
this->init();
|
||||
connect(ui->tb_SwiftCore, &QPushButton::pressed, this, &CSwiftLauncher::startButtonPressed);
|
||||
|
||||
Reference in New Issue
Block a user