Ok!
Also noch mal zur Struktur. Ich klicke in meinen Hauptfenster auf einen BUtton, dann geht ein Dialog auf mit mehreren LineEdits. Ich will jetzt die Eingaben der LinEdits nach drücken des Buttons ok der auch im Dialog ist auswerten/abholen. die *.ui Datei habe ich mit den QT Designer erstellt! Das Programm an sich heisst Notfall und der Dialog newThread. So nun der Code:
Code: Alles auswählen
//main.cpp
#include <QtGui/QApplication>
#include "notfall.h"
#include "CppSQLite3.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//CppSQLite3DB db;
Notfall w;
w.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
Code: Alles auswählen
//notfall.cpp
#include "notfall.h"
#include "newthread.h"
Notfall::Notfall(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
}
Notfall::~Notfall()
{
}
void Notfall::on_pushButton_2_clicked()
{
newThread dialog(this);
if (dialog.exec())
{
QString name = dialog.lineEdit->text();
}
}
Code: Alles auswählen
//newThread.cpp
#include "newthread.h"
newThread::newThread(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
}
newThread::~newThread()
{
}
void newThread::on_lineEdit_3_textEdited(QString)
{
}
Code: Alles auswählen
//notfall.h
#ifndef NOTFALL_H
#define NOTFALL_H
#include <QtGui/QMainWindow>
#include "ui_notfall.h"
class Notfall : public QMainWindow
{
Q_OBJECT
public:
Notfall(QWidget *parent = 0, Qt::WFlags flags = 0);
~Notfall();
private:
Ui::NotfallClass ui;
private slots:
void on_pushButton_2_clicked();
};
#endif // NOTFALL_H
So denke das is alles die newThread.h steht ja oben.
Danke