Skip to content

Commit 392a986

Browse files
committed
Fix qt4 build
1 parent 31e1661 commit 392a986

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gui/qgscolorschemelist.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ bool QgsColorSwatchDelegate::editorEvent( QEvent *event, QAbstractItemModel *mod
761761

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

764+
#if QT_VERSION >= 0x050000
764765
QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( qobject_cast< QWidget* >( parent() ) );
765766
if ( panel && panel->dockMode() )
766767
{
@@ -772,7 +773,7 @@ bool QgsColorSwatchDelegate::editorEvent( QEvent *event, QAbstractItemModel *mod
772773
panel->openPanel( colorWidget );
773774
return true;
774775
}
775-
776+
#endif
776777

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

789790
void QgsColorSwatchDelegate::colorChanged()
790791
{
792+
#if QT_VERSION >= 0x050000
791793
if ( QgsCompoundColorWidget* colorWidget = qobject_cast< QgsCompoundColorWidget* >( sender() ) )
792794
{
793795
QModelIndex index = colorWidget->property( "index" ).toModelIndex();
794796
const_cast< QAbstractItemModel* >( index.model() )->setData( index, colorWidget->color(), Qt::EditRole );
795797
}
798+
#endif
796799
}

0 commit comments

Comments
 (0)