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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-01-17 22:47:40 +01:00 committed by Dirk Hohndel
parent 429230ced1
commit bef21ff5eb
2 changed files with 4 additions and 4 deletions

View file

@ -632,7 +632,7 @@ void DiveLocationLineEdit::fixPopupPosition()
const int maxVisibleItems = 5; const int maxVisibleItems = 5;
QPoint pos; QPoint pos;
int rh, w; 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(); QScrollBar *hsb = view->horizontalScrollBar();
if (hsb && hsb->isVisible()) if (hsb && hsb->isVisible())
h += view->horizontalScrollBar()->sizeHint().height(); h += view->horizontalScrollBar()->sizeHint().height();
@ -650,9 +650,9 @@ void DiveLocationLineEdit::fixPopupPosition()
int top = pos.y() - rh - screen.top() + 2; int top = pos.y() - rh - screen.top() + 2;
int bottom = screen.bottom() - pos.y(); int bottom = screen.bottom() - pos.y();
h = qMax(h, view->minimumHeight()); h = std::max(h, view->minimumHeight());
if (h > bottom) { if (h > bottom) {
h = qMin(qMax(top, bottom), h); h = std::min(std::max(top, bottom), h);
if (top > bottom) if (top > bottom)
pos.setY(pos.y() - h - rh + 2); pos.setY(pos.y() - h - rh + 2);
} }

View file

@ -35,7 +35,7 @@
QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const
{ {
const QFontMetrics metrics(qApp->font()); 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. // Gets the index of the model in the currentRow and column.