mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
Get rid of deprecated typedefs (QStyleOptionViewItemV4 and co)
This commit is contained in:
@@ -64,7 +64,7 @@ PlaylistDelegate::PlaylistDelegate()
|
|||||||
void
|
void
|
||||||
PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, QModelIndex() );
|
initStyleOption( &opt, QModelIndex() );
|
||||||
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ AccountDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex
|
|||||||
if ( m_accountRowHeight < 0 )
|
if ( m_accountRowHeight < 0 )
|
||||||
{
|
{
|
||||||
// Haven't calculated normal item height yet, do it once and save it
|
// Haven't calculated normal item height yet, do it once and save it
|
||||||
QStyleOptionViewItemV4 opt( option );
|
QStyleOptionViewItem opt( option );
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
m_accountRowHeight = ACCOUNT_DELEGATE_ROW_HEIGHT_MULTIPLIER * opt.fontMetrics.height();
|
m_accountRowHeight = ACCOUNT_DELEGATE_ROW_HEIGHT_MULTIPLIER * opt.fontMetrics.height();
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ AccountDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex
|
|||||||
void
|
void
|
||||||
AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
|
|
||||||
// draw the background
|
// draw the background
|
||||||
@@ -139,7 +139,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
// draw checkbox first
|
// draw checkbox first
|
||||||
const int checkboxYPos = ( center ) - ( WRENCH_SIZE / 2 );
|
const int checkboxYPos = ( center ) - ( WRENCH_SIZE / 2 );
|
||||||
QRect checkRect = QRect( leftEdge, checkboxYPos, WRENCH_SIZE, WRENCH_SIZE );
|
QRect checkRect = QRect( leftEdge, checkboxYPos, WRENCH_SIZE, WRENCH_SIZE );
|
||||||
QStyleOptionViewItemV4 opt2 = opt;
|
QStyleOptionViewItem opt2 = opt;
|
||||||
opt2.rect = checkRect;
|
opt2.rect = checkRect;
|
||||||
|
|
||||||
if ( !m_loadingSpinners.contains( index ) )
|
if ( !m_loadingSpinners.contains( index ) )
|
||||||
@@ -392,7 +392,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItemV4& opt, const QList< Account* > accts, int rightEdge ) const
|
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItem& opt, const QList< Account* > accts, int rightEdge ) const
|
||||||
{
|
{
|
||||||
// list each account name, and show the online, offline icon
|
// list each account name, and show the online, offline icon
|
||||||
const int textHeight = painter->fontMetrics().height() + 1;
|
const int textHeight = painter->fontMetrics().height() + 1;
|
||||||
@@ -615,7 +615,7 @@ AccountDelegate::drawStatus( QPainter* painter, const QPointF& rightTopEdge, Acc
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const
|
AccountDelegate::drawCheckBox( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const
|
||||||
{
|
{
|
||||||
QStyle* style = w ? w->style() : QApplication::style();
|
QStyle* style = w ? w->style() : QApplication::style();
|
||||||
opt.checkState == Qt::Checked ? opt.state |= QStyle::State_On : opt.state |= QStyle::State_Off;
|
opt.checkState == Qt::Checked ? opt.state |= QStyle::State_On : opt.state |= QStyle::State_Off;
|
||||||
@@ -624,7 +624,7 @@ AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const Q
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& opt, QStyleOptionToolButton& topt ) const
|
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItem& opt, QStyleOptionToolButton& topt ) const
|
||||||
{
|
{
|
||||||
const QWidget* w = opt.widget;
|
const QWidget* w = opt.widget;
|
||||||
QStyle* style = w ? w->style() : QApplication::style();
|
QStyle* style = w ? w->style() : QApplication::style();
|
||||||
@@ -648,7 +648,7 @@ AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& o
|
|||||||
QRect
|
QRect
|
||||||
AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
|
AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, idx );
|
initStyleOption( &opt, idx );
|
||||||
|
|
||||||
// Top level item, return the corresponding rect
|
// Top level item, return the corresponding rect
|
||||||
@@ -661,7 +661,7 @@ AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QM
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
AccountDelegate::removeBtnWidth( QStyleOptionViewItemV4 opt ) const
|
AccountDelegate::removeBtnWidth( QStyleOptionViewItem opt ) const
|
||||||
{
|
{
|
||||||
const QString btnText = tr( "Remove" );
|
const QString btnText = tr( "Remove" );
|
||||||
QFont font = opt.font;
|
QFont font = opt.font;
|
||||||
@@ -674,7 +674,7 @@ void
|
|||||||
AccountDelegate::startInstalling( const QPersistentModelIndex& idx )
|
AccountDelegate::startInstalling( const QPersistentModelIndex& idx )
|
||||||
{
|
{
|
||||||
qDebug() << "START INSTALLING:" << idx.data( Qt::DisplayRole ).toString();
|
qDebug() << "START INSTALLING:" << idx.data( Qt::DisplayRole ).toString();
|
||||||
QStyleOptionViewItemV4 opt;
|
QStyleOptionViewItem opt;
|
||||||
initStyleOption( &opt, idx );
|
initStyleOption( &opt, idx );
|
||||||
|
|
||||||
AnimatedSpinner* anim = new AnimatedSpinner( checkRectForIndex( opt, idx ).size(), true );
|
AnimatedSpinner* anim = new AnimatedSpinner( checkRectForIndex( opt, idx ).size(), true );
|
||||||
|
@@ -71,14 +71,14 @@ private:
|
|||||||
void drawRoundedButton( QPainter* painter, const QRect& buttonRect, bool red = false ) const;
|
void drawRoundedButton( QPainter* painter, const QRect& buttonRect, bool red = false ) const;
|
||||||
// Returns new left edge
|
// Returns new left edge
|
||||||
int drawStatus( QPainter* painter, const QPointF& rightTopEdge, Account* acct, bool drawText = false ) const;
|
int drawStatus( QPainter* painter, const QPointF& rightTopEdge, Account* acct, bool drawText = false ) const;
|
||||||
void drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const;
|
void drawCheckBox( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const;
|
||||||
void drawConfigWrench( QPainter* painter, QStyleOptionViewItemV4& option, QStyleOptionToolButton& topt ) const;
|
void drawConfigWrench( QPainter* painter, QStyleOptionViewItem& option, QStyleOptionToolButton& topt ) const;
|
||||||
// returns new left edge
|
// returns new left edge
|
||||||
int drawAccountList( QPainter* painter, QStyleOptionViewItemV4& option, const QList< Account* > accounts, int rightEdge ) const;
|
int drawAccountList( QPainter* painter, QStyleOptionViewItem& option, const QList< Account* > accounts, int rightEdge ) const;
|
||||||
|
|
||||||
QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const;
|
QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const;
|
||||||
|
|
||||||
int removeBtnWidth( QStyleOptionViewItemV4 opt ) const;
|
int removeBtnWidth( QStyleOptionViewItem opt ) const;
|
||||||
|
|
||||||
int m_hoveringOver;
|
int m_hoveringOver;
|
||||||
QPersistentModelIndex m_hoveringItem, m_configPressed;
|
QPersistentModelIndex m_hoveringItem, m_configPressed;
|
||||||
|
@@ -44,7 +44,7 @@ AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent )
|
|||||||
void
|
void
|
||||||
AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
|
|
||||||
const int center = opt.rect.height() / 2 + opt.rect.top();
|
const int center = opt.rect.height() / 2 + opt.rect.top();
|
||||||
@@ -61,7 +61,7 @@ AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewIt
|
|||||||
// Checkbox on left edge, then text
|
// Checkbox on left edge, then text
|
||||||
const QRect checkRect( PADDING/4, PADDING/4 + opt.rect.top(), opt.rect.height() - PADDING/4, opt.rect.height() - PADDING/4 );
|
const QRect checkRect( PADDING/4, PADDING/4 + opt.rect.top(), opt.rect.height() - PADDING/4, opt.rect.height() - PADDING/4 );
|
||||||
m_cachedCheckRects[ index ] = checkRect;
|
m_cachedCheckRects[ index ] = checkRect;
|
||||||
QStyleOptionViewItemV4 opt2 = opt;
|
QStyleOptionViewItem opt2 = opt;
|
||||||
opt2.rect = checkRect;
|
opt2.rect = checkRect;
|
||||||
opt.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
opt.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
||||||
style->drawPrimitive( QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w );
|
style->drawPrimitive( QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w );
|
||||||
|
@@ -54,7 +54,7 @@ ACLJobDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
|||||||
if ( !item )
|
if ( !item )
|
||||||
return;
|
return;
|
||||||
//tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
//tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
QFontMetrics fm( opt.font );
|
QFontMetrics fm( opt.font );
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ JobStatusDelegate::~JobStatusDelegate()
|
|||||||
void
|
void
|
||||||
JobStatusDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
JobStatusDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
QFontMetrics fm( painter->font() );
|
QFontMetrics fm( painter->font() );
|
||||||
const bool allowMultiLine = index.data( JobStatusModel::AllowMultiLineRole ).toBool();
|
const bool allowMultiLine = index.data( JobStatusModel::AllowMultiLineRole ).toBool();
|
||||||
@@ -106,7 +106,7 @@ JobStatusDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelInd
|
|||||||
return QSize( QStyledItemDelegate::sizeHint( option, index ).width(), m_cachedMultiLineHeights[ index ] );
|
return QSize( QStyledItemDelegate::sizeHint( option, index ).width(), m_cachedMultiLineHeights[ index ] );
|
||||||
|
|
||||||
// Don't elide, but stretch across as many rows as required
|
// Don't elide, but stretch across as many rows as required
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
|
|
||||||
const QString text = index.data( Qt::DisplayRole ).toString();
|
const QString text = index.data( Qt::DisplayRole ).toString();
|
||||||
|
@@ -108,7 +108,7 @@ ColumnItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option
|
|||||||
QColor textColor = TomahawkUtils::alphaBlend( option.palette.color( QPalette::Foreground ), option.palette.color( QPalette::Background ), opacity );
|
QColor textColor = TomahawkUtils::alphaBlend( option.palette.color( QPalette::Foreground ), option.palette.color( QPalette::Background ), opacity );
|
||||||
|
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 o = option;
|
QStyleOptionViewItem o = option;
|
||||||
initStyleOption( &o, QModelIndex() );
|
initStyleOption( &o, QModelIndex() );
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
@@ -190,7 +190,7 @@ ColumnItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option
|
|||||||
if ( text.trimmed().isEmpty() )
|
if ( text.trimmed().isEmpty() )
|
||||||
text = tr( "Unknown" );
|
text = tr( "Unknown" );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, QModelIndex() );
|
initStyleOption( &opt, QModelIndex() );
|
||||||
|
|
||||||
const QModelIndex curIndex = m_view->currentIndex();
|
const QModelIndex curIndex = m_view->currentIndex();
|
||||||
|
@@ -129,7 +129,7 @@ GridItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
if ( !item || !index.isValid() )
|
if ( !item || !index.isValid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, QModelIndex() );
|
initStyleOption( &opt, QModelIndex() );
|
||||||
// qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
// qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||||
|
|
||||||
|
@@ -106,7 +106,7 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlaylistItemDelegate::prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, PlayableItem* item ) const
|
PlaylistItemDelegate::prepareStyleOption( QStyleOptionViewItem* option, const QModelIndex& index, PlayableItem* item ) const
|
||||||
{
|
{
|
||||||
initStyleOption( option, index );
|
initStyleOption( option, index );
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ PlaylistItemDelegate::paintDetailed( QPainter* painter, const QStyleOptionViewIt
|
|||||||
QTextOption textOption( Qt::AlignVCenter | (Qt::Alignment)index.data( Qt::TextAlignmentRole ).toUInt() );
|
QTextOption textOption( Qt::AlignVCenter | (Qt::Alignment)index.data( Qt::TextAlignmentRole ).toUInt() );
|
||||||
textOption.setWrapMode( QTextOption::NoWrap );
|
textOption.setWrapMode( QTextOption::NoWrap );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
prepareStyleOption( &opt, index, item );
|
prepareStyleOption( &opt, index, item );
|
||||||
opt.text.clear();
|
opt.text.clear();
|
||||||
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||||
|
@@ -59,7 +59,7 @@ private slots:
|
|||||||
void doUpdateIndex( const QPersistentModelIndex& index );
|
void doUpdateIndex( const QPersistentModelIndex& index );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, PlayableItem* item ) const;
|
void prepareStyleOption( QStyleOptionViewItem* option, const QModelIndex& index, PlayableItem* item ) const;
|
||||||
|
|
||||||
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||||
QWidget* createEditor( QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
QWidget* createEditor( QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||||
|
@@ -93,7 +93,7 @@ TrackItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
PlayableItem* item = m_model->itemFromIndex( m_model->mapToSource( index ) );
|
PlayableItem* item = m_model->itemFromIndex( m_model->mapToSource( index ) );
|
||||||
Q_ASSERT( item );
|
Q_ASSERT( item );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
prepareStyleOption( &opt, index, item );
|
prepareStyleOption( &opt, index, item );
|
||||||
|
|
||||||
if ( item->source() )
|
if ( item->source() )
|
||||||
|
@@ -286,7 +286,7 @@ DynamicView::backgroundBetween( QRect rect, int rowStart )
|
|||||||
QPixmap bg = QPixmap( rect.size() );
|
QPixmap bg = QPixmap( rect.size() );
|
||||||
bg.fill( Qt::white );
|
bg.fill( Qt::white );
|
||||||
QPainter p( &bg );
|
QPainter p( &bg );
|
||||||
QStyleOptionViewItemV4 opt = viewOptions();
|
QStyleOptionViewItem opt = viewOptions();
|
||||||
// code taken from QTreeViewPrivate::paintAlternatingRowColors
|
// code taken from QTreeViewPrivate::paintAlternatingRowColors
|
||||||
m_fadebg = !style()->styleHint( QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea, &opt );
|
m_fadebg = !style()->styleHint( QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea, &opt );
|
||||||
// qDebug() << "PAINTING ALTERNATING ROW BG!: " << fadingRectViewport;
|
// qDebug() << "PAINTING ALTERNATING ROW BG!: " << fadingRectViewport;
|
||||||
@@ -299,9 +299,9 @@ DynamicView::backgroundBetween( QRect rect, int rowStart )
|
|||||||
// qDebug() << "PAINTING BG ROW IN RECT" << y << "to" << y + rowHeight << ":" << opt.rect;
|
// qDebug() << "PAINTING BG ROW IN RECT" << y << "to" << y + rowHeight << ":" << opt.rect;
|
||||||
if ( current & 1 )
|
if ( current & 1 )
|
||||||
{
|
{
|
||||||
opt.features |= QStyleOptionViewItemV2::Alternate;
|
opt.features |= QStyleOptionViewItem::Alternate;
|
||||||
} else {
|
} else {
|
||||||
opt.features &= ~QStyleOptionViewItemV2::Alternate;
|
opt.features &= ~QStyleOptionViewItem::Alternate;
|
||||||
}
|
}
|
||||||
++current;
|
++current;
|
||||||
style()->drawPrimitive( QStyle::PE_PanelItemViewRow, &opt, &p );
|
style()->drawPrimitive( QStyle::PE_PanelItemViewRow, &opt, &p );
|
||||||
|
@@ -781,7 +781,7 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, PlayableItem* item )
|
prepareStyleOption( QStyleOptionViewItem* option, const QModelIndex& index, PlayableItem* item )
|
||||||
{
|
{
|
||||||
Q_UNUSED( index );
|
Q_UNUSED( index );
|
||||||
|
|
||||||
|
@@ -69,7 +69,7 @@ namespace TomahawkUtils
|
|||||||
DLLEXPORT void setSystemFont( QFont font );
|
DLLEXPORT void setSystemFont( QFont font );
|
||||||
DLLEXPORT QFont systemFont();
|
DLLEXPORT QFont systemFont();
|
||||||
|
|
||||||
DLLEXPORT void prepareStyleOption( QStyleOptionViewItemV4* option, const QModelIndex& index, PlayableItem* item );
|
DLLEXPORT void prepareStyleOption( QStyleOptionViewItem* option, const QModelIndex& index, PlayableItem* item );
|
||||||
|
|
||||||
DLLEXPORT void drawRoundedButton( QPainter* painter, const QRect& btnRect, const QColor& color, const QColor &gradient1bottom = QColor(), const QColor& gradient2top = QColor(), const QColor& gradient2bottom = QColor() );
|
DLLEXPORT void drawRoundedButton( QPainter* painter, const QRect& btnRect, const QColor& color, const QColor &gradient1bottom = QColor(), const QColor& gradient2top = QColor(), const QColor& gradient2bottom = QColor() );
|
||||||
|
|
||||||
|
@@ -171,7 +171,7 @@ void LineEdit::updateTextMargins()
|
|||||||
|
|
||||||
void LineEdit::updateSideWidgetLocations()
|
void LineEdit::updateSideWidgetLocations()
|
||||||
{
|
{
|
||||||
QStyleOptionFrameV2 opt;
|
QStyleOptionFrame opt;
|
||||||
initStyleOption(&opt);
|
initStyleOption(&opt);
|
||||||
QRect textRect = style()->subElementRect(QStyle::SE_LineEditContents, &opt, this);
|
QRect textRect = style()->subElementRect(QStyle::SE_LineEditContents, &opt, this);
|
||||||
int spacing = m_rightLayout->spacing();
|
int spacing = m_rightLayout->spacing();
|
||||||
@@ -214,7 +214,7 @@ void LineEdit::paintEvent(QPaintEvent *event)
|
|||||||
{
|
{
|
||||||
QLineEdit::paintEvent(event);
|
QLineEdit::paintEvent(event);
|
||||||
if (text().isEmpty() && !m_inactiveText.isEmpty() && !hasFocus()) {
|
if (text().isEmpty() && !m_inactiveText.isEmpty() && !hasFocus()) {
|
||||||
QStyleOptionFrameV2 panel;
|
QStyleOptionFrame panel;
|
||||||
initStyleOption(&panel);
|
initStyleOption(&panel);
|
||||||
QRect textRect = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
|
QRect textRect = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
|
||||||
int horizontalMargin = 2;
|
int horizontalMargin = 2;
|
||||||
|
@@ -39,7 +39,7 @@ ResolverConfigDelegate::ResolverConfigDelegate( QObject* parent )
|
|||||||
void
|
void
|
||||||
ResolverConfigDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
ResolverConfigDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
QRect itemRect = opt.rect;
|
QRect itemRect = opt.rect;
|
||||||
int top = itemRect.top();
|
int top = itemRect.top();
|
||||||
@@ -124,7 +124,7 @@ ResolverConfigDelegate::paint( QPainter* painter, const QStyleOptionViewItem& op
|
|||||||
QRect
|
QRect
|
||||||
ResolverConfigDelegate::configRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
|
ResolverConfigDelegate::configRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
|
||||||
{
|
{
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, idx );
|
initStyleOption( &opt, idx );
|
||||||
QRect itemRect = opt.rect;
|
QRect itemRect = opt.rect;
|
||||||
int top = itemRect.top();
|
int top = itemRect.top();
|
||||||
@@ -138,7 +138,7 @@ ResolverConfigDelegate::checkRectForIndex( const QStyleOptionViewItem &option, c
|
|||||||
{
|
{
|
||||||
Q_UNUSED( role );
|
Q_UNUSED( role );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, idx );
|
initStyleOption( &opt, idx );
|
||||||
QRect itemRect = opt.rect;
|
QRect itemRect = opt.rect;
|
||||||
int top = itemRect.top();
|
int top = itemRect.top();
|
||||||
|
@@ -108,7 +108,7 @@ SourceDelegate::paintStandardItem( QPainter* painter, const QStyleOptionViewItem
|
|||||||
type == SourcesModel::Station ||
|
type == SourcesModel::Station ||
|
||||||
type == SourcesModel::TemporaryPage );
|
type == SourcesModel::TemporaryPage );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt, index );
|
initStyleOption( &opt, index );
|
||||||
opt.showDecorationSelected = false;
|
opt.showDecorationSelected = false;
|
||||||
|
|
||||||
@@ -450,8 +450,8 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
|||||||
if ( option.rect.height() == 0 )
|
if ( option.rect.height() == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QStyleOptionViewItemV4 optIndentation = option;
|
QStyleOptionViewItem optIndentation = option;
|
||||||
QStyleOptionViewItemV4 opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setRenderHint( QPainter::TextAntialiasing );
|
painter->setRenderHint( QPainter::TextAntialiasing );
|
||||||
@@ -673,7 +673,7 @@ SourceDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QSt
|
|||||||
SourceTreeItem* gpi = index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >();
|
SourceTreeItem* gpi = index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >();
|
||||||
Q_ASSERT( gpi );
|
Q_ASSERT( gpi );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 o = option;
|
QStyleOptionViewItem o = option;
|
||||||
initStyleOption( &o, index );
|
initStyleOption( &o, index );
|
||||||
const int padding = m_margin / 8;
|
const int padding = m_margin / 8;
|
||||||
const QRect r( o.rect.right() - padding - m_iconHeight, padding + o.rect.y(), m_iconHeight, m_iconHeight );
|
const QRect r( o.rect.right() - padding - m_iconHeight, padding + o.rect.y(), m_iconHeight, m_iconHeight );
|
||||||
|
@@ -951,7 +951,7 @@ SourceTreeView::paintEvent( QPaintEvent* event )
|
|||||||
QPainter painter( viewport() );
|
QPainter painter( viewport() );
|
||||||
const QRect itemRect = visualRect( m_dropIndex );
|
const QRect itemRect = visualRect( m_dropIndex );
|
||||||
|
|
||||||
QStyleOptionViewItemV4 opt;
|
QStyleOptionViewItem opt;
|
||||||
opt.initFrom( this );
|
opt.initFrom( this );
|
||||||
opt.rect = itemRect;
|
opt.rect = itemRect;
|
||||||
opt.state = QStyle::State_Enabled | QStyle::State_Selected;
|
opt.state = QStyle::State_Enabled | QStyle::State_Selected;
|
||||||
|
Reference in New Issue
Block a user