Skip to content

Commit

Permalink
Removed Qt4.5 dependency ;-)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12250 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 25, 2009
1 parent 2b7a7dd commit 082a8ee
Showing 1 changed file with 64 additions and 60 deletions.
124 changes: 64 additions & 60 deletions src/app/composer/qgscomposerarrowwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 082a8ee

Please sign in to comment.