Skip to content
Permalink
Browse files

Fix qt4 build

  • Loading branch information
nyalldawson committed Sep 14, 2016
1 parent 31e1661 commit 392a9866955da1f5ff639a5572b1fc381b9f1064
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/qgscolorschemelist.cpp
@@ -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() )
{
@@ -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() )
@@ -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.
You can’t perform that action at this time.