mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
429230ced1
commit
bef21ff5eb
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue