ich bin gerade dabei ein Widget zum Plotten von Messdaten zu schreiben und soweit sieht alles auch wunderbar aus. Hier einmal der Constructor meines Widgets:
Code: Alles auswählen
QPlot::QPlot(QWidget *parent) : QWidget(parent)
{
// Create vertical layout
QVBoxLayout *vlayout = new QVBoxLayout(this);
// Set vertical layout margin to zero
vlayout->setMargin(0);
// Create horizontal layout
QHBoxLayout *hlayout = new QHBoxLayout(this);
// Set horizontal layout to zero
hlayout->setMargin(0);
hlayout->setSpacing(20);
// Add horizontal layout to vertical layout
vlayout->addItem(hlayout);
m_pbPause = new QPushButton("Pause", this);
hlayout->addWidget(m_pbPause);
m_pbElementCount = new QPushButton("Plot speed: 0", this);
hlayout->addWidget(m_pbElementCount);
connect (m_pbElementCount, SIGNAL (clicked()), this, SLOT(on_m_pbElementCount_clicked()));
m_pbAutoScale = new QPushButton("AutoScale", this);
hlayout->addWidget(m_pbAutoScale);
// Create new GL plot
m_glplot = new QGLPlot(this);
// Add glPlot to vertical layout
vlayout->addWidget(m_glplot);
}
Zur besseren Übersicht möchte ich zudem einen Plot "minimieren" können, damit der andere mehr Platz für die Anzeige bekommt. Das funktioniert leider nicht (vgl. Anhang 1 --> Anhang 2).
Hoffe jemand hat eine Idee,
beste Grüße,
Mike