• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ rangeChanged函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rangeChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ rangeChanged函数的具体用法?C++ rangeChanged怎么用?C++ rangeChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rangeChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    init_time=0;
    data = -1;
    count_graph =0;
    dbaddr = "/home/uday/qtProjects/finaltrialqtplotting/sensorDatabase.db";
    ui->customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
    ui->customPlot->xAxis->setDateTimeFormat("hh:mm:ss");
    ui->customPlot->xAxis->setAutoTickStep(false);
    ui->customPlot->xAxis->setTickStep(3);
    ui->customPlot->axisRect()->setupFullAxesBox();


    ui->customPlot->xAxis->setLabel("Time(s)");
    ui->customPlot->yAxis->setLabel("Temperature");
    ui->customPlot->yAxis->setRange(0, 400);

    // make left and bottom axes transfer their ranges to right and top axes:
    connect(ui->customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->xAxis2, SLOT(setRange(QCPRange)));
    connect(ui->customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->yAxis2, SLOT(setRange(QCPRange)));

    // setup a timer that repeatedly calls MainWindow::realtimeDataSlot:
    connect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimeDataSlot()));
    dataTimer.start(500); // Interval 0 means to refresh as fast as possible

}
开发者ID:hasantahir,项目名称:ECEN489-Fall2015,代码行数:29,代码来源:mainwindow.cpp


示例2: QWidget

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->widget->xAxis, SIGNAL(rangeChanged(QCPRange)), ui->widget->xAxis2, SLOT(setRange(QCPRange)));
    connect(ui->widget->yAxis, SIGNAL(rangeChanged(QCPRange)), ui->widget->yAxis2, SLOT(setRange(QCPRange)));

    ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables | QCP::iSelectLegend | QCP::iSelectAxes);
    ui->widget->axisRect()->setupFullAxesBox();

    ui->widget->plotLayout()->insertRow(0);
    ui->widget->plotLayout()->addElement(0, 0, new QCPPlotTitle(ui->widget, "Lagra"));

    ui->widget->xAxis->setLabel("x");
    ui->widget->yAxis->setLabel("y");

    ui->widget->legend->setVisible(true);

    QFont legendFont = font();
    legendFont.setPointSize(10);
    ui->widget->legend->setFont(legendFont);
    ui->widget->legend->setSelectedFont(legendFont);
    ui->widget->legend->setSelectableParts(QCPLegend::spNone);
}
开发者ID:Kupchinsky,项目名称:MV,代码行数:26,代码来源:widget.cpp


示例3: connect

void plotWidget::setupRealtimeData()
{
    if(this->m_dataType == img || this->m_dataType == nodata) {
        connect(&dataTimer, SIGNAL(timeout()), this, SLOT(SetRealtimeImg()));
        dataTimer.start(myApp::plotRefreshTimeSpan); // Interval 0 means to refresh as fast as possible
        return;
    }
    else {
        this->addGraph(); // blue line
        this->graph(0)->setPen(QPen(Qt::blue));
        this->graph(0)->setBrush(QBrush(QColor(240, 255, 200)));

        this->addGraph(); // blue dot
        this->graph(1)->setPen(QPen(QColor(255, 100, 0)));
        this->graph(1)->setLineStyle(QCPGraph::lsLine);
        this->graph(1)->setScatterStyle(QCPScatterStyle::ssDisc);

        this->xAxis->setTickLabelType(QCPAxis::ltDateTime);
        this->xAxis->setDateTimeFormat("hh:mm:ss");
        this->xAxis->setAutoTickStep(false);
        this->xAxis->setTickStep(2);
        this->axisRect()->setupFullAxesBox();

        // make left and bottom axes transfer their ranges to right and top axes:
        connect(this->xAxis, SIGNAL(rangeChanged(QCPRange)), this->xAxis2, SLOT(setRange(QCPRange)));
        connect(this->yAxis, SIGNAL(rangeChanged(QCPRange)), this->yAxis2, SLOT(setRange(QCPRange)));

        connect(&dataTimer, SIGNAL(timeout()), this, SLOT(SetRealtimeData()));
        dataTimer.start(myApp::plotRefreshTimeSpan); // Interval 0 means to refresh as fast as possible
        this->yAxis->setLabel(demoName);
        this->replot();
    }
}
开发者ID:Ranpop,项目名称:QT-Monitor,代码行数:33,代码来源:plotwidget.cpp


示例4: ui

ScatterWidget::ScatterWidget() :
    ui(new Ui::ScatterWidget)
{
    ui->setupUi(this);

    ui->scatter->xAxis->setTickLength(0, 5);
    ui->scatter->xAxis->setSubTickLength(0, 3);
    ui->scatter->axisRect()->setupFullAxesBox();
    ui->scatter->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
    ui->scatter->xAxis->setRange(-1, 1);
    ui->scatter->yAxis->setRange(-1, 1);

    // make left and bottom axes transfer their ranges to right and top axes:
    connect(ui->scatter->xAxis, SIGNAL(rangeChanged(QCPRange)), ui->scatter->xAxis2, SLOT(setRange(QCPRange)));
    connect(ui->scatter->yAxis, SIGNAL(rangeChanged(QCPRange)), ui->scatter->yAxis2, SLOT(setRange(QCPRange)));

    // connect slot that ties some axis selections together (especially opposite axes):
    connect(ui->scatter, &QCustomPlot::selectionChangedByUser, this, &ScatterWidget::selectionChanged);
    // connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed:
    connect(ui->scatter, &QCustomPlot::mousePress, this, &ScatterWidget::mousePress);
    connect(ui->scatter, &QCustomPlot::mouseWheel, this, &ScatterWidget::mouseWheel);

    // Add Drag, Zoom and ... capabilities
    ui->scatter->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectItems | QCP::iSelectPlottables | QCP::iSelectAxes | QCP::iMultiSelect);
}
开发者ID:amiryanj,项目名称:smart-debug,代码行数:25,代码来源:scatterwidget.cpp


示例5: connect

void LeastSquare::PlotQuadr(QCustomPlot *customPlot)
{
    QString label1 = ui->XLabel->text();
    QString label2 = ui->YLabel->text();
    QString size_point = ui->size_point->text();
    if (size_point.isEmpty())
    {
        size_point = "8";
    }

    customPlot->addGraph();
    customPlot->graph(0)->setPen(QPen(Qt::black));
    customPlot->graph(0)->setLineStyle(QCPGraph::lsNone);
    customPlot->graph(0)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, size_point.toInt()));
    customPlot->graph(0)->setData(x_values, y_values);

    customPlot->addGraph();
    customPlot->graph(1)->setPen(QPen(Qt::cyan));
    customPlot->graph(1)->setLineStyle(QCPGraph::lsLine);
    customPlot->graph(1)->setData(x_values, y_apprx);

    customPlot->xAxis2->setVisible(true);
    customPlot->xAxis2->setTickLabels(false);
    customPlot->yAxis2->setVisible(true);
    customPlot->yAxis2->setTickLabels(false);
    connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->xAxis2, SLOT(setRange(QCPRange)));
    connect(customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->yAxis2, SLOT(setRange(QCPRange)));
    customPlot->xAxis->setLabel(label1);
    customPlot->yAxis->setLabel(label2);
    customPlot->graph(0)->rescaleAxes();
    customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
}
开发者ID:pekarchuk,项目名称:LeastSquares,代码行数:32,代码来源:leastsquare.cpp


示例6: connect

void MainWindow::setgraphs(QCustomPlot *customPlot,QString xlabel,QString ylabel,int rg){

    // configure bottom axis to show date and time instead of number:
        customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
       customPlot->xAxis->setDateTimeFormat("hh:mm:ss");
    // set a more compact font size for bottom and left axis tick labels:
       customPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 8));
       customPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 8));

       customPlot->xAxis->setLabel(xlabel);
       customPlot->yAxis->setLabel( ylabel);
    // scale x-axis in steps of 3:
      customPlot->xAxis->setAutoTickStep(false);
      customPlot->xAxis->setTickStep(1);
      customPlot->axisRect()->setupFullAxesBox();
      customPlot->legend->setVisible(true);
      customPlot->axisRect()->insetLayout()->setInsetAlignment(0, Qt::AlignBottom|Qt::AlignLeft);

       customPlot->yAxis->setRange(0,rg);

      // make left and bottom axes transfer their ranges to right and top axes:
         connect( customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)),customPlot->xAxis2, SLOT(setRange(QCPRange)));
         connect( customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)),customPlot->yAxis2, SLOT(setRange(QCPRange)));

}
开发者ID:CourseReps,项目名称:ECEN489-Fall2015,代码行数:25,代码来源:mainwindow.cpp


示例7: connect

void MainWindow::setupIntegerTickStepCase(QCustomPlot *customPlot)
{
	customPlot->xAxis->setAutoTickStep(false);
	customPlot->yAxis->setAutoTickStep(false);
	connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(integerTickStepCase_xRangeChanged(QCPRange)));
	connect(customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(integerTickStepCase_yRangeChanged(QCPRange)));
}
开发者ID:shenglonglinapple,项目名称:slin_code,代码行数:7,代码来源:mainwindow.cpp


示例8: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
{
  ui->setupUi(this);
  setupPlot();
  
  // configure scroll bars:
  // Since scroll bars only support integer values, we'll set a high default range of -500..500 and
  // divide scroll bar position values by 100 to provide a scroll range -5..5 in floating point
  // axis coordinates. if you want to dynamically grow the range accessible with the scroll bar,
  // just increase the the minimum/maximum values of the scroll bars as needed.
  ui->horizontalScrollBar->setRange(-500, 500);
  ui->verticalScrollBar->setRange(-500, 500);
  
  // create connection between axes and scroll bars:
  connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(horzScrollBarChanged(int)));
  connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vertScrollBarChanged(int)));
  connect(ui->plot->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
  connect(ui->plot->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange)));
  
  // initialize axis range (and scroll bar positions via signals we just connected):
  ui->plot->xAxis->setRange(0, 6, Qt::AlignCenter);
  ui->plot->yAxis->setRange(0, 10, Qt::AlignCenter);
}
开发者ID:alagoutte,项目名称:QCustomPlot,代码行数:25,代码来源:mainwindow.cpp


示例9: connect

void rpm1gauge::setupRealtimeDataDemo(QCustomPlot *customPlot)
{
  customPlot->addGraph();                                               //line graph
  customPlot->graph(0)->setPen(QPen(mColor));
  customPlot->addGraph();                                               //dot for new data
  customPlot->graph(1)->setPen(QPen(mColor));
  customPlot->graph(1)->setLineStyle(QCPGraph::lsNone);
  customPlot->graph(1)->setScatterStyle(QCPScatterStyle::ssStar);


  customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime);             //time on x-axis

  customPlot->xAxis->setDateTimeFormat("hh:mm:ss");
  customPlot->xAxis->setAutoTickStep(false);
  customPlot->xAxis->setTickStep(30);                                   //30 second interval ticks
  customPlot->axisRect()->setupFullAxesBox();

  connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->xAxis2, SLOT(setRange(QCPRange)));
  connect(customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->yAxis2, SLOT(setRange(QCPRange)));


  connect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimeDataSlot()));           //runs rtds function every 300 ms

  dataTimer.start(1000);
}
开发者ID:dflass,项目名称:tenGauge-with-iOS-capability,代码行数:25,代码来源:rpm1gauge.cpp


示例10: connect

void viewGVpropertieslayout::setupPlot(QCustomPlot * plot) {

    // configure the plot for use

    // range
    plot->setInteraction(QCP::iRangeDrag, true);
    plot->setInteraction(QCP::iRangeZoom, true);

    // default to x-axis drag / zoom only
    plot->axisRect()->setRangeDrag(Qt::Horizontal);
    plot->axisRect()->setRangeZoom(Qt::Horizontal);

    // selections allowed
    plot->setInteraction(QCP::iSelectPlottables, true);
    plot->setInteraction(QCP::iSelectAxes, true);
    plot->setInteraction(QCP::iSelectLegend, true);

    // context menus for deleting graphs / reseting axes etc
    plot->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(plot, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequest(QPoint)));

    // make bottom and left axes transfer their ranges to top and right axes:
    connect(plot->xAxis, SIGNAL(rangeChanged(QCPRange)), plot->xAxis2, SLOT(setRange(QCPRange)));
    connect(plot->yAxis, SIGNAL(rangeChanged(QCPRange)), plot->yAxis2, SLOT(setRange(QCPRange)));


}
开发者ID:ajc158,项目名称:spinecreator,代码行数:27,代码来源:viewGVpropertieslayout.cpp


示例11: SIGNAL

/*!
 * \brief ScrollingTimeGraph::setupPlot Sets the plot up according to our standards.
 * \param mainWindow A pointer to the mainWindow, used for setting up a connection.
 * \param plot The plot which is being set up.
 * \param isMain A boolean for whether this is main or not.
 * \param primaryColor The color of the primary line.
 * \param secondaryColor The color of the secondary line.
 */
void ScrollingTimeGraph::setupPlot(QMainWindow* mainWindow, QCustomPlot *plot, bool isMain, QColor primaryColor, QColor secondaryColor)
{
    plot->addGraph(); // primary line
    plot->graph(0)->setPen(QPen(primaryColor));
    plot->graph(0)->setAntialiasedFill(false);
    plot->addGraph(); // secondary line
    plot->graph(1)->setPen(QPen(secondaryColor));
    plot->graph(0)->setChannelFillGraph(plot->graph(1));

    plot->addGraph(); // primary dot
    plot->graph(2)->setPen(QPen(primaryColor));
    plot->graph(2)->setLineStyle(QCPGraph::lsNone);
    plot->graph(2)->setScatterStyle(QCPScatterStyle::ssDisc);
    plot->addGraph(); // secondary dot
    plot->graph(3)->setPen(QPen(secondaryColor));
    plot->graph(3)->setLineStyle(QCPGraph::lsNone);
    plot->graph(3)->setScatterStyle(QCPScatterStyle::ssDisc);

    if(isMain)
    {
        plot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
        plot->xAxis->setDateTimeFormat("hh:mm:ss");
        plot->xAxis->setAutoTickStep(false);
        plot->xAxis->setTickStep(2);
        plot->axisRect()->setupFullAxesBox();
        // make left and bottom axes transfer their ranges to right and top axes:
        mainWindow->connect(plot->xAxis, SIGNAL(rangeChanged(QCPRange)), plot->xAxis2, SLOT(setRange(QCPRange)));
        mainWindow->connect(plot->yAxis, SIGNAL(rangeChanged(QCPRange)), plot->yAxis2, SLOT(setRange(QCPRange)));
    }
    else
    {
        plot->xAxis->setTickLabels(false);
        plot->yAxis->setTickLabels(false);
    }
}
开发者ID:FIGS-FESS,项目名称:FESSGUI,代码行数:43,代码来源:graph.cpp


示例12: connect

//-------------------------------------------------------------------------------------------------//
//--------------------GRAPHS SETTINGS-------------------------------------------------------------//
//-----------------------------------------------------------------------------------------------//
void RealTimePlotWindow::startGraph(QCustomPlot *accPlot, QCustomPlot *gyroPlot/*, QCustomPlot *an_gyroPlot*/)
{
    //------------------accelerometer graph-------------------
    accPlot->addGraph(); // blue line
    accPlot->graph(0)->setPen(QPen(Qt::blue));
    accPlot->addGraph(); // red line
    accPlot->graph(1)->setPen(QPen(Qt::red));
    accPlot->addGraph(); // red line
    accPlot->graph(2)->setPen(QPen(Qt::green));

    accPlot->xAxis->setAutoTickStep(false);
    accPlot->xAxis->setTickStep(1);
    accPlot->setTitle("Acceleration LIS3DH");
    accPlot->xAxis->setLabel("time [s]");
    accPlot->yAxis->setLabel("a [mg]");
    //create legend
    accPlot->legend->setVisible(true);
    accPlot->legend->setFont(QFont("Helvetica", 9));
    accPlot->legend->setPositionStyle(QCPLegend::psTopLeft);

    accPlot->graph(0)->setName("x-axis");
    accPlot->graph(1)->setName("y-axis");
    accPlot->graph(2)->setName("z-axis");


    //------------------gyroscope graph-------------------------
    gyroPlot->addGraph(); // blue line
    gyroPlot->graph(0)->setPen(QPen(Qt::blue));
    gyroPlot->addGraph(); // red line
    gyroPlot->graph(1)->setPen(QPen(Qt::red));
    gyroPlot->addGraph(); // red line
    gyroPlot->graph(2)->setPen(QPen(Qt::green));

    gyroPlot->xAxis->setAutoTickStep(false);
    gyroPlot->xAxis->setTickStep(1);
    gyroPlot->setTitle("Angular velocity L3G4200D");
    gyroPlot->xAxis->setLabel("time [s]");
    gyroPlot->yAxis->setLabel("w [dps]");
    //create legend
    gyroPlot->legend->setVisible(true);
    gyroPlot->legend->setFont(QFont("Helvetica", 9));
    gyroPlot->legend->setPositionStyle(QCPLegend::psTopLeft);

    gyroPlot->graph(0)->setName("x-axis");
    gyroPlot->graph(1)->setName("y-axis");
    gyroPlot->graph(2)->setName("z-axis");

    //gyroPlot->graph(0)->setBrush(QBrush(QPixmap("fill.png")));

    // make left and bottom axes transfer their ranges to right and top axes:
    connect(accPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), accPlot->xAxis2, SLOT(setRange(QCPRange)));
    connect(accPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), accPlot->yAxis2, SLOT(setRange(QCPRange)));

    // make left and bottom axes transfer their ranges to right and top axes:
    connect(gyroPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), gyroPlot->xAxis2, SLOT(setRange(QCPRange)));
    connect(gyroPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), gyroPlot->yAxis2, SLOT(setRange(QCPRange)));

}
开发者ID:GruszekG,项目名称:sbanalyzer,代码行数:61,代码来源:realtimeplotwindow.cpp


示例13: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    // configurate scrollbars
    ui->horizontalScrollBar->setRange(-410, -290);
    ui->verticalScrollBar->setRange(-1300, -1240);

    // create connection between axes and scroll bars:
    connect(ui->widget->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
    connect(ui->widget->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange)));

    // initialize axis range und zooming
    ui->widget->xAxis->setRange(-4.1, -3.2, Qt::AlignCenter);
    ui->widget->yAxis->setRange(12.4, 13, Qt::AlignCenter);
    ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);

    // draw routes by selecting table row
    connect(ui->tableWidget_weekplans, SIGNAL(cellClicked(int, int)), this, SLOT(weekSelected(int, int)));
    connect(ui->tableWidget_dayplans, SIGNAL(cellClicked(int, int)), this, SLOT(daySelected(int, int)));

    // table of week plans
    ui->tableWidget_weekplans->setRowCount(constant::nweeks * constant::P);
    ui->tableWidget_weekplans->setColumnCount(3);

    QStringList Header;
    Header << "Work time" << "#Villages" << "#Households";
    ui->tableWidget_weekplans->setHorizontalHeaderLabels(Header);

    ui->tableWidget_weekplans->setColumnWidth(0,80);
    ui->tableWidget_weekplans->setColumnWidth(1,80);
    ui->tableWidget_weekplans->setColumnWidth(2,100);

    // table of day plans
    ui->tableWidget_dayplans->setRowCount(5);
    ui->tableWidget_dayplans->setColumnCount(5);

    Header.clear();
    Header << "Day" << "Villages" << "#Hh" << "Househols" << "Itime" << "Ttime" << "Wtime";
    ui->tableWidget_dayplans->setHorizontalHeaderLabels(Header);

    ui->tableWidget_dayplans->setColumnWidth(0,30);
    ui->tableWidget_dayplans->setColumnWidth(1,100);
    ui->tableWidget_dayplans->setColumnWidth(2,30);
    ui->tableWidget_dayplans->setColumnWidth(3,130);
    ui->tableWidget_dayplans->setColumnWidth(4,50);

    // show report window
    connect(ui->pbShow_report, SIGNAL(clicked()), this, SLOT(showReportWindow()));

    // default file selection
    MainWindow::on_buttonOpenVillages_clicked();
    MainWindow::on_buttonOpenRoads_clicked();
    MainWindow::on_buttonOpenHouseh_clicked();
}
开发者ID:tikhoncheva,项目名称:work,代码行数:57,代码来源:mainwindow.cpp


示例14: QT_VERSION_CHECK

int MainWindow::setupomegat(QCustomPlot *customPlot, int num)
{
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
  QMessageBox::critical(this, "", "You're using Qt < 4.7, the realtime data demo needs functions that are available with Qt 4.7 to work properly");
#endif
  const int a=5;

  if(num!=a){
      return num;
  }

  disconnect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimext()));
  disconnect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimexy()));
  disconnect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimeyt()));
  disconnect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimefit()));
  disconnect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimeomegat()));
  disconnect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimefifi()));

  customPlot->addGraph(); // blue line
  customPlot->graph(0)->setPen(QPen(Qt::blue));
  customPlot->graph(0)->setLineStyle(QCPGraph::lsLine);
  customPlot->graph(0)->setScatterStyle(QCPScatterStyle::ssNone);
  customPlot->graph(0)->setAntialiasedFill(true);

  customPlot->addGraph(); // blue dot
  customPlot->graph(1)->setPen(QPen(Qt::blue));
  customPlot->graph(1)->setLineStyle(QCPGraph::lsNone);
  customPlot->graph(1)->setScatterStyle(QCPScatterStyle::ssDisc);
  customPlot->graph(1)->setAntialiasedFill(true);

  customPlot->addGraph(); // red line
  customPlot->graph(2)->setPen(QPen(Qt::red));
  customPlot->graph(2)->setLineStyle(QCPGraph::lsLine);
  customPlot->graph(2)->setScatterStyle(QCPScatterStyle::ssNone);

  customPlot->addGraph(); // red dot
  customPlot->graph(3)->setPen(QPen(Qt::red));
  customPlot->graph(3)->setLineStyle(QCPGraph::lsNone);
  customPlot->graph(3)->setScatterStyle(QCPScatterStyle::ssDisc);


  ui->customplot->graph(0)->clearData();
  ui->customplot->graph(1)->clearData();
  ui->customplot->graph(2)->clearData();
  ui->customplot->graph(3)->clearData();

  // make left and bottom axes transfer their ranges to right and top axes:
  connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->xAxis2, SLOT(setRange(QCPRange)));
  connect(customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->yAxis2, SLOT(setRange(QCPRange)));

  // setup a timer that repeatedly calls MainWindow::realtimeDataSlot:
  connect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimeomegat()));
  dataTimer.start(50); // Interval 0 means to refresh as fast as possible

  return a;
}
开发者ID:Qbicz,项目名称:MUFB,代码行数:56,代码来源:mainwindow.cpp


示例15: QT_VERSION_CHECK

void mb_data_show::setupRealtimeDataDemo(void)
{
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
  QMessageBox::critical(this, "", "You're using Qt < 4.7, the realtime data demo needs functions that are available with Qt 4.7 to work properly");
#endif

  // include this section to fully disable antialiasing for higher performance:
  /*
  ui->customPlot->setNotAntialiasedElements(QCP::aeAll);
  QFont font;
  font.setStyleStrategy(QFont::NoAntialias);
  ui->customPlot->xAxis->setTickLabelFont(font);
  ui->customPlot->yAxis->setTickLabelFont(font);
  ui->customPlot->legend->setFont(font);
  */

  ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);

  ui->customPlot->addGraph(); // blue line
  ui->customPlot->graph(0)->setPen(QPen(Qt::blue));
/*
  ui->customPlot->graph(0)->setBrush(QBrush(QColor(240, 255, 200)));
  ui->customPlot->graph(0)->setAntialiasedFill(false);
*/
  ui->customPlot->addGraph(); // red line
  ui->customPlot->graph(1)->setPen(QPen(Qt::red));

  ui->customPlot->addGraph(); // green line
  ui->customPlot->graph(2)->setPen(QPen(Qt::green));
/*
  ui->customPlot->graph(0)->setChannelFillGraph(ui->customPlot->graph(1));

  ui->customPlot->addGraph(); // blue dot
  ui->customPlot->graph(2)->setPen(QPen(Qt::blue));
  ui->customPlot->graph(2)->setLineStyle(QCPGraph::lsNone);
  ui->customPlot->graph(2)->setScatterStyle(QCPScatterStyle::ssDisc);
  ui->customPlot->addGraph(); // red dot
  ui->customPlot->graph(3)->setPen(QPen(Qt::red));
  ui->customPlot->graph(3)->setLineStyle(QCPGraph::lsNone);
  ui->customPlot->graph(3)->setScatterStyle(QCPScatterStyle::ssDisc);
*/
  ui->customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
  ui->customPlot->xAxis->setDateTimeFormat("hh:mm:ss");
  ui->customPlot->xAxis->setAutoTickStep(false);
  ui->customPlot->xAxis->setTickStep(2);
  ui->customPlot->axisRect()->setupFullAxesBox();

  // make left and bottom axes transfer their ranges to right and top axes:
  connect(ui->customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->xAxis2, SLOT(setRange(QCPRange)));
  connect(ui->customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->yAxis2, SLOT(setRange(QCPRange)));

    // connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed:
    connect(ui->customPlot, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(mousePress()));
    connect(ui->customPlot, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheel()));
}
开发者ID:zpcaams,项目名称:osm,代码行数:55,代码来源:mb_data_show.cpp


示例16: QCustomPlot

DrawInteraction::DrawInteraction(QWidget *parent) :
    QCustomPlot(parent)
{
    resize(600,400);

    statusBar = new QStatusBar(this);

    srand(QDateTime::currentDateTime().toTime_t());

    setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectAxes |
                                      QCP::iSelectLegend | QCP::iSelectPlottables);
    xAxis->setRange(-8, 8);
    yAxis->setRange(-5, 5);
    axisRect()->setupFullAxesBox();

    plotLayout()->insertRow(0);
    plotLayout()->addElement(0, 0, new QCPPlotTitle(this, "Interaction Example"));

    xAxis->setLabel("x Axis");
    yAxis->setLabel("y Axis");
    legend->setVisible(true);
    QFont legendFont = font();
    legendFont.setPointSize(10);
    legend->setFont(legendFont);
    legend->setSelectedFont(legendFont);
    legend->setSelectableParts(QCPLegend::spItems); // legend box shall not be selectable, only legend items

    addRandomGraph();
    addRandomGraph();
    addRandomGraph();
    addRandomGraph();

    // connect slot that ties some axis selections together (especially opposite axes):
    connect(this, SIGNAL(selectionChangedByUser()), this, SLOT(selectionChanged()));
    // connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed:
    connect(this, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(mousePress()));
    connect(this, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheel()));

    // make bottom and left axes transfer their ranges to top and right axes:
    connect(xAxis, SIGNAL(rangeChanged(QCPRange)), xAxis2, SLOT(setRange(QCPRange)));
    connect(yAxis, SIGNAL(rangeChanged(QCPRange)), yAxis2, SLOT(setRange(QCPRange)));

    // connect some interaction slots:
    connect(this, SIGNAL(titleDoubleClick(QMouseEvent*,QCPPlotTitle*)), this, SLOT(titleDoubleClick(QMouseEvent*,QCPPlotTitle*)));
    connect(this, SIGNAL(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)), this, SLOT(axisLabelDoubleClick(QCPAxis*,QCPAxis::SelectablePart)));
    connect(this, SIGNAL(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*)), this, SLOT(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*)));

    // connect slot that shows a message in the status bar when a graph is clicked:
    connect(this, SIGNAL(plottableClick(QCPAbstractPlottable*,QMouseEvent*)), this, SLOT(graphClicked(QCPAbstractPlottable*)));

    // setup policy and connect slot for context menu popup:
    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequest(QPoint)));
}
开发者ID:mayqiren,项目名称:QCustomPlotLearning,代码行数:54,代码来源:drawinteraction.cpp


示例17: QCustomPlot

QCustomPlotExt::QCustomPlotExt(QWidget *parent) :
    QCustomPlot(parent),
    marker(NULL)
{
    clearExt();
    setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
    axisRect()->setRangeDrag(Qt::Horizontal | Qt::Vertical);
    axisRect()->setRangeZoom(Qt::Horizontal | Qt::Vertical);
    connect(this, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheel(QWheelEvent*)));
    connect(xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisRangeChanged(QCPRange)));
    connect(yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisRangeChanged(QCPRange)));
}
开发者ID:idaohang,项目名称:GPXLab,代码行数:12,代码来源:qcustomplotext.cpp


示例18: connect

void histograma::ReDibujar(){
    int i=0;
    if(ui->red->isChecked()){
        ui->customPlot->addGraph();
        ui->customPlot->graph(i)->setPen(QPen(Qt::red)); // line color blue for first graph
        ui->customPlot->graph(i)->setBrush(QBrush(QColor(255, 0, 0, 20))); // first graph will be filled with translucent blue
        ui->customPlot->graph(i)->setData(*X, *R);
        i++;
     }

    if(ui->green->isChecked()){
        ui->customPlot->addGraph();
        ui->customPlot->graph(i)->setPen(QPen(Qt::green)); // line color blue for first graph
        ui->customPlot->graph(i)->setBrush(QBrush(QColor(0, 255, 0, 20))); // first graph will be filled with translucent blue
        ui->customPlot->graph(i)->setData(*X, *G);
        i++;
     }

    if(ui->blue->isChecked()){
        ui->customPlot->addGraph();
        ui->customPlot->graph(i)->setPen(QPen(Qt::blue)); // line color blue for first graph
        ui->customPlot->graph(i)->setBrush(QBrush(QColor(0, 0, 255, 20))); // first graph will be filled with translucent blue
        ui->customPlot->graph(i)->setData(*X, *B);
        i++;
     }

    if(ui->gray->isChecked()){
        ui->customPlot->addGraph();
        ui->customPlot->graph(i)->setPen(QPen(Qt::black)); // line color blue for first graph
        ui->customPlot->graph(i)->setBrush(QBrush(QColor(0, 0, 0, 20))); // first graph will be filled with translucent blue
        ui->customPlot->graph(i)->setData(*X, *Gr);
        i++;
     }




      ui->customPlot->xAxis2->setVisible(true);
      ui->customPlot->xAxis2->setTickLabels(false);
      ui->customPlot->yAxis2->setVisible(true);
      ui->customPlot->yAxis2->setTickLabels(false);
      connect(ui->customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->xAxis2, SLOT(setRange(QCPRange)));
      connect(ui->customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), ui->customPlot->yAxis2, SLOT(setRange(QCPRange)));

      ui->customPlot->graph(0)->rescaleAxes();
      ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);

      ui->customPlot->replot();


}
开发者ID:nomarlo,项目名称:analisis-de-imagenes,代码行数:51,代码来源:histograma.cpp


示例19: QCPTextElement

void smart_plot::initGraph(QCustomPlot *customPlot)
{
    //Adds axes on the top and right
    customPlot->axisRect()->setupFullAxesBox();

    //Add title
    customPlot->plotLayout()->insertRow(0);
    QCPTextElement *title = new QCPTextElement(customPlot, tr("Open Files to Plot Data"), QFont("sans", 17, QFont::Bold));
    customPlot->plotLayout()->addElement(0, 0, title);

    //Add axes labels
    customPlot->xAxis->setLabel(tr("X Axis"));
    customPlot->yAxis->setLabel(tr("Y Axis"));

    customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectAxes |
                                    QCP::iSelectLegend | QCP::iSelectPlottables | QCP::iSelectItems | QCP::iMultiSelect);

    connect(customPlot, SIGNAL(selectionChangedByUser()),
            this, SLOT(selectionChanged()));

    connect(customPlot->xAxis,SIGNAL(rangeChanged(QCPRange)),
            this, SLOT(rangeChanged(QCPRange)));

    connect(customPlot, SIGNAL(mousePress(QMouseEvent*)),
            this, SLOT(mousePress(QMouseEvent*)));

    connect(title, SIGNAL(doubleClicked(QMouseEvent*)), this, SLOT(titleDoubleClick(QMouseEvent*)));

    connect(customPlot, SIGNAL(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)),
            this, SLOT(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart)));

    connect(customPlot, SIGNAL(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*)),
            this, SLOT(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*)));

    // setup policy and connect slot for context menu popup:
    customPlot->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(customPlot, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuRequest(QPoint)));

    // make bottom x axis transfer its ranges to top x axis which is used for showing events
    connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->xAxis2, SLOT(setRange(QCPRange)));

    axisHandler.setAxisType(customPlot->xAxis, axis_handler::fixed);
    //Short Cuts!
    //Rescale to first selected plot
    //new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_R), this, SLOT(close()));
    //Rescale to first selected plot
    //new QShortcut(Qt::Key_Delete, this, SLOT(selected_remove()));
}
开发者ID:whidbey,项目名称:SmartPlot,代码行数:48,代码来源:smart_plot.cpp


示例20: checkRange

//--------------------------------------------------------------
bool ofxMuiNumberData::setRange(ofxMuiRange _range, int index) {
    if(isValidIndex(index)) {
        if(hasRange && _range == ranges[index]) return;

        
        //cout << "in range " << _range.getMin() << "/" << _range.getMax() << endl;
        
        hasRange = true;
        ranges[index] = _range;

        bool _boundsChanged = false;
        bool _rangeChanged = false;
        bool _valueChanged = false;

        checkRange(_boundsChanged, _rangeChanged, index);
        constrainValue(_valueChanged, index);

        // callbacks
        if(_valueChanged) dataChanged(index);
        rangeChanged(index);
        if(_boundsChanged) boundsChanged(index);
    

       // cout << "out range " << _range.getMin() << "/" << _range.getMax() << endl;

        
        return true;
    } else {
        return false;
    }
}
开发者ID:mark-hoo,项目名称:ofxMui,代码行数:32,代码来源:ofxMuiNumberData.cpp



注:本文中的rangeChanged函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rangelim函数代码示例发布时间:2022-05-30
下一篇:
C++ randtime函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap