Пример #1
0
void PlotWindow::beginSelection(const QPointF& point)
{
	_plot_picker1->setEnabled(false);
	if (_x_axis_measurement->currentIndex() == 0) // time
		emit beginSelection(_data_log->indexFromTime(point.x()));
	else // distance
		emit beginSelection(_data_log->indexFromDist(point.x()));
}
Пример #2
0
void HotPointView::createActions()
{
	resetSelectionAct = new QAction( QString::fromUtf8( "Resetuj zaznaczenie" ), this );
	connect( resetSelectionAct, SIGNAL( triggered() ), this, SLOT( resetSelection() ) );

	beginSelectionAct = new QAction( QString::fromUtf8( "Wyznacz histogram" ), this );
	connect( beginSelectionAct, SIGNAL( triggered() ), this, SLOT( beginSelection() ) );
}
Пример #3
0
PlotFrame::PlotFrame(QWidget *parent) :
    QFrame(parent), ui(new Ui::PlotFrame), plotScene(NULL), plotView(NULL)
{
    // GUI Configuration
    ui->setupUi(this);

    // Create scene
    this->plotScene = new PlotScene(this);

    // Create view
    this->plotView = new PlotView(this->plotScene);
    this->plotView->setAutoFillBackground(true);
    this->plotView->setRenderHint(QPainter::Antialiasing);
    this->plotView->setSizePolicy(QSizePolicy::Expanding,
                                  QSizePolicy::Expanding);

    // Layouts configuration
    this->topScaleLayout    = new QVBoxLayout;
    this->bottomScaleLayout = new QVBoxLayout;
    this->leftScaleLayout   = new QHBoxLayout;
    this->rightScaleLayout  = new QHBoxLayout;

    this->ui->plotLayout->addLayout(this->topScaleLayout, 0, 1, 1, 3);
    this->ui->plotLayout->addLayout(this->bottomScaleLayout, 5, 1, 1, 3);
    this->ui->plotLayout->addLayout(this->leftScaleLayout, 1, 0, 3, 1);
    this->ui->plotLayout->addLayout(this->rightScaleLayout, 1, 5, 3, 1);
    this->ui->plotLayout->addWidget(this->plotView, 1, 1, 3, 3);

    // Manage tool button state
    this->ui->showCurvesToolButton->setChecked(
                this->plotScene->curvesAreVisible());
    this->ui->showPointsToolButton->setChecked(
                this->plotScene->pointsAreVisible());
    this->ui->showLineToolButton->setChecked(
                this->plotScene->curveLabelsAreVisible());

    // Connect GUI signals to slots | Use autoconnect and call scene slots ?
    connect(this->ui->showCurvesToolButton, SIGNAL(toggled(bool)),
            this->plotScene, SLOT(setCurvesVisible(bool)));
    connect(this->ui->showPointsToolButton, SIGNAL(toggled(bool)),
            this->plotScene, SLOT(setPointsVisible(bool)));
    connect(this->ui->zoomOutToolButton, SIGNAL(clicked()),
            this->plotView, SLOT(zoomOut()));

    // Connect signals and slots of view and scene
    connect(this->plotView, SIGNAL(rectChange(QRectF)),
            this, SLOT(adaptScales(QRectF)));
    connect(this->plotView, SIGNAL(beginSelection()),
            this->plotScene, SLOT(lockSelectionAbility()));
    connect(this->plotView, SIGNAL(finishSelection()),
            this->plotScene, SLOT(unlockSelectionAbility()));
    connect(this->plotView, SIGNAL(mousePosChanged(QPointF,QPointF)),
            this->plotScene, SLOT(displayLabels(QPointF,QPointF)));
    connect(this->plotView, SIGNAL(mousePressed(QPointF)),
            this->plotScene, SLOT(slotDeTest(QPointF)));

    setMouseTracking(true);
}