Replace obsolete QStyleOptionViewItemV2-4
This commit is contained in:
parent
db5679bbe9
commit
246f82bfad
|
@ -81,7 +81,7 @@ void DeviceItemDelegate::paint(QPainter *p, const QStyleOptionViewItem &opt, con
|
|||
}
|
||||
|
||||
// Draw the background
|
||||
const QStyleOptionViewItemV3 *vopt = qstyleoption_cast<const QStyleOptionViewItemV3*>(&opt);
|
||||
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem*>(&opt);
|
||||
const QWidget *widget = vopt->widget;
|
||||
QStyle *style = widget->style() ? widget->style() : QApplication::style();
|
||||
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, p, widget);
|
||||
|
|
|
@ -218,7 +218,7 @@ void PlaylistDelegateBase::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
|
||||
}
|
||||
|
||||
QStyleOptionViewItemV4 PlaylistDelegateBase::Adjusted(const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||
QStyleOptionViewItem PlaylistDelegateBase::Adjusted(const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||
|
||||
if (!view_) return option;
|
||||
|
||||
|
@ -227,7 +227,7 @@ QStyleOptionViewItemV4 PlaylistDelegateBase::Adjusted(const QStyleOptionViewItem
|
|||
if (view_->header()->logicalIndexAt(top_left) != index.column())
|
||||
return option;
|
||||
|
||||
QStyleOptionViewItemV4 ret(option);
|
||||
QStyleOptionViewItem ret(option);
|
||||
|
||||
if (index.data(Playlist::Role_IsCurrent).toBool()) {
|
||||
// Move the text in a bit on the first column for the song that's currently playing
|
||||
|
|
|
@ -84,7 +84,7 @@ class PlaylistDelegateBase : public QueuedItemDelegate {
|
|||
QString displayText(const QVariant &value, const QLocale &locale) const;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
QStyleOptionViewItemV4 Adjusted(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
QStyleOptionViewItem Adjusted(const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
|
||||
static const int kMinHeight;
|
||||
|
||||
|
|
|
@ -382,7 +382,7 @@ void PlaylistView::drawTree(QPainter *painter, const QRegion ®ion) const {
|
|||
|
||||
void PlaylistView::drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||
|
||||
QStyleOptionViewItemV4 opt(option);
|
||||
QStyleOptionViewItem opt(option);
|
||||
|
||||
bool is_current = index.data(Playlist::Role_IsCurrent).toBool();
|
||||
bool is_paused = index.data(Playlist::Role_IsPaused).toBool();
|
||||
|
@ -452,7 +452,7 @@ void PlaylistView::drawRow(QPainter *painter, const QStyleOptionViewItem &option
|
|||
|
||||
}
|
||||
|
||||
void PlaylistView::UpdateCachedCurrentRowPixmap(QStyleOptionViewItemV4 option, const QModelIndex &index) {
|
||||
void PlaylistView::UpdateCachedCurrentRowPixmap(QStyleOptionViewItem option, const QModelIndex &index) {
|
||||
|
||||
cached_current_row_rect_ = option.rect;
|
||||
cached_current_row_row_ = index.row();
|
||||
|
|
|
@ -189,7 +189,7 @@ class PlaylistView : public QTreeView {
|
|||
private:
|
||||
void ReloadBarPixmaps();
|
||||
QList<QPixmap> LoadBarPixmap(const QString &filename);
|
||||
void UpdateCachedCurrentRowPixmap(QStyleOptionViewItemV4 option, const QModelIndex &index);
|
||||
void UpdateCachedCurrentRowPixmap(QStyleOptionViewItem option, const QModelIndex &index);
|
||||
|
||||
void set_background_image_type(BackgroundImageType bg) {
|
||||
background_image_type_ = bg;
|
||||
|
|
|
@ -233,9 +233,9 @@ QModelIndex GroupedIconView::indexAt(const QPoint &p) const {
|
|||
void GroupedIconView::paintEvent(QPaintEvent *e) {
|
||||
// This code was adapted from QListView::paintEvent(), changed to use the visualRect() of items, and to draw headers.
|
||||
|
||||
QStyleOptionViewItemV4 option(viewOptions());
|
||||
QStyleOptionViewItem option(viewOptions());
|
||||
if (isWrapping())
|
||||
option.features = QStyleOptionViewItemV2::WrapText;
|
||||
option.features = QStyleOptionViewItem::WrapText;
|
||||
option.locale = locale();
|
||||
option.locale.setNumberOptions(QLocale::OmitGroupSeparator);
|
||||
option.widget = this;
|
||||
|
|
Loading…
Reference in New Issue