mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
Replace deprecated classes
This commit is contained in:
parent
ab187f06da
commit
ce3c53b3c4
5 changed files with 14 additions and 14 deletions
|
@ -32,8 +32,8 @@
|
|||
#define PREVIEWLISTDELEGATE_H
|
||||
|
||||
#include <QItemDelegate>
|
||||
#include <QStyleOptionProgressBarV2>
|
||||
#include <QStyleOptionViewItemV2>
|
||||
#include <QStyleOptionProgressBar>
|
||||
#include <QStyleOptionViewItem>
|
||||
#include <QModelIndex>
|
||||
#include <QPainter>
|
||||
#include <QApplication>
|
||||
|
@ -59,7 +59,7 @@ class PreviewListDelegate: public QItemDelegate {
|
|||
|
||||
void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const {
|
||||
painter->save();
|
||||
QStyleOptionViewItemV2 opt = QItemDelegate::setOptions(index, option);
|
||||
QStyleOptionViewItem opt = QItemDelegate::setOptions(index, option);
|
||||
|
||||
switch(index.column()) {
|
||||
case PreviewSelect::SIZE:
|
||||
|
@ -67,7 +67,7 @@ class PreviewListDelegate: public QItemDelegate {
|
|||
QItemDelegate::drawDisplay(painter, opt, option.rect, Utils::Misc::friendlyUnit(index.data().toLongLong()));
|
||||
break;
|
||||
case PreviewSelect::PROGRESS:{
|
||||
QStyleOptionProgressBarV2 newopt;
|
||||
QStyleOptionProgressBar newopt;
|
||||
qreal progress = index.data().toDouble()*100.;
|
||||
newopt.rect = opt.rect;
|
||||
newopt.text = ((progress == 100.0) ? QString("100%") : Utils::String::fromDouble(progress, 1) + "%");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue