Skip to content
Permalink
Browse files

Removed Qt4.5 dependency ;-)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12250 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 25, 2009
1 parent 07f142b commit fdebf3ed4ad9722c0b6803fe9108bbfa6ab68314
Showing with 64 additions and 60 deletions.
  1. +64 −60 src/app/composer/qgscomposerarrowwidget.cpp
@@ -38,84 +38,88 @@ QgsComposerArrowWidget::~QgsComposerArrowWidget()

void QgsComposerArrowWidget::on_mOutlineWidthSpinBox_valueChanged( double d )
{
if ( !mArrow )
{
return;
}
if(!mArrow)
{
return;
}

mArrow->setOutlineWidth( d );
mArrow->update();
mArrow->setOutlineWidth( d );
mArrow->update();
}

void QgsComposerArrowWidget::on_mArrowHeadWidthSpinBox_valueChanged( double d )
{
if ( !mArrow )
{
return;
}
if(!mArrow)
{
return;
}

mArrow->setArrowHeadWidth( d );
mArrow->update();
mArrow->setArrowHeadWidth( d );
mArrow->update();
}

void QgsComposerArrowWidget::on_mShowArrowHeadCheckBox_stateChanged( int state )
void QgsComposerArrowWidget::on_mShowArrowHeadCheckBox_stateChanged ( int state )
{
if ( !mArrow )
{
return;
}

if ( state == Qt::Checked )
{
mArrow->setShowArrowMarker( true );
}
else
{
mArrow->setShowArrowMarker( false );
}
mArrow->update();
if(!mArrow)
{
return;
}

if(state == Qt::Checked)
{
mArrow->setShowArrowMarker(true);
}
else
{
mArrow->setShowArrowMarker(false);
}
mArrow->update();
}

void QgsComposerArrowWidget::on_mArrowColorButton_clicked()
{
if ( !mArrow )
{
return;
}

QColor newColor = QColorDialog::getColor( mArrow->arrowColor(), 0, tr( "Arrow color" ), QColorDialog::ShowAlphaChannel );
if ( newColor.isValid() )
{
mArrow->setArrowColor( newColor );
mArrow->update();
}
if(!mArrow)
{
return;
}

#if QT_VERSION >= 0x040500
QColor newColor = QColorDialog::getColor(mArrow->arrowColor(), 0, tr("Arrow color"), QColorDialog::ShowAlphaChannel);
#else
QColor newColor = QColorDialog::getColor(mArrow->arrowColor());
#endif
if(newColor.isValid())
{
mArrow->setArrowColor(newColor);
mArrow->update();
}
}

void QgsComposerArrowWidget::blockAllSignals( bool block )
void QgsComposerArrowWidget::blockAllSignals(bool block)
{
mArrowColorButton->blockSignals( block );
mShowArrowHeadCheckBox->blockSignals( block );
mOutlineWidthSpinBox->blockSignals( block );
mArrowHeadWidthSpinBox->blockSignals( block );
mArrowColorButton->blockSignals(block);
mShowArrowHeadCheckBox->blockSignals(block);
mOutlineWidthSpinBox->blockSignals(block);
mArrowHeadWidthSpinBox->blockSignals(block);
}

void QgsComposerArrowWidget::setGuiElementValues()
{
if ( !mArrow )
{
return;
}

blockAllSignals( true );
mOutlineWidthSpinBox->setValue( mArrow->outlineWidth() );
mArrowHeadWidthSpinBox->setValue( mArrow->arrowHeadWidth() );
if ( mArrow->showArrowMarker() )
{
mShowArrowHeadCheckBox->setCheckState( Qt::Checked );
}
else
{
mShowArrowHeadCheckBox->setCheckState( Qt::Unchecked );
}
blockAllSignals( false );
if(!mArrow)
{
return;
}

blockAllSignals(true);
mOutlineWidthSpinBox->setValue(mArrow->outlineWidth());
mArrowHeadWidthSpinBox->setValue(mArrow->arrowHeadWidth());
if( mArrow->showArrowMarker())
{
mShowArrowHeadCheckBox->setCheckState(Qt::Checked);
}
else
{
mShowArrowHeadCheckBox->setCheckState(Qt::Unchecked);
}
blockAllSignals(false);
}

0 comments on commit fdebf3e

Please sign in to comment.
You can’t perform that action at this time.