ich hab folgendes Problem. Sobald ich die Zeilen mit "central_layout.addLayout" einkommentiere startet das Programm nicht mehr richtig. Es startet zwar, zeigt aber keine GUI und beendet sich mit der Zeit von selbst wieder. Ich hab keine Ahnung woran dies liegt, es gibt weder eine Fehlermeldung noch Probleme beim compilieren.
Code: Alles auswählen
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "MainWindow.h"
#include "AccWidget.h"
#include "PaintWidget.h"
MainWindow::MainWindow() {
setFixedSize(640,350);
setWindowTitle("Line Hough");
QHBoxLayout top_layout;
top_layout.addWidget(new PaintWidget());
top_layout.addWidget(new AccWidget());
QPushButton start_button("Start");
QPushButton reset_button("Reset");
QHBoxLayout bottom_layout;
bottom_layout.addWidget(&start_button);
bottom_layout.addWidget(&reset_button);
QVBoxLayout central_layout;
// central_layout.addLayout(&top_layout);
// central_layout.addLayout(&bottom_layout);
setLayout(¢ral_layout);
}