habe mit "geklautem" Source Code als Geruest angefangen, jetzt wollte ich mal die Includes aufraeumen. Mein altes Geruest sieht so aus:
testapp.h
Code: Alles auswählen
#ifndef TESTAPP_H
#define TESTAPP_H
#include "ui_testapp.h"
#include <QtGui>
#include <QtCore>
//Declarations here
#endif
Code: Alles auswählen
#include "testapp.h"
#include <QtGui>
#include <QtCore>
// und hier natuerlich dann noch ein wenig Coding
1. Kann es sein, dass der Designer (oder qmake) die includes fuer die Forms selbst mit einbindet. Ich komme ohne ein include von QLineEdit aus, daher meine Vermutung.
2. Im .cpp File includiere ich das .h File. Wenn ich nun im h File schon includes drin habe warum solte ich diese nochmal im cpp File aufnehmen?
3. Sollte ich includes ehr im .h File aufnehmen oder wenn sie im .h File nicht direkt gebraucht werden sollte ich sie nur im .cpp File aufnehmen?
4. Was muss ich fuer qDebug() includieren? Mein Programm funktioniert wenn ich entweder <QtGui> oder <QtCore> includiere. <QtGlobal> reicht nicht, ausserdem steht in der Doku nur "The <QtGlobal> header file provides basic declarations and is included by all other Qt headers." Hoert sich so an also ob man <QtGlobal> eigentlich nie includieren muss.
Die Fehlermeldung ist
callintegrator.cpp: In member function ?void CallIntegrator::process_line(QString)?:
/usr/include/QtCore/qglobal.h:1050: error: too few arguments to function ?void qDebug(const char*, ...)?
callintegrator.cpp:51: error: at this point in file
callintegrator.cpp:51: error: void value not ignored as it ought to be
/usr/include/QtCore/qglobal.h:1050: error: too few arguments to function ?void qDebug(const char*, ...)?
callintegrator.cpp:54: error: at this point in file
callintegrator.cpp:54: error: void value not ignored as it ought to be
/usr/include/QtCore/qglobal.h:1050: error: too few arguments to function ?void qDebug(const char*, ...)?
callintegrator.cpp:57: error: at this point in file
callintegrator.cpp:57: error: void value not ignored as it ought to be
callintegrator.cpp: In member function ?void CallIntegrator::slotSave()?:
/usr/include/QtCore/qglobal.h:1050: error: too few arguments to function ?void qDebug(const char*, ...)?
callintegrator.cpp:109: error: at this point in file
callintegrator.cpp:109: error: void value not ignored as it ought to be
make: *** [callintegrator.o] Error 1
Danke,
J.