本文整理汇总了C++中QwtPlotGrid::setYDiv方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotGrid::setYDiv方法的具体用法?C++ QwtPlotGrid::setYDiv怎么用?C++ QwtPlotGrid::setYDiv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotGrid
的用法示例。
在下文中一共展示了QwtPlotGrid::setYDiv方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gridDiv
QgsCurveEditorWidget::QgsCurveEditorWidget( QWidget *parent, const QgsCurveTransform &transform )
: QWidget( parent )
, mCurve( transform )
, mCurrentPlotMarkerIndex( -1 )
{
mPlot = new QwtPlot();
mPlot->setMinimumSize( QSize( 0, 100 ) );
mPlot->setAxisScale( QwtPlot::yLeft, 0, 1 );
mPlot->setAxisScale( QwtPlot::yRight, 0, 1 );
mPlot->setAxisScale( QwtPlot::xBottom, 0, 1 );
mPlot->setAxisScale( QwtPlot::xTop, 0, 1 );
QVBoxLayout *vlayout = new QVBoxLayout();
vlayout->addWidget( mPlot );
setLayout( vlayout );
// hide the ugly canvas frame
mPlot->setFrameStyle( QFrame::NoFrame );
QFrame *plotCanvasFrame = dynamic_cast<QFrame *>( mPlot->canvas() );
if ( plotCanvasFrame )
plotCanvasFrame->setFrameStyle( QFrame::NoFrame );
mPlot->enableAxis( QwtPlot::yLeft, false );
mPlot->enableAxis( QwtPlot::xBottom, false );
// add a grid
QwtPlotGrid *grid = new QwtPlotGrid();
QwtScaleDiv gridDiv( 0.0, 1.0, QList<double>(), QList<double>(), QList<double>() << 0.2 << 0.4 << 0.6 << 0.8 );
grid->setXDiv( gridDiv );
grid->setYDiv( gridDiv );
grid->setPen( QPen( QColor( 0, 0, 0, 50 ) ) );
grid->attach( mPlot );
mPlotCurve = new QwtPlotCurve();
mPlotCurve->setTitle( QStringLiteral( "Curve" ) );
mPlotCurve->setPen( QPen( QColor( 30, 30, 30 ), 0.0 ) ),
mPlotCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
mPlotCurve->attach( mPlot );
mPlotFilter = new QgsCurveEditorPlotEventFilter( mPlot );
connect( mPlotFilter, &QgsCurveEditorPlotEventFilter::mousePress, this, &QgsCurveEditorWidget::plotMousePress );
connect( mPlotFilter, &QgsCurveEditorPlotEventFilter::mouseRelease, this, &QgsCurveEditorWidget::plotMouseRelease );
connect( mPlotFilter, &QgsCurveEditorPlotEventFilter::mouseMove, this, &QgsCurveEditorWidget::plotMouseMove );
mPlotCurve->setVisible( true );
updatePlot();
}
示例2: gridDiv
QgsGradientColorRampDialog::QgsGradientColorRampDialog( const QgsGradientColorRamp &ramp, QWidget *parent )
: QDialog( parent )
, mRamp( ramp )
, mCurrentPlotColorComponent( -1 )
, mCurrentPlotMarkerIndex( 0 )
{
setupUi( this );
#ifdef Q_OS_MAC
setWindowModality( Qt::WindowModal );
#endif
mPositionSpinBox->setShowClearButton( false );
btnColor1->setAllowOpacity( true );
btnColor1->setColorDialogTitle( tr( "Select Ramp Color" ) );
btnColor1->setContext( QStringLiteral( "symbology" ) );
btnColor1->setShowNoColor( true );
btnColor1->setNoColorString( tr( "Transparent" ) );
btnColor2->setAllowOpacity( true );
btnColor2->setColorDialogTitle( tr( "Select Ramp Color" ) );
btnColor2->setContext( QStringLiteral( "symbology" ) );
btnColor2->setShowNoColor( true );
btnColor2->setNoColorString( tr( "Transparent" ) );
updateColorButtons();
connect( btnColor1, &QgsColorButton::colorChanged, this, &QgsGradientColorRampDialog::setColor1 );
connect( btnColor2, &QgsColorButton::colorChanged, this, &QgsGradientColorRampDialog::setColor2 );
// fill type combobox
cboType->blockSignals( true );
cboType->addItem( tr( "Discrete" ) );
cboType->addItem( tr( "Continuous" ) );
if ( mRamp.isDiscrete() )
cboType->setCurrentIndex( 0 );
else
cboType->setCurrentIndex( 1 );
cboType->blockSignals( false );
if ( mRamp.info().isEmpty() )
btnInformation->setEnabled( false );
mStopEditor->setGradientRamp( mRamp );
connect( mStopEditor, &QgsGradientStopEditor::changed, this, &QgsGradientColorRampDialog::updateRampFromStopEditor );
connect( mColorWidget, &QgsCompoundColorWidget::currentColorChanged, this, &QgsGradientColorRampDialog::colorWidgetChanged );
connect( mDeleteStopButton, &QAbstractButton::clicked, mStopEditor, &QgsGradientStopEditor::deleteSelectedStop );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/GradientEditor/geometry" ) ).toByteArray() );
// hide the ugly canvas frame
mPlot->setFrameStyle( QFrame::NoFrame );
QFrame *plotCanvasFrame = dynamic_cast<QFrame *>( mPlot->canvas() );
if ( plotCanvasFrame )
plotCanvasFrame->setFrameStyle( QFrame::NoFrame );
mPlot->setAxisScale( QwtPlot::yLeft, 0.0, 1.0 );
mPlot->enableAxis( QwtPlot::yLeft, false );
// add a grid
QwtPlotGrid *grid = new QwtPlotGrid();
QwtScaleDiv gridDiv( 0.0, 1.0, QList<double>(), QList<double>(), QList<double>() << 0.2 << 0.4 << 0.6 << 0.8 );
grid->setXDiv( gridDiv );
grid->setYDiv( gridDiv );
grid->setPen( QPen( QColor( 0, 0, 0, 50 ) ) );
grid->attach( mPlot );
mLightnessCurve = new QwtPlotCurve();
mLightnessCurve->setTitle( QStringLiteral( "Lightness" ) );
mLightnessCurve->setPen( QPen( QColor( 70, 150, 255 ), 0.0 ) ),
mLightnessCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
mLightnessCurve->attach( mPlot );
mHueCurve = new QwtPlotCurve();
mHueCurve->setTitle( QStringLiteral( "Hue" ) );
mHueCurve->setPen( QPen( QColor( 255, 215, 70 ), 0.0 ) ),
mHueCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
mHueCurve->attach( mPlot );
mSaturationCurve = new QwtPlotCurve();
mSaturationCurve->setTitle( QStringLiteral( "Saturation" ) );
mSaturationCurve->setPen( QPen( QColor( 255, 70, 150 ), 0.0 ) ),
mSaturationCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
mSaturationCurve->attach( mPlot );
mAlphaCurve = new QwtPlotCurve();
mAlphaCurve->setTitle( QStringLiteral( "Opacity" ) );
mAlphaCurve->setPen( QPen( QColor( 50, 50, 50 ), 0.0 ) ),
mAlphaCurve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
mAlphaCurve->attach( mPlot );
mPlotFilter = new QgsGradientPlotEventFilter( mPlot );
connect( mPlotFilter, &QgsGradientPlotEventFilter::mousePress, this, &QgsGradientColorRampDialog::plotMousePress );
connect( mPlotFilter, &QgsGradientPlotEventFilter::mouseRelease, this, &QgsGradientColorRampDialog::plotMouseRelease );
connect( mPlotFilter, &QgsGradientPlotEventFilter::mouseMove, this, &QgsGradientColorRampDialog::plotMouseMove );
mPlotHueCheckbox->setChecked( settings.value( QStringLiteral( "GradientEditor/plotHue" ), false ).toBool() );
mPlotLightnessCheckbox->setChecked( settings.value( QStringLiteral( "GradientEditor/plotLightness" ), true ).toBool() );
mPlotSaturationCheckbox->setChecked( settings.value( QStringLiteral( "GradientEditor/plotSaturation" ), false ).toBool() );
mPlotAlphaCheckbox->setChecked( settings.value( QStringLiteral( "GradientEditor/plotAlpha" ), false ).toBool() );
mHueCurve->setVisible( mPlotHueCheckbox->isChecked() );
//.........这里部分代码省略.........