Style change signals used Qt::QueuedConnection

This commit is contained in:
Klaus Basan
2018-07-31 01:02:16 +02:00
parent d9f0066ec4
commit 4ca6bb11aa
16 changed files with 29 additions and 27 deletions

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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();

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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();

View File

@@ -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

View File

@@ -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);

View File

@@ -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()));