GUI: Replace deprecated Qt calls + fix warnings

Since QTextEdit::setTabStopDistance() is available starting 5.10 and we
still support Qt 5.5 (Ubuntu 16), it's moved to log_window.cpp and
ifdefed according to version
This commit is contained in:
Martin Piatka
2021-02-15 13:15:06 +01:00
parent e53a84c25f
commit cfadea4c65
5 changed files with 10 additions and 5 deletions

View File

@@ -247,6 +247,7 @@ Settings::Settings() : dummy(this){
if(!i.parent[0])
opt.addOnChangeCallback(test_callback);
#endif
(void) opt; //suppress unused warning
}
for(const auto &i : optionCallbacks){

View File

@@ -10,7 +10,7 @@ SpinBoxUi::SpinBoxUi(QSpinBox *spinbox, Settings *settings, const std::string &o
}
void SpinBoxUi::connectSignals(){
connect(spinbox, Overload<const QString &>::of(&QSpinBox::valueChanged),
connect(spinbox, &QSpinBox::textChanged,
this, &SpinBoxUi::textEdited);
}

View File

@@ -91,9 +91,6 @@
<family>Monospace</family>
</font>
</property>
<property name="tabStopWidth">
<number>40</number>
</property>
<property name="placeholderText">
<string/>
</property>

View File

@@ -2,6 +2,7 @@
#include <QFileDialog>
#include <QFile>
#include <QTextStream>
#include <QtGlobal>
#include "log_window.hpp"
LogWindow::LogWindow(QWidget *parent): QDialog(parent){
@@ -11,6 +12,12 @@ LogWindow::LogWindow(QWidget *parent): QDialog(parent){
| Qt::WindowMinimizeButtonHint
| Qt::WindowCloseButtonHint);
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
ui.terminal->setTabStopWidth(40);
#else
ui.terminal->setTabStopDistance(40);
#endif
connect(ui.copyBtn, SIGNAL(clicked()), this, SLOT(copyToClipboard()));
connect(ui.saveBtn, SIGNAL(clicked()), this, SLOT(saveToFile()));
}

View File

@@ -380,7 +380,7 @@ void UltragridWindow::processFinished(int code, QProcess::ExitStatus status){
msgBox.setText("Ultragrid has exited with an error! If you need help, please send an email "
"to ultragrid-dev@cesnet.cz with log attached.");
QPushButton *showLogBtn = msgBox.addButton(tr("Show log"), QMessageBox::ActionRole);
QPushButton *dissmissBtn = msgBox.addButton(tr("Dismiss"), QMessageBox::RejectRole);
msgBox.addButton(tr("Dismiss"), QMessageBox::RejectRole);
msgBox.exec();
if(msgBox.clickedButton() == showLogBtn){