Ich habe eine Qt Ui als Zeiger als Mitglied. Wenn ich versuche, das Mitglied in der cpp zuzuweisen oder zu verwenden, funktioniert es nicht.Mitglied konnte nicht verwendet werden, weil "poiner-to-incomplete"
Es gibt einige zusätzliche Code, die ich nicht zeigen, weil es nicht relevant ist.
Krypto.h:
#pragma once
#include <ui_krypto.h>
#include <QMainWindow>
class Krypto : public QMainWindow
{
Q_OBJECT
public:
Krypto(QWidget * parent = NULL);
~Krypto();
private:
Ui::Krypto * Ui = NULL; //This is the Obj which couldn`t be used
};
Krypto.cpp:
#include "Krypto.h"
Krypto::Krypto(QWidget *parent) :
QMainWindow(parent)
{
ui = new Ui::Krypto(); //This don`t work
ui->setupUi(this); //And this don`t work
}
Krypto::~Krypto()
{
delete ui;
}
ui_krypto.h:
class Ui_Krypto
{
public:
QAction *actionCode_Encode;
QAction *actionKey;
QWidget *centralWidget;
QGroupBox *CodeEncodegroupBox;
QTextEdit *textausgabe;
QTextEdit *texteingabe;
QComboBox *CBAuswahl;
QCommandLinkButton *ReadyButton;
QLineEdit *KeyCodelineEdit;
QLabel *label;
QGroupBox *KeygroupBox;
QPushButton *gKeypushButton;
QLineEdit *keylineEdit;
...
void setupUi(QMainWindow *Krypto)
{
...
}
}
namespace Ui {
class Krypto: public Ui_Krypto {};
} // namespace Ui
Sorry für die Deutsch Sprache, aber ich Hafen `t die Einstellungen gefunden dafür. Hier sind die Ausfälle:
Was bedeutet "nicht funktionieren" genannt werden? –
Also, was ist in ''? Sieht so aus, als ob die Ui :: Krypto-Klassendefinition fehlt. –
VTT
Klingt wie 'Ui :: Krypto' ist nur eine Vorwärtsdeklaration von' '. –