diff --git a/src/tycommander/about_dialog.hpp b/src/tycommander/about_dialog.hpp index 3ab2bebe..7471a885 100644 --- a/src/tycommander/about_dialog.hpp +++ b/src/tycommander/about_dialog.hpp @@ -18,7 +18,7 @@ class AboutDialog: public QDialog, private Ui::AboutDialog { Q_OBJECT public: - AboutDialog(QWidget *parent = nullptr, Qt::WindowFlags f = 0); + AboutDialog(QWidget *parent = nullptr, Qt::WindowFlags f = {}); public slots: static void openWebsite(); diff --git a/src/tycommander/arduino_dialog.hpp b/src/tycommander/arduino_dialog.hpp index ee226bc2..230b20cf 100644 --- a/src/tycommander/arduino_dialog.hpp +++ b/src/tycommander/arduino_dialog.hpp @@ -21,7 +21,7 @@ class ArduinoDialog: public QDialog, private Ui::ArduinoDialog { bool background_process_ = false; public: - ArduinoDialog(QWidget *parent = nullptr, Qt::WindowFlags f = 0); + ArduinoDialog(QWidget *parent = nullptr, Qt::WindowFlags f = {}); void keyPressEvent(QKeyEvent *ev) override; diff --git a/src/tycommander/log_dialog.hpp b/src/tycommander/log_dialog.hpp index 9a175a92..ffa3842e 100644 --- a/src/tycommander/log_dialog.hpp +++ b/src/tycommander/log_dialog.hpp @@ -17,7 +17,7 @@ class LogDialog: public QDialog, private Ui::LogDialog { Q_OBJECT public: - LogDialog(QWidget *parent = nullptr, Qt::WindowFlags f = 0); + LogDialog(QWidget *parent = nullptr, Qt::WindowFlags f = {}); public slots: void appendError(const QString &msg, const QString &ctx); diff --git a/src/tycommander/main_window.cc b/src/tycommander/main_window.cc index 5c57772f..55e70e6b 100644 --- a/src/tycommander/main_window.cc +++ b/src/tycommander/main_window.cc @@ -314,7 +314,7 @@ void MainWindow::selectNextBoard() return; auto indexes = boardList->selectionModel()->selectedIndexes(); - qSort(indexes); + std::sort(indexes); QModelIndex new_index; if (indexes.isEmpty()) { @@ -345,7 +345,7 @@ void MainWindow::selectPreviousBoard() return; auto indexes = boardList->selectionModel()->selectedIndexes(); - qSort(indexes); + std::sort(indexes); QModelIndex new_index; if (indexes.isEmpty()) { @@ -863,7 +863,7 @@ void MainWindow::selectionChanged(const QItemSelection &newsel, const QItemSelec current_board_ = nullptr; auto indexes = boardList->selectionModel()->selectedIndexes(); - qSort(indexes); + std::sort(indexes); for (auto &idx: indexes) { if (idx.column() == 0) selected_boards_.push_back(Monitor::boardFromModel(monitor_, idx)); diff --git a/src/tycommander/selector_dialog.cc b/src/tycommander/selector_dialog.cc index 52231e30..edb8e506 100644 --- a/src/tycommander/selector_dialog.cc +++ b/src/tycommander/selector_dialog.cc @@ -70,7 +70,7 @@ QVariant SelectorDialogModel::data(const QModelIndex &index, int role) const Qt::ItemFlags SelectorDialogModel::flags(const QModelIndex &index) const { auto board = QIdentityProxyModel::data(index, Monitor::ROLE_BOARD).value(); - return board->secondary() ? 0 : QIdentityProxyModel::flags(index); + return board->secondary() ? Qt::ItemFlags() : QIdentityProxyModel::flags(index); } QSize SelectorDialogItemDelegate::sizeHint(const QStyleOptionViewItem &option, @@ -124,9 +124,10 @@ void SelectorDialog::setAction(const QString &action) void SelectorDialog::updateSelection() { - selected_boards_.clear(); auto indexes = tree->selectionModel()->selectedIndexes(); - qSort(indexes); + std::sort(indexes); + + selected_boards_.clear(); for (auto &idx: indexes) { if (idx.column() == 0) selected_boards_.push_back(Monitor::boardFromModel(monitor_model_, idx));