Daten übertragung



  • Ich bin mir nicht sicher ob es ein mehr mit c oder mit qt zu tun hat.
    Aber ich bekomme es nicht gebacken das meine neue projekt.ui eine Variable an tpopt.ui schickt.
    Habe es so versucht : wobei ich dann nur den Wert 0 aus dem Konstruktor erhalte

    class projektop : public QDialog
    {
    Q_OBJECT
    
    public:
    int uk;
    …
    
    projektop::projektop(QDialog *parent)
    	: QDialog(parent)
    {
    	u.setupUi(this);
    	uk=0;
    …
    class tpopt : public QMainWindow
    {
    Q_OBJECT
    public:
    	Ui::tpoptClass ui;
    		projektop projektop1;
    

    Und uk dann über projektop1.uk aufrufe.
    Und ich habe es mit Signalen versucht, doch es kommt nichts an.

    class projektop : public QDialog
    {
    Q_OBJECT
    
    public:
    	projektop(QDialog *parent = 0);
    	~projektop();
    signals:
    	void send();
    …
    class tpopt : public QMainWindow
    {
    Q_OBJECT
    public slots:
    	void it();
    …
    class tpopt : public QMainWindow
    {
    Q_OBJECT
    
    public:
    	tpopt(QWidget *parent = 0, Qt::WFlags flags = 0);
    	~tpopt();
    	projektop projektop1;
    …
    tpopt::tpopt(QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags)
    {
    ui.setupUi(this);
    connect(&projektop1, SIGNAL(send()), this, SLOT(it()));
    …
    

    Ich habe keine idee mehr..

    Edit: Fehler gefunden
    projektop *www;
    www = new projektop()
    connect(www, SIGNAL(send()), this, SLOT(it()));

    da ich das neue fenster auch mit www.show aufrufe. sry fürs posten


Anmelden zum Antworten