Problem mit Funktionsaufruf.
Verfasst: 26. Oktober 2006 14:07
Hi,
mein Problem ist folgendes. Ich habe einmal die Datei "main.cpp" und "ui_untitled.h".
main.cpp
Dabei kommt folgender Compiler-Fehler:
main.cpp:380: error: `ui' was not declared in this scope
main.cpp:380: warning: unused variable 'ui'
"Wieso das kommt" ist mir klar. Aber wie mach ich es richtig?
mein Problem ist folgendes. Ich habe einmal die Datei "main.cpp" und "ui_untitled.h".
main.cpp
Code: Alles auswählen
.......
QApplication app(argc, argv);
QMainWindow *window = new QMainWindow();
Ui::MainWindow ui;
ui.setupUi(window);
window->show();
return app.exec();
.......
......
.......
void Funktionen::testfunktion()
{
for(int i=0; i<name_counter; i++)
{
//cout<<array[i][0]<<" "<<array[i][1]<<endl;
}
ui.comboBox->addItem("test1");
}
main.cpp:380: error: `ui' was not declared in this scope
main.cpp:380: warning: unused variable 'ui'
"Wieso das kommt" ist mir klar. Aber wie mach ich es richtig?