refactored setTitle to just be a normal AutoConnection signal
This commit is contained in:
@@ -63,7 +63,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
connect(this, &MainWindow::showMessageForNonQtThread, this, &MainWindow::showMessage_, Qt::BlockingQueuedConnection);
|
||||
|
||||
connect(this, &MainWindow::setTitleForNonQtThread, this, &MainWindow::setTitle_, Qt::BlockingQueuedConnection);
|
||||
connect(this, &MainWindow::setTitle, this, [this](const QString& title) {
|
||||
setWindowTitle(title);
|
||||
});
|
||||
connect(this, &MainWindow::getTitleForNonQtThread, this, &MainWindow::getTitle_, Qt::BlockingQueuedConnection);
|
||||
|
||||
connect(this, &MainWindow::updateMenuResizeOptions, [this]() {
|
||||
@@ -873,20 +875,6 @@ void MainWindow::on_actionFullscreen_triggered() {
|
||||
rc->onResize(widget->width(), widget->height());
|
||||
}
|
||||
|
||||
void MainWindow::setTitle_(const wchar_t *title)
|
||||
{
|
||||
this->setWindowTitle(QString::fromWCharArray(title));
|
||||
}
|
||||
|
||||
void MainWindow::setTitle(const wchar_t *title)
|
||||
{
|
||||
if (QThread::currentThread() == this->thread()) {
|
||||
setTitle_(title);
|
||||
} else {
|
||||
emit setTitleForNonQtThread(title);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::getTitle_(wchar_t *title)
|
||||
{
|
||||
this->windowTitle().toWCharArray(title);
|
||||
|
||||
Reference in New Issue
Block a user