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