本文整理汇总了C++中QwtPlotMarker::setLineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotMarker::setLineStyle方法的具体用法?C++ QwtPlotMarker::setLineStyle怎么用?C++ QwtPlotMarker::setLineStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotMarker
的用法示例。
在下文中一共展示了QwtPlotMarker::setLineStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clear
void Plot::clear()
{
this->detachItems();
pointsArr.clear();
// ...a horizontal line at y = 1...
QwtPlotMarker *mY1 = new QwtPlotMarker();
mY1->setLabel( QString::fromLatin1( "y = 1" ) );
mY1->setLabelAlignment( Qt::AlignRight | Qt::AlignTop );
mY1->setLineStyle( QwtPlotMarker::HLine );
mY1->setYValue( 1.0 );
mY1->setLinePen(Qt::black, 1, Qt::DashLine);
mY1->attach( this );
QwtPlotMarker *mY = new QwtPlotMarker();
mY->setLabel( QString::fromLatin1( "y = 0" ) );
mY->setLabelAlignment( Qt::AlignRight | Qt::AlignTop );
mY->setLineStyle( QwtPlotMarker::HLine );
mY->setYValue( 0.0 );
mY->attach( this );
// ...a vertical line at x = 0
QwtPlotMarker *mX = new QwtPlotMarker();
mX->setLabel( QString::fromLatin1( "x = 0" ) );
mX->setLabelAlignment( Qt::AlignLeft | Qt::AlignBottom );
mX->setLabelOrientation( Qt::Vertical );
mX->setLineStyle( QwtPlotMarker::VLine );
mX->setLinePen( Qt::black, 0, Qt::DashDotLine );
mX->setXValue( 0 );
mX->attach( this );
}
示例2: QDialog
SimDialog::SimDialog( QWidget * parent, Qt::WFlags f)
: QDialog(parent, f)
{
setupUi(this);
// setup the plot ...
m_plot->setTitle("Comparing Similarity Measures");
m_plot->insertLegend(new QwtLegend(), QwtPlot::BottomLegend);
// set up the axes ...
m_plot->setAxisTitle(QwtPlot::xBottom, "Variations");
m_plot->setAxisScale(QwtPlot::xBottom, -10, 10);
m_plot->setAxisTitle(QwtPlot::yLeft, "Similarity");
m_plot->setAxisScale(QwtPlot::yLeft, -1.5, 1.5);
// enable grid ...
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->enableYMin(true);
grid->setMajPen(QPen(Qt::black, 0, Qt::DotLine));
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid->attach(m_plot);
// Insert zero line at y = 0
QwtPlotMarker *mY = new QwtPlotMarker();
mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
mY->setLineStyle(QwtPlotMarker::HLine);
mY->setYValue(0.0);
mY->attach(m_plot);
// Insert zero line at x = 0
QwtPlotMarker *mX = new QwtPlotMarker();
mX->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
mX->setLineStyle(QwtPlotMarker::VLine);
mX->setXValue(0.0);
mX->attach(m_plot);
// Insert new curves
cReg = new QwtPlotCurve("Regular Similarity Measure");
cReg->attach(m_plot);
cOct = new QwtPlotCurve("Octree based Similarity Measure");
cOct->attach(m_plot);
// Set curve styles
cReg->setPen(QPen(Qt::red, 2));
cOct->setPen(QPen(Qt::blue, 2));
// Populate the volume combos ...
MainWindow* _win = (MainWindow *)this->parent();
viewer3d * _view = (viewer3d *) _win->getViewer();
QList<Volume*> _vols = _view->getVolumes();
// append Volume names to combo boxes ...
// Need to modify Volume class so that it stored patient name ...
// More importantly modify PatientBrowser so that the data can be directly
// loaded.
}
示例3: setTitle
Plot::Plot()
{
setTitle("A Simple QwtPlot Demonstration");
insertLegend(new QwtLegend(), QwtPlot::RightLegend);
// Set axis titles
setAxisTitle(xBottom, "x -->");
setAxisTitle(yLeft, "y -->");
// Insert new curves
QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
#if QT_VERSION >= 0x040000
cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
cSin->setPen(QPen(Qt::red));
cSin->attach(this);
QwtPlotCurve *cCos = new QwtPlotCurve("y = cos(x)");
#if QT_VERSION >= 0x040000
cCos->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
cCos->setPen(QPen(Qt::blue));
cCos->attach(this);
// Create sin and cos data
const int nPoints = 100;
cSin->setData(SimpleData(::sin, nPoints));
cCos->setData(SimpleData(::cos, nPoints));
// Insert markers
// ...a horizontal line at y = 0...
QwtPlotMarker *mY = new QwtPlotMarker();
mY->setLabel(QString::fromLatin1("y = 0"));
mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
mY->setLineStyle(QwtPlotMarker::HLine);
mY->setYValue(0.0);
mY->attach(this);
// ...a vertical line at x = 2 * pi
QwtPlotMarker *mX = new QwtPlotMarker();
mX->setLabel(QString::fromLatin1("x = 2 pi"));
mX->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
mX->setLabelOrientation(Qt::Vertical);
mX->setLineStyle(QwtPlotMarker::VLine);
mX->setLinePen(QPen(Qt::black, 0, Qt::DashDotLine));
mX->setXValue(2.0 * M_PI);
mX->attach(this);
}
示例4: enableZeroLineY
void Grid::enableZeroLineY(bool enable) {
Plot *d_plot = dynamic_cast<Plot *>(plot());
if (!d_plot)
return;
if (mrkY < 0 && enable) {
QwtPlotMarker *m = new QwtPlotMarker();
mrkY = d_plot->insertMarker(m);
m->setRenderHint(QwtPlotItem::RenderAntialiased, false);
m->setAxis(xAxis(), yAxis());
m->setLineStyle(QwtPlotMarker::HLine);
m->setValue(0.0, 0.0);
double width = 1;
if (d_plot->canvas()->lineWidth())
width = d_plot->canvas()->lineWidth();
else if (d_plot->axisEnabled(QwtPlot::xBottom) ||
d_plot->axisEnabled(QwtPlot::xTop))
width = d_plot->axesLinewidth();
m->setLinePen(QPen(Qt::black, width, Qt::SolidLine));
} else if (mrkY >= 0 && !enable) {
d_plot->removeMarker(mrkY);
mrkY = -1;
}
}
示例5: insertLineMarker
/*!
This function is a shortcut to insert a horizontal or vertical
line marker, dependent on the specified axis.
\param label Label
\param axis Axis to be attached
\return New key if the marker could be inserted, 0 if not.
*/
long QwtPlot::insertLineMarker(const QString &label, int axis)
{
QwtMarker::LineStyle lineStyle = QwtMarker::NoLine;
int xAxis = QwtPlot::xBottom;
int yAxis = QwtPlot::yLeft;
switch(axis)
{
case yLeft:
case yRight:
yAxis = axis;
lineStyle = QwtMarker::HLine;
break;
case xTop:
case xBottom:
xAxis = axis;
lineStyle = QwtMarker::VLine;
break;
}
QwtPlotMarker *marker = new QwtPlotMarker(this);
if ( marker == 0 )
return 0;
marker->setAxis(xAxis, yAxis);
marker->setLabel(label);
marker->setLineStyle(lineStyle);
marker->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
long key = insertMarker(marker);
if ( key == 0 )
delete marker;
return key;
}
示例6: enableZeroLineX
void Grid::enableZeroLineX(bool enable)
{
Plot *d_plot = (Plot *)plot();
if (!d_plot)
return;
if (mrkX<0 && enable) {
QwtPlotMarker *m = new QwtPlotMarker();
mrkX = d_plot->insertMarker(m);
m->setRenderHint(QwtPlotItem::RenderAntialiased, false);
m->setAxis(xAxis(), yAxis());
m->setLineStyle(QwtPlotMarker::VLine);
m->setValue(0.0, 0.0);
double width = 1;
if (d_plot->canvas()->lineWidth())
width = d_plot->canvas()->lineWidth();
else if (d_plot->axisEnabled (QwtPlot::yLeft) || d_plot->axisEnabled (QwtPlot::yRight))
width = d_plot->axesLinewidth();
m->setLinePen(QPen(Qt::black, width, Qt::SolidLine));
} else if (mrkX >= 0 && !enable) {
d_plot->removeMarker(mrkX);
mrkX=-1;
}
}
示例7: drawLapMarkers
void PlotWindow::drawLapMarkers()
{
if (_data_log->numLaps() > 1)
{
for (int i=0; i < _data_log->numLaps(); ++i)
{
QwtPlotMarker* marker = new QwtPlotMarker;
marker->setLineStyle(QwtPlotMarker::VLine);
marker->setLinePen(QPen(Qt::DotLine));
if (_x_axis_measurement->currentIndex() == 0) // time
{
const double time = _data_log->time(_data_log->lap(i).second);
marker->setXValue(time);
}
else // distance
{
const double dist = _data_log->dist(_data_log->lap(i).second);
marker->setXValue(dist);
}
marker->attach(_plot);
marker->show();
_lap_markers.push_back(marker);
}
}
}
示例8: fm
DataPlot::DataPlot(QWidget *parent, TelemetryStateReceiver* collector, OdometryStateReceiver* odometryReceiver,QMap<QString, QStringList> *list) :
QwtPlot(parent),
d_interval(0),
d_timerId(-1)
{
node=collector;
odom_receiver=odometryReceiver;
connect_status=false;
QObject::connect( node, SIGNAL( parameterReceived( )), this, SLOT( onParameterReceived( )));
data_count=0;
posicionBuffer=PLOT_SIZE;
colors_list <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray" <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray" <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray" <<"red"<<"blue"<<"green"<<"black"<<"yellow"<<"magenta"<<"cyan"<<"gray"<<"darkCyan"<<"darkMagenta"<<"darkYellow"<<"darkGray"<<"darkRed"<<"darkBlue"<<"darkGreen"<<"lightGray";
iterator_colors=0;
is_stop_pressed=false;
alignScales();
setAutoReplot(false);
parameters_list = setCurveLabels(*list);
current_min_limit=0;
current_max_limit=0;
QwtPlotZoomer* zoomer = new MyZoomer(canvas());
QwtPlotPanner *panner = new QwtPlotPanner(canvas());
panner->setAxisEnabled(QwtPlot::yRight, true);
panner->setMouseButton(Qt::MidButton);
// Avoid jumping when labels with more/less digits
// appear/disappear when scrolling vertically
const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
sd->setMinimumExtent( fm.width("100.00") );
const QColor c(Qt::darkBlue);
zoomer->setRubberBandPen(c);
zoomer->setTrackerPen(c);
setGridPlot();
initTimeData();
#if 0
// Insert zero line at y = 0
QwtPlotMarker *mY = new QwtPlotMarker();
mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
mY->setLineStyle(QwtPlotMarker::HLine);
mY->setYValue(0.0);
mY->attach(this);
#endif
initAxisX();
initAxisY();
initCurves();
setTimerInterval(1000);// 1 second = 1000
}
示例9: dodaj_naj
void wykres::dodaj_naj(double d) {
QwtPlotMarker *mY = new QwtPlotMarker();
mY->setLabel(QString::fromLatin1("Osobnik najlepszy = ")+QString::number(-d));
mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
mY->setLineStyle(QwtPlotMarker::HLine);
mY->setYValue(-d);
mY->attach(this);
}
示例10: Plot_AddHLine
void Plot_AddHLine(QwtPlot* plot, double value , double r , double g, double b)
{
QwtPlotMarker *marker = new QwtPlotMarker();
marker->setLineStyle ( QwtPlotMarker::HLine );
marker->setLinePen(QPen(QColor(r, g, b, 128), 1, Qt::DashDotLine));
marker->attach( plot );
marker->setYValue( value );
}
示例11: createVerticalPlotMarker
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QwtPlotMarker* RicGridStatisticsDialog::createVerticalPlotMarker(const QColor& color, double xValue)
{
QwtPlotMarker* marker = new QwtPlotMarker();
marker->setXValue(xValue);
marker->setLineStyle(QwtPlotMarker::VLine);
marker->setLinePen(color, 2, Qt::SolidLine);
return marker;
}
示例12: setMarkerLineStyle
/*!
\brief Specify the line style for a marker
\param key Marker key
\param st Line style: <code>QwtMarker::HLine, QwtMarker::VLine,
QwtMarker::NoLine</code> or a combination of them.
\return \c TRUE if the specified marker exists
*/
bool QwtPlot::setMarkerLineStyle(long key, QwtMarker::LineStyle st)
{
int rv = FALSE;
QwtPlotMarker *m;
if ((m = d_markers->find(key)))
{
m->setLineStyle(st);
rv = TRUE;
}
return rv;
}
示例13: markerPen
/**
* This is a helper method to create new band markers with the same line
* style and a custom color.
*
* @param color The color of the band marker
* @return The requested plot marker; ownership is passed to the caller
*/
QwtPlotMarker *SpectralPlotWindow::createMarker(QColor color) {
QPen markerPen(color);
markerPen.setWidth(1);
QwtPlotMarker *newMarker = new QwtPlotMarker;
newMarker->setLineStyle(QwtPlotMarker::LineStyle(2));
newMarker->setLinePen(markerPen);
newMarker->attach(plot());
newMarker->setVisible(false);
return newMarker;
}
示例14: setExtraCaption
/**
* Dodaje dodatkowy opis wykresu.
*
* @param caption opis wykresu
* @param x pozycja na wykresie w skali czasu
* @param y pozycja na wykresie w skali pionowej (np. częstotliwości)
*/
void SpectrogramPlot::setExtraCaption(QString caption, double x, double y)
{
QwtPlotMarker* marker = new QwtPlotMarker();
QwtText label(caption);
label.setColor(QColor::fromRgba(0x88FFFFFF));
label.setFont(QFont("Arial", 10, QFont::Bold));
marker->setLabel(label);
marker->setLineStyle(QwtPlotMarker::NoLine);
marker->setValue(x, y);
marker->setLabelAlignment(Qt::AlignRight | Qt::AlignBottom);
marker->attach(this);
}
示例15: populate
void Plot::populate()
{
// Insert new curves
QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
cSin->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
cSin->setPen(QPen(Qt::red));
cSin->attach(this);
QwtPlotCurve *cCos = new QwtPlotCurve("y = cos(x)");
cCos->setRenderHint(QwtPlotItem::RenderAntialiased);
cCos->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
cCos->setPen(QPen(Qt::blue));
cCos->attach(this);
// Create sin and cos data
cSin->setData(new FunctionData(::sin));
cCos->setData(new FunctionData(::cos));
// Insert markers
// ...a horizontal line at y = 0...
QwtPlotMarker *mY = new QwtPlotMarker();
mY->setLabel(QString::fromLatin1("y = 0"));
mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
mY->setLineStyle(QwtPlotMarker::HLine);
mY->setYValue(0.0);
mY->attach(this);
// ...a vertical line at x = 2 * pi
QwtPlotMarker *mX = new QwtPlotMarker();
mX->setLabel(QString::fromLatin1("x = 2 pi"));
mX->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
mX->setLabelOrientation(Qt::Vertical);
mX->setLineStyle(QwtPlotMarker::VLine);
mX->setLinePen(QPen(Qt::black, 0, Qt::DashDotLine));
mX->setXValue(2.0 * M_PI);
mX->attach(this);
}