mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Style change signals used Qt::QueuedConnection
This commit is contained in:
@@ -46,7 +46,7 @@ namespace BlackGui
|
||||
ui->tvp_AircraftModel->menuRemoveItems(CAircraftModelView::MenuHighlightStashed); // not supported here
|
||||
connect(ui->tvp_AircraftModel, &CAircraftModelView::requestNewBackendData, this, &CDbModelComponent::onReload);
|
||||
connect(ui->tvp_AircraftModel, &CAircraftModelView::requestStash, this, &CDbModelComponent::requestStash);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDbModelComponent::onStyleSheetChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDbModelComponent::onStyleSheetChanged, Qt::QueuedConnection);
|
||||
|
||||
// configure view
|
||||
ui->tvp_AircraftModel->setFilterWidget(ui->filter_AircraftModelFilter);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace BlackGui
|
||||
this->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this->m_input, &CMarginsInput::changedMargins, this, &CNavigatorDialog::ps_menuChangeMargins);
|
||||
connect(this, &CNavigatorDialog::customContextMenuRequested, this, &CNavigatorDialog::ps_showContextMenu);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CNavigatorDialog::ps_onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CNavigatorDialog::ps_onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
this->ps_onStyleSheetsChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace BlackGui
|
||||
|
||||
// connect
|
||||
connect(this, &QDockWidget::topLevelChanged, this, &CDockWidget::onTopLevelChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDockWidget::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDockWidget::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
connect(this, &QDockWidget::visibilityChanged, this, &CDockWidget::onVisibilityChanged);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackGui
|
||||
this->setTextFormat(Qt::RichText);
|
||||
this->setInfoText("drop data here");
|
||||
this->onStyleSheetsChanged();
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDropSite::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDropSite::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void CDropSite::setInfoText(const QString &dropSiteText)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BlackGui
|
||||
{
|
||||
this->setWindowTitle("Filter dialog");
|
||||
this->onStyleSheetChanged();
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CFilterDialog::onStyleSheetChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CFilterDialog::onStyleSheetChanged, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
CFilterDialog::~CFilterDialog()
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BlackGui
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "sGui missing");
|
||||
this->setWindowTitle("Filter widget");
|
||||
ps_onStyleSheetChanged();
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CFilterWidget::ps_onStyleSheetChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CFilterWidget::ps_onStyleSheetChanged, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
CFilterWidget::~CFilterWidget()
|
||||
|
||||
@@ -101,8 +101,8 @@ namespace BlackGui
|
||||
this->settingsChanged();
|
||||
this->setCurrentFontValues(); // most likely the default font and not any stylesheet font at this time
|
||||
sGui = this;
|
||||
connect(&m_styleSheetUtility, &CStyleSheetUtility::styleSheetsChanged, this, &CGuiApplication::onStyleSheetsChanged);
|
||||
connect(this, &CGuiApplication::startUpCompleted, this, &CGuiApplication::superviseWindowMinSizes);
|
||||
connect(&m_styleSheetUtility, &CStyleSheetUtility::styleSheetsChanged, this, &CGuiApplication::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
connect(this, &CGuiApplication::startUpCompleted, this, &CGuiApplication::superviseWindowMinSizes, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -995,13 +995,13 @@ namespace BlackGui
|
||||
|
||||
void CGuiApplication::onStyleSheetsChanged()
|
||||
{
|
||||
emit this->styleSheetsChanged();
|
||||
const QFont f = CGuiUtility::currentFont();
|
||||
if (f.pointSize() != m_fontPointSize || f.family() != m_fontFamily)
|
||||
{
|
||||
emit this->fontChanged();
|
||||
CLogMessage(this).info(this->getFontInfo());
|
||||
}
|
||||
emit this->styleSheetsChanged();
|
||||
}
|
||||
|
||||
void CGuiApplication::setCurrentFontValues()
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace BlackGui
|
||||
// context menu
|
||||
this->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this, &CInfoArea::customContextMenuRequested, this, &CInfoArea::showContextMenu);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CInfoArea::onStyleSheetChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CInfoArea::onStyleSheetChanged, Qt::QueuedConnection);
|
||||
|
||||
// initial style sheet setting
|
||||
this->onStyleSheetChanged();
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackGui
|
||||
{
|
||||
this->init(w, h);
|
||||
this->showKillButton(false);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &COverlayMessages::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &COverlayMessages::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
connect(ui->pb_Ok, &QPushButton::clicked, this, &COverlayMessages::onOkClicked);
|
||||
connect(ui->pb_Cancel, &QPushButton::clicked, this, &COverlayMessages::onCancelClicked);
|
||||
connect(ui->tb_Kill, &QPushButton::clicked, this, &COverlayMessages::onKillClicked);
|
||||
|
||||
@@ -44,8 +44,7 @@ namespace BlackGui
|
||||
{
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~COverlayMessagesBase()
|
||||
{ }
|
||||
virtual ~COverlayMessagesBase() override { }
|
||||
|
||||
//! Show the inner frame
|
||||
void showStatusMessagesFrame()
|
||||
@@ -58,7 +57,7 @@ namespace BlackGui
|
||||
{
|
||||
m_widthFactor = widthFactor;
|
||||
m_heightFactor = heightFactor;
|
||||
if (middleFactor >=0) { m_middleFactor = middleFactor; }
|
||||
if (middleFactor >= 0) { m_middleFactor = middleFactor; }
|
||||
}
|
||||
|
||||
//! \copydoc BlackGui::COverlayMessages::showKillButton
|
||||
@@ -194,7 +193,7 @@ namespace BlackGui
|
||||
const int w = inner.width();
|
||||
const int h = inner.height();
|
||||
const int x = middle.x() - w / 2;
|
||||
const int y = middle.y() - h / m_middleFactor;
|
||||
const int y = qRound(middle.y() - h / m_middleFactor);
|
||||
m_overlayMessages->setGeometry(x, y, w, h);
|
||||
}
|
||||
|
||||
@@ -230,8 +229,8 @@ namespace BlackGui
|
||||
const int w = std::max(WIDGET::width(), WIDGET::minimumWidth());
|
||||
const int h = std::max(WIDGET::height(), WIDGET::minimumHeight());
|
||||
|
||||
int wInner = m_widthFactor * w;
|
||||
int hInner = m_heightFactor * h;
|
||||
int wInner = qRound(m_widthFactor * w);
|
||||
int hInner = qRound(m_heightFactor * h);
|
||||
if (wInner > WIDGET::maximumWidth()) { wInner = WIDGET::maximumWidth(); }
|
||||
if (hInner > WIDGET::maximumHeight()) { hInner = WIDGET::maximumHeight(); }
|
||||
return QSize(wInner, hInner);
|
||||
|
||||
@@ -17,6 +17,14 @@ QFrame {
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
QCheckBox {
|
||||
border: 0px solid green; /* also borders label */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* CGuiUtility::checkBoxReadOnly */
|
||||
/* used for read-only checkboxes */
|
||||
|
||||
QCheckBox::indicator {
|
||||
color: #b1b1b1;
|
||||
border: 1px solid #7f7f7f;
|
||||
@@ -305,11 +313,6 @@ QLineEdit[readOnly="true"] {
|
||||
border: 1px solid rgba(50,50,50);
|
||||
}
|
||||
|
||||
QCheckBox {
|
||||
border: 0px solid green; /* also borders label */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
QTextEdit {
|
||||
border: 1px solid green;
|
||||
background: transparent;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace BlackGui
|
||||
connect(this, &QTextEdit::customContextMenuRequested, this, &CTextMessageTextEdit::showContextMenuForTextEdit);
|
||||
|
||||
// style sheet
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CTextMessageTextEdit::onStyleSheetChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CTextMessageTextEdit::onStyleSheetChanged, Qt::QueuedConnection);
|
||||
onStyleSheetChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ CSwiftCore::CSwiftCore(QWidget *parent) :
|
||||
m_mwaStatusBar = nullptr;
|
||||
|
||||
connect(ui->pb_Restart, &QPushButton::clicked, this, &CSwiftCore::restart);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftCore::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftCore::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
|
||||
this->initLogDisplay();
|
||||
this->initStyleSheet();
|
||||
|
||||
@@ -106,7 +106,7 @@ void CSwiftData::init()
|
||||
m_mwaOverlayFrame = ui->comp_MainInfoArea->getMappingComponent();
|
||||
|
||||
this->initStyleSheet();
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftData::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftData::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
this->initMenu();
|
||||
|
||||
// update title
|
||||
|
||||
@@ -232,7 +232,7 @@ void SwiftGuiStd::initGuiSignals()
|
||||
|
||||
// settings (GUI component), styles
|
||||
connect(ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedWindowsOpacity, this, &SwiftGuiStd::onChangedWindowOpacity);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &SwiftGuiStd::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &SwiftGuiStd::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
|
||||
// login
|
||||
connect(ui->comp_Login, &CLoginComponent::loginOrLogoffCancelled, this, &SwiftGuiStd::setMainPageToInfoArea);
|
||||
|
||||
@@ -68,7 +68,7 @@ CSwiftLauncher::CSwiftLauncher(QWidget *parent) :
|
||||
|
||||
connect(ui->comp_UpdateInfo, &CUpdateInfoComponent::updateInfoAvailable, this, &CSwiftLauncher::updateInfoAvailable);
|
||||
connect(ui->comp_DBusSelector, &CDBusServerAddressSelector::editingFinished, this, &CSwiftLauncher::onDBusEditingFinished);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftLauncher::onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftLauncher::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
|
||||
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this, SLOT(showLogPage()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user