1er real; slider x ept ok no evts no map
This commit is contained in:
parent
cd2d0b5da8
commit
3ea2e739ae
10 changed files with 317 additions and 51 deletions
48
src/qt/qtclasses.cpp
Normal file
48
src/qt/qtclasses.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#include "qtclasses.h"
|
||||
|
||||
MainWindow::MainWindow(std::vector<EndpointHandler*> *ephs, QWidget *parent) : QMainWindow(parent) {
|
||||
// setWindowState(Qt::WindowFullScreen);
|
||||
// setCentralWidget(centralWidget);
|
||||
widget = new QWidget();
|
||||
layout = new QGridLayout();
|
||||
pintas = new QLabel(tr("Defaulto da"));
|
||||
|
||||
widget->setLayout(layout);
|
||||
setCentralWidget(widget);
|
||||
layout->addWidget(pintas, 0, 0);
|
||||
|
||||
setWindowTitle("slidea resbala nu c");
|
||||
|
||||
setEndpointHandlers(ephs);
|
||||
for (unsigned int i = 0; i < this->ephs->size(); i++){
|
||||
QSlider *teSlider = new QSlider(Qt::Horizontal);
|
||||
teSlider->setFocusPolicy(Qt::StrongFocus);
|
||||
teSlider->setTickPosition(QSlider::TicksBothSides);
|
||||
teSlider->setTickInterval(5);
|
||||
teSlider->setSingleStep(1);
|
||||
layout->addWidget(teSlider, 0, i + 1);
|
||||
connect(teSlider, &QSlider::valueChanged, ephs->at(i), &EndpointHandler::setValue);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setEndpointHandlers(std::vector<EndpointHandler*> *ephs){
|
||||
this->ephs = ephs;
|
||||
}
|
||||
|
||||
/*
|
||||
* void MainWindow::setPlotButton() {
|
||||
* button = new QPushButton("push"),
|
||||
* button->setCheckable(true);
|
||||
* connect(button, SIGNAL(toggled(bool)), this, SLOT(toggled(bool)))
|
||||
* QHBoxLayout *plotsLayout = new QHBoxLayout;
|
||||
* plotsLayout->setSpacing(10);
|
||||
* plotsLayout->addWidget(funPlot);
|
||||
* QHBoxLayout *buttonsLayout = new QHBoxLayout ;
|
||||
* buttonsLayout->addWidget(button);
|
||||
* QVBoxLayout *widgetLayout = new QVBoxLayout;
|
||||
* widgetLayout->addLayout(plotsLayout);
|
||||
* widgetLayout->addLayout(buttonsLayout);
|
||||
* setLayout(widgetLayout);
|
||||
* ...
|
||||
*/
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue