Substitution of MainWindow with user ui-Form (Linux/Kdevelop)
I tried one of the two available qt4-qmake-project-templates from kdevelop.
Unfortunately they are not ui based so that i have to add/substitute
the "startup-Form" by my own.
Here is my main.cpp:
(test is the projects name)
#include <QApplication>
#include "ui_mydialog.h"
#include "test.h"
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(application);
QApplication app(argc, argv);
QDialog *window=new QDialog;
Ui::MyDialog ui;
ui.setupUi(window);
window->show();
return app.exec();
}
this creates the following errot:
main.cpp:(.text+0x1d): undefined reference to `qInitResources_application()'
I have not enough experience to figure it out myself, so i ask here.
Any ides what i should change or what i can check ?
Opensuse 10.2./ Qt4 / Kdevelop 3.5
cheers wally
Re: Substitution of MainWindow with user ui-Form (Linux/Kdevelop)
Do you have qt resource file(s) in our project?
If so: the base-name of the resource file must be within the macro
Q_INIT_RESOURCE().
You have one call for each resource file.
If not: delete the line with the macro.
Good luck
Re: Substitution of MainWindow with user ui-Form (Linux/Kdevelop)
DeepDiver,
thank you very much!
I removed the line: Q_INIT_RESOURCE(application);
I did not found a resource-file in my project
allthough there has been one in the not-modified
template project. No idea how i lost it.
It was "application.qrc" and contained the following:
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>editcopy.xpm</file>
<file>editcut.xpm</file>
<file>filenew.xpm</file>
<file>fileopen.xpm</file>
<file>editpaste.xpm</file>
<file>filesave.xpm</file>
</qresource>
</RCC>
Just for learning and curiosity:
«If so: the base-name of the resource file must be within the macro
Q_INIT_RESOURCE().
You have one call for each resource file.»
How it might looks after correcting ?
cheers wally
Re: Substitution of MainWindow with user ui-Form (Linux/Kdevelop)
you can have multiple resource files in a qt project.
Lets say you have following resource files: app_images.qrc and app_trans.qrc.
In this case you have two macro calls:
Code:
Q_INIT_RESOURCE(app_images)
Q_INIT_RESOURCE(app_trans)
Look here for more details: http://doc.trolltech.com/4.3/resources.html