ich mache meine ersten Gehversuche mit Qt4 und leider auch C++.
Ich habe mir diverse Beispiele angesehen und nun versucht, ein ganz simples Programm selbst zu schreiben.
Also, zuerst mit Designer4 ein Fenster vom Typ QDialog erstellt und im File imagedialog.ui gespeichert. Das Objekt darin heißt ImageDialog3.
Jetzt die Dateien:
File imagedialog3.h :
Code: Alles auswählen
#ifndef IMAGEDIALOG4_H
#define IMAGEDIALOG4_H
#include "ui_imagedialog.h"
class ImageDialog3 : public QDialog, private UI:ImageDialog3
{
Q_OBJECT
public:
ImageDialog3(QDialog *parent = 0);
}
#endifCode: Alles auswählen
#include <QtGui>
#include "imagedialog3.h"
ImageDialog3::ImageDialog3(QDialog *parent)
: QDialog(parent)
{
setupUi(this);
}
Code: Alles auswählen
#include <QApplication>
#include "imagedialog3.h"
int main()
{
QApplication app();
ImageDialog3 mywindow;
mywindow.show;
return app.exec();
}
qmake -project --> Projektdatei wird erzeugt
qmake --> Makefile wird erzeugt
make --> folgende Fehlermeldungen:
imagedialog3.h:6: error: expected class-name before ':' token
imagedialog3.h:6: error: expected `{' before ':' token
imagedialog3.h:6: error: expected unqualified-id before ':' token
imagedialog3.cpp:4: error: invalid use of undefined type 'class ImageDialog3'
imagedialog3.h:6: error: forward declaration of 'class ImageDialog3'
imagedialog3.cpp: In constructor 'ImageDialog3::ImageDialog3(QDialog*)':
imagedialog3.cpp:7: error: 'setupUi' was not declared in this scope
Warum wird ImageDialog3 nicht als Klassenname akzeptiert/erkannt?
Vielleicht lacht sich jetzt jemand kaputt, aber ich stehe total auf dem Schlauch.
Tipps äußerst willkommen, Danke!