Skip to content

Commit

Permalink
Fix compilation errors and warnings with recent Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
Koromix committed Aug 3, 2020
1 parent 69ad806 commit b2b10d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/tycommander/about_dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/tycommander/arduino_dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/tycommander/log_dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/tycommander/main_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void MainWindow::selectNextBoard()
return;

auto indexes = boardList->selectionModel()->selectedIndexes();
qSort(indexes);
std::sort(indexes);

QModelIndex new_index;
if (indexes.isEmpty()) {
Expand Down Expand Up @@ -345,7 +345,7 @@ void MainWindow::selectPreviousBoard()
return;

auto indexes = boardList->selectionModel()->selectedIndexes();
qSort(indexes);
std::sort(indexes);

QModelIndex new_index;
if (indexes.isEmpty()) {
Expand Down Expand Up @@ -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));
Expand Down
7 changes: 4 additions & 3 deletions src/tycommander/selector_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Board *>();
return board->secondary() ? 0 : QIdentityProxyModel::flags(index);
return board->secondary() ? Qt::ItemFlags() : QIdentityProxyModel::flags(index);
}

QSize SelectorDialogItemDelegate::sizeHint(const QStyleOptionViewItem &option,
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit b2b10d1

Please sign in to comment.