qt: split the ui window title string on non-win32

This commit is contained in:
ts-korhonen
2022-01-14 20:25:17 +02:00
parent 45f44a13b7
commit 5742ae4747

View File

@@ -87,7 +87,15 @@ MainWindow::MainWindow(QWidget *parent) :
connect(this, &MainWindow::setTitle, this, [this,toolbar_label](const QString& title) {
if (!hide_tool_bar)
#ifdef _WIN32
toolbar_label->setText(title);
#else
{
/* get the percentage and mouse message, TODO: refactor ui_window_title() */
auto parts = title.split(" - ");
toolbar_label->setText(QString("%1 - %2").arg(parts[1],parts.last()));
}
#endif
});
connect(this, &MainWindow::getTitleForNonQtThread, this, &MainWindow::getTitle_, Qt::BlockingQueuedConnection);