Ich starte in main.cpp
Code: Alles auswählen
#include <QApplication>
#include "mainwindow.h"
#include "startup.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Startup startup;
startup.show();
return app.exec();
}
mainwindow.h
Code: Alles auswählen
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QLabel>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
private:
QLabel *headline;
};
#endif
Code: Alles auswählen
#include "mainwindow.h"
MainWindow::MainWindow()
{
setCentralWidget(headline);
// this->resize();
}
Ich hätte an einen Slot gedacht:
Code: Alles auswählen
connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
void Startup::okClicked()
{
if (radio->isChecked() == true)
{
MainWindow mainWindow;
mainWindow.show();
}
}Zusatz: Wie schaffe ich es, dass das MainWindow genauso groß wird, dass das enthaltene QTableView keine Scrollbars mehr hat?
Danke schonmal!