From bef21ff5eb761a64547e99c0ae0c66304891c6c5 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 17 Jan 2024 22:47:40 +0100 Subject: [PATCH] code consistency: replace qMin/qMax by std::min/std::max We use the latter pretty consistently, so let's remove the few left instances of the former. Signed-off-by: Berthold Stoeger --- desktop-widgets/locationinformation.cpp | 6 +++--- desktop-widgets/modeldelegates.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 53f0e6d94..d2ece3f17 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -632,7 +632,7 @@ void DiveLocationLineEdit::fixPopupPosition() const int maxVisibleItems = 5; QPoint pos; int rh, w; - int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3; + int h = (view->sizeHintForRow(0) * std::min(maxVisibleItems, view->model()->rowCount()) + 3) + 3; QScrollBar *hsb = view->horizontalScrollBar(); if (hsb && hsb->isVisible()) h += view->horizontalScrollBar()->sizeHint().height(); @@ -650,9 +650,9 @@ void DiveLocationLineEdit::fixPopupPosition() int top = pos.y() - rh - screen.top() + 2; int bottom = screen.bottom() - pos.y(); - h = qMax(h, view->minimumHeight()); + h = std::max(h, view->minimumHeight()); if (h > bottom) { - h = qMin(qMax(top, bottom), h); + h = std::min(std::max(top, bottom), h); if (top > bottom) pos.setY(pos.y() - h - rh + 2); } diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index 070f7d7ab..30936425e 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -35,7 +35,7 @@ QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { const QFontMetrics metrics(qApp->font()); - return QSize(50, qMax(22, metrics.height())); + return QSize(50, std::max(22, metrics.height())); } // Gets the index of the model in the currentRow and column.