Don't use deprecated Qt features
This commit is contained in:
parent
0049d96bca
commit
f4d4ed3436
|
@ -58,7 +58,11 @@ void DownloadItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
progressBarOption.rect.setX(opt.rect.x() + opt.rect.height() + 4);
|
||||
progressBarOption.rect.setY(opt.rect.y() + opt.rect.height() / 2);
|
||||
} else {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
progressBarOption.rect.setX(opt.rect.x() + opt.fontMetrics.horizontalAdvance(opt.text) + 6);
|
||||
#else
|
||||
progressBarOption.rect.setX(opt.rect.x() + opt.fontMetrics.width(opt.text) + 6);
|
||||
#endif
|
||||
progressBarOption.rect.setWidth(progressBarOption.rect.width() - 18);
|
||||
}
|
||||
progressBarOption.textAlignment = Qt::AlignCenter;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "../../widgets/settings/settings.h"
|
||||
|
||||
#include <qtutilities/misc/dialogutils.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCursor>
|
||||
#include <QDesktopWidget>
|
||||
|
@ -50,7 +52,7 @@ void TrayMenu::showAtCursor()
|
|||
{
|
||||
resize(sizeHint());
|
||||
QPoint pos(QCursor::pos());
|
||||
moveInside(pos, size(), QApplication::desktop()->availableGeometry(pos));
|
||||
moveInside(pos, size(), Dialogs::availableScreenGeometryAtPoint(pos));
|
||||
popup(pos);
|
||||
}
|
||||
} // namespace QtGui
|
||||
|
|
Loading…
Reference in New Issue