Skip to content

Commit

Permalink
Fix qt4 build
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 14, 2016
1 parent 31e1661 commit 392a986
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/qgscolorschemelist.cpp
Expand Up @@ -761,6 +761,7 @@ bool QgsColorSwatchDelegate::editorEvent( QEvent *event, QAbstractItemModel *mod

QColor color = index.model()->data( index, Qt::DisplayRole ).value<QColor>();

#if QT_VERSION >= 0x050000
QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( qobject_cast< QWidget* >( parent() ) );
if ( panel && panel->dockMode() )
{
Expand All @@ -772,7 +773,7 @@ bool QgsColorSwatchDelegate::editorEvent( QEvent *event, QAbstractItemModel *mod
panel->openPanel( colorWidget );
return true;
}

#endif

QColor newColor = QgsColorDialog::getColor( color, mParent, tr( "Select color" ), true );
if ( !newColor.isValid() )
Expand All @@ -788,9 +789,11 @@ bool QgsColorSwatchDelegate::editorEvent( QEvent *event, QAbstractItemModel *mod

void QgsColorSwatchDelegate::colorChanged()
{
#if QT_VERSION >= 0x050000
if ( QgsCompoundColorWidget* colorWidget = qobject_cast< QgsCompoundColorWidget* >( sender() ) )
{
QModelIndex index = colorWidget->property( "index" ).toModelIndex();
const_cast< QAbstractItemModel* >( index.model() )->setData( index, colorWidget->color(), Qt::EditRole );
}
#endif
}

0 comments on commit 392a986

Please sign in to comment.