PDA

View Full Version : kdialog and klocate problems



parsito
30th April 2007, 11:58
Hi to everyone,
I'm doing a gui using Qt3 for a program made by other guy. I made it using QtDesginer and I get .ui file. Then using uic I created the headder and .cpp files. Now I'm using Kdevelop as IDE.
I put all the files in a folder and did like this in command promp:

qmake -project
qmake testgui.pro
make

and get this error:

g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o gui_bt.o gui_bt.cpp
gui_bt.cpp:10:21: error: kdialog.h: No existe el fichero o directorio ( Doesn't exist file or directory )
gui_bt.cpp:11:21: error: klocale.h: No existe el fichero ó directorio ( Doesn't exist file or directory )
gui_bt.cpp:106:22: error: gui_bt.moc: No existe el fichero ó directorio ( Doesn't exist file or directory )
gui_bt.cpp: In member function ‘virtual void GUI_BT::languageChange()’:
gui_bt.cpp:77: error: ‘tr2i18n’ was not declared in this scope
make: *** [gui_bt.o] Error 1

I have to say that one small program like the Hello World is working perfectly doing the same steps.
Thanks for all.

high_flyer
30th April 2007, 13:10
You are using KDE widgets (which are based on Qt) and the include path is not set for them.
If you are using the KWidgets in purpose, then I guess you know that you make your app dependent of KDE - and it will not run where you can't link to kde.
If you are not doing this on pupopose, use the QWidgets (without 'K' at the beginning).
This will both eliminate your error (provided that you are including the problem q - header files) and make it cross platform.

parsito
30th April 2007, 15:28
Thank you for your answer, and sorry for this stupid error :p
I've been trying what you said and now i get this error:

g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o gui_bt.o gui_bt.cpp
gui_bt.cpp:14:22: error: gui_bt.moc: No existe el fichero ó directorio ( )
gui_bt.cpp: In member function ‘virtual void GUI_BT::languageChange()’:
gui_bt.cpp:80: error: ‘tr2i18n’ was not declared in this scope
make: *** [gui_bt.o] Error 1

I can guess that I don't have gui_bt.moc.
As I said I did the GUI using QtDesigner and the instruction uic, so, why I have this "tr2i18n" error if it's something that I just put in the GUI?? They are just names for the buttons. Here is the code for the function, maybe it can help:

void GUI_BT::languageChange()
{
setCaption( tr2i18n( "BT scanning program" ) );
Menu->setTitle( tr2i18n( "MENU" ) );
b_scan->setText( tr2i18n( "Scan" ) );
b_save->setText( tr2i18n( "Scan and Save" ) );
b_save->setAccel( QKeySequence( QString::null ) );
b_redfang->setText( tr2i18n( "RedFang" ) );
b_exit->setText( tr2i18n( "Exit" ) );
}

Thanks again for your answer.

high_flyer
30th April 2007, 15:46
The function tr2i18n() is a KDE function.
Are you sure you are not using KDE Widgets (available in Designer) on your Dialog?

After this is sortes out, we can deal with the uic problem.

Hmm. I am not sure I fully understand the stucture of your project.
Could you explain it in a bit more detail?

parsito
30th April 2007, 17:36
ok, yes, maybe is better if I explain everything better.
I have to do a GUI for a program made by other guy. The original program is made using C language.
I was thinking about how to do it using C++ and after some research I decided to do it using Qt libraries because I'm in kubuntu. For the same reason I'm using Kdevelop as IDE.
First I did the GUI with QtDesigner and get the .ui file. Using uic I get both the .h and the .cpp files. And then I went to KDevelop.
Using KDevelop I did 3 files more: another .h and .cpp and also a main.cpp. I did this following one book.
So, finally I have 5 files: gui_bt.h, gui_bt.cpp, gui.h, gui.cpp and main.cpp.
Probably, as you said, when I was creating the GUI with QtDesigner I used KDE Widgets without knowing it. The problem is now how I have to compile the project and how I have to run it if I have all this mistakes, mixing QWidgets and KWidgets.....
The only thing I'm doing now is trying to compile the project and run it. Just the GUI. I didn't do all the program, cause I have to match the program with my GUI yet. I put the bottoms I need for the menu, but the functions are not implemented yet, I just have the functions empty.
I know that I don't know anything about how to use this libraies and the programs, that's why I would like to say to you thanks a lot for your help.

high_flyer
30th April 2007, 18:02
Why are you using Qt3 and not Qt then?

It will be much easier if you start all over, than for us to help you "patch -up" your project.
You can do all you did in a much simpler way:
Open KDevelop.
Project->new Project
Select QMake Project with a "Hello World" Template.
In the make manager right click on the project, and "run qmake".
Then build.
If your project compiled then:
To add new source and hader files, just right click "headers" or "sources" in the project manager on the right, and choose "add new".
The ui you can add the same way, just choose "add existing".

Post again if you have problems.

parsito
3rd May 2007, 12:51
Hi high_flyer,
thanks a lot for your help. I did my project again from the beginning and everything is fine at the moment. It works and I could compile it without any problem.
As you said, I did it wrong the first time because I was mixing KWidgets and QWidgets. Now i did It taking care about that and everything worked without problems.
But now I have a problem with the actions of the menu.
In the GUI there is a menu, 4 bottoms, each one is doing one actions, but I want the actions, all the results of that actions, appear in the GUI, in one on the areas that I create for that. Now, all the results are appearing in the terminal, not in the GUI. These areas are QTextEdit, but I don't know if there is another element to put instead of textEdit to do it, to do that the results appear in this area. Or maybe I missed some instruction....
Thanks a lot again.

high_flyer
3rd May 2007, 13:00
all the results of that actions, appear in the GUI,
Please understand that we have no knowledge of what you are doing.
What are the "results" and what did you do to have them on the GUI?
As far as I understand, your GUI communicates with a console application - is that correct?
Does the infomation flow from the non GUI application to your GUI application work ok?
Could you explain how you did that?

Relevant code segements with explanations could help.

parsito
3rd May 2007, 18:39
Sorry again for my really bad explanation. I'm not used to post in a forum like this one.
Let's try to do it better:
I had one program made in C language by another guy. All the results of that program appear in the terminal console. Also the program creates 3 files with the information. Now, I created the GUI and directly put the code of the original program in the menu, in each function on each button without changing anything. So, the program is working perfectly because when I press the buttons of the GUI they do what they has to do, but the results are still appearing in the terminal console, like before, not in the TextEdit that I put in the GUI.
I know that is because there is no connection between both, my textEdit and the code of the original program because I did nothing, I just put the original code in each function of each button of the GUI. The code of the first function for example is like this:

Button Scan

void BTScanning::scan()
{
system("hcitool scan");
}

This function scans an area looking for some bluetooth devices that are connected, and the result of this function, once I press the button of the menu in the GUI appears in the terminal console, not in the textEdit area of the GUI.
How can I do this? how can I "put" what appears in the terminal in that area of the GUI? How can I connect both?
Thanks a lot again for your help.

high_flyer
4th May 2007, 10:29
Ok, now I see.
Well, basically what you want is to read the output from the console, and diplay it in your gui -if I undertood you correctly.
I see you are using the system() function, in Qt you will have to use the QProcess class to be able to tap to the stdio.
Read the docs about it, and ask again when you get stuck.

parsito
4th May 2007, 14:04
I've been reading the doc. for the QProcess class and I've been trying different things.
Now I have like this in my .cpp file:

first the include for the class

#include <qprocess.h>

then the place where I want that the results appear:
te_results = new QTextEdit( this, "te_results" );
te_results->setGeometry( QRect( 250, 180, 341, 281 ) );

then the connection with the function scan():
connect( pb_scan, SIGNAL( clicked() ), this, SLOT( scan() ) );
pb_scan is the name of the button

and finally the function scan():
void BTScanning::scan()
{
QProcess *process = new QProcess(this);
QByteArray exit;

process->addArgument("hcitool scan");

exit->readAllStadardOutput();

process->start();
}

But It appears one error like this when I'm trying to compile the project:
btscanning.cpp: In member function ‘virtual void BTScanning::scan()’:
btscanning.cpp:90: error: base operand of ‘->’ has non-pointer type ‘QByteArray’

I tried a lot of different things:
exit = process->start("hcitool scan");
connect(process, SIGNAL((hcitool scan)), this, SLOT("te_results"));

but nothings works...can you please help me. What I'm doing wrong? Thank you.

high_flyer
4th May 2007, 14:23
btscanning.cpp:90: error: base operand of ‘->’ has non-pointer type ‘QByteArray’

That is because 'exit' is not a pointer, you should have use '.' and not '->'.
But look you used it wrong as well.
You should do something like:


void BTScanning::scan()
{
QProcess *process = new QProcess(this);
QByteArray exit;
process->addArgument("hcitool scan");
process->start()
if (!process->waitForStarted())
{
//some error notification
return;
}
process->waitForReadyRead();
exit = process->readAll();
//now you have your data in 'exit' - you can put it in a string and on to a textedit

}

parsito
6th May 2007, 18:52
Hi,
now I know what I was doing wrong. I was looking for the functions in the page that you gave to me:
http://doc.trolltech.com/4.2/qprocess.html

but the problem is that I'm not using Qt4, I'm using Qt3 so the page where I have to look for the functions is:
http://doc.trolltech.com/4.0/q3process.html

At the beginning I did the function as you put in the previous post and It appears this error:
btscanning.cpp:91: error: ‘class QProcess’ has no member named ‘waitForStarted’
btscanning.cpp:97: error: ‘class QProcess’ has no member named ‘waitForReadyRead’
btscanning.cpp:99: error: ‘class QProcess’ has no member named ‘readAll’

after that, I was looking through Trooltech page and I found the page that I put before.
I know it was a stupid mistake but I'm trying to do this project for a long time and I'm starting to be really frustrated.
I want to ask you about your opinion. Do you thing that I have to continue with Qt3 or I have to change to Qt4?
Now that I nearly finish the project I'm a little bit scared of changing anything but If it will be better for me I can install Qt4 instead of Qt3.
Thanks a lot.

wysota
6th May 2007, 20:44
Do you thing that I have to continue with Qt3 or I have to change to Qt4?
You can continue with Qt3 but you can also switch to Qt4.

Now that I nearly finish the project I'm a little bit scared of changing anything but If it will be better for me I can install Qt4 instead of Qt3.
There is a porting tool (qt3to4) that comes with Qt4 which does some basic translation from Qt3 to Qt4 code so porting should take no more than an hour, but you don't need to switch to Qt4 if the only problem is QProcess. Instead of doing it the synchronous way (waitForStarted(), etc.) connect a slot to processExited() or readyReadStdout() signal and redirect the output to your GUI widget.

parsito
8th May 2007, 11:50
Hi again,
how can I convert one ByeteArray into a String to put it in the textEdit widget of the GUI? I'm trying to do like this:


QProcess *process = new QProcess(this);
QByteArray exit;
QString res;

process->addArgument("hcitool scan");
process->start();

exit = process->readStdout();
//Here convert the bytearray "exit" into the string "res"
te_results->insertParagraph(res,-1);

Am I doing it wrong? I'm doing it like this because I found the insertPragraph and is the only way that I see to make the results appear in the textEdit widget of the gui.

high_flyer
8th May 2007, 11:56
just do:

te_results->insertParagraph(QString(exit),-1);

parsito
8th May 2007, 12:37
I did what you said, but nothing appear in the widget. The program compiles without problems so I can guess that I have the output in variable exit, but nothing appear in the widget te_results of the gui.:confused:

wysota
8th May 2007, 13:01
Did you read my note about asynchronousness of the whole operation? Because lines 6-8 of your last code snippet suggest you didn't.

parsito
8th May 2007, 16:37
I'm sorry wysota, but I don't know how to asynchronize the whole operation.
I tried doing something like this:

BTScanning::BTScanning( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{

QProcess *process = new QProcess(this);

te_results = new QTextEdit( this, "te_results" );
te_results->setGeometry( QRect( 250, 180, 341, 281 ) );

..........
/*here the connection between the process and the widget*/
connect( process, SIGNAL( readyReadStdout() ), te_results, SLOT( scan() ) );
}

and now the function scan():

void BTScanning::scan()
{
QProcess *process = new QProcess(this);
QByteArray exit;

process->addArgument("hcitool scan");
exit = process->readStdout();
te_results->insertParagraph(QString(exit),-1);
}

I compile it without problems and the result is:

QObject::connect: No such slot QTextEdit::scan()
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'te_results')

and when I press the Scan button, nothing appear anywhere.
Can you please tell me what I'm doing wrong or how I have to do It? thank you very much.

wysota
8th May 2007, 23:34
You could start by reading QProcess docs. There even is a snippet of code there that does what you're trying to achieve.

I completely don't understand why you're creating a new QProcess object in scan() :) Where do you start the process anyway?

parsito
9th May 2007, 13:53
Ok, I know that what i put here yesterday doesn't have any sense. After reading the QProcess, I can see that I did wrong from the beginning, isn't It?
I created the .ui file using QTDesigner and then, using uic command I created the header and the .cpp files from that .ui file.
After that I created the main.cpp and It worked perfectly but I started to have problems when I tried that the buttons of the GUI do something.
So I don't have to do my project like I did? I dont have to create the .cpp and .h files?
I'm completely lost :eek: I really need your help.....

I'm doing other things. Now I'm creating the new QPocess object into the BTScanning function like this:

BTScanning::BTScanning( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
QProcess *process = new QProcess(this);

then I creat the textEdit:
te_results = new QTextEdit( this, "te_results" );
te_results->setGeometry( QRect( 250, 180, 341, 281 ) );

the button:
pb_save = new QPushButton( Menu, "pb_save" );
pb_save->setGeometry( QRect( 40, 100, 112, 24 ) );

and I connect the button with the slot:
connect( pb_scan, SIGNAL( clicked() ), this, SLOT( scan() ) );

and scan() function is like this:
void BTScanning::scan()
{
QByteArray exit;
process->addArgument("hcitool scan");
exit = process->readStdout();
te_results->insertParagraph(QString(exit),-1);
}

and it appears the error:
btscanning.cpp: In constructor ‘BTScanning::BTScanning(QWidget*, const char*, uint)’:
btscanning.cpp:35: warning: unused variable ‘process’
btscanning.cpp: In member function ‘virtual void BTScanning::scan()’:
btscanning.cpp:97: error: ‘process’ was not declared in this scope

the problem is that if I solve It, If I put the lines:
QByteArray exit;
process->addArgument("hcitool scan");
exit = process->readStdout();
out of the scan() function, into the BTScanning function, and let the scan() function like this:
void BTScanning::scan()
{
te_results->insertParagraph(QString(exit),-1);
}
it appears this error:
btscanning.cpp:100: error: no matching function for call to ‘QString::QString(<unresolved overloaded function type>)’
/usr/include/qt3/qstring.h:746: note: candidates are: QString::QString(QStringData*, bool)
/usr/include/qt3/qstring.h:720: note: QString::QString(int, bool)
/usr/include/qt3/qstring.h:409: note: QString::QString(const std::string&)
/usr/include/qt3/qstring.h:406: note: QString::QString(const char*)
/usr/include/qt3/qstring.h:404: note: QString::QString(const QChar*, uint)
/usr/include/qt3/qstring.h:403: note: QString::QString(const QByteArray&)
/usr/include/qt3/qstring.h:402: note: QString::QString(const QString&)
/usr/include/qt3/qstring.h:401: note: QString::QString(QChar)
/usr/include/qt3/qstring.h:838: note: QString::QString()

but if I do this:
te_results->insertParagraph(QString("exit"),-1);
every time I press the button it appears in the textEdit area the word "exit".

I think that I'm not making any difference between all buttons of the menu.
How I have to do this difference? Each button has to do a different action, but If I create the object process into the BTScanning function I'm not doing this difference....

wysota
10th May 2007, 23:44
void BTScanning::scan()
{
QByteArray exit;
process->addArgument("hcitool scan");
exit = process->readStdout();
te_results->insertParagraph(QString(exit),-1);
}
This still sucks. You insert wrong arguments, you don't start the process and you don't wait until it has something to tell you... Try this:

void BTScanning::scan(){
process->addArgument("hcitool");
process->addArgument("scan");
connect(process, SIGNAL(readyReadStdout()), this, SLOT(onProcessReadyRead()));
process->start();
}

void BTScanning::onProcessReadyRead(){
QProcess *process = (QProcess*)sender();
while(process->canReadLineStdout()){
te_results->insertParagraph(process->readLineStdout(), -1);
}
if(process->normalExit()){
te_results->insertParagraph(process->readStdout(), -1);
}
}

parsito
11th May 2007, 14:22
Thanks wysota for your help. now everything works perfectly. It compiles and works...thank you very much.
And also thanks for high_flyer for your help at the beginning, you helped me a lot with my firsts steps.

wysota
11th May 2007, 14:53
Have you noticed the errors you had made (especially the fact that the process didn't have a chance to start at all)?

parsito
11th May 2007, 17:53
yes, now I know how I have to add the arguments to the process and how I have to connect it to the signal and the slot and start it. And also is more clear why I have to wait to read from the process.
But now i have one question, what about if what I want to do is to ask something to the user of the program and then read the answer from the gui?
As I can guess, I have to start the process in the same way as before, and then create another function in the same way as onProcessReadyRead() and inside this function is where I have to read the value, isn't It?
thanks again.

wysota
11th May 2007, 21:34
You can write to standard input of a process just like you read from its standard output, if that was your question...

parsito
11th May 2007, 22:21
Ok, I can write to the standard input of the process, and also I know how to pass the arguments to the process.
The problem is that I have to ask for three values to the user of the program. The three questions have to appear on the textEdit area of the GUI, one after another, and after each question I have to wait for the answer and get the value that the user types into the textEdit area. I know how to do that the questions appears into the textEdit area, but I don't know how to take the values after each question and put these values into the process as an input value, to add it using addArgument() to the process.
Can anybody help me?

wysota
11th May 2007, 22:26
You want the values to be passed as arguments to the process or to be written to the process standard input?

parsito
12th May 2007, 01:10
To be passed to the process as arguments, like:

proc->addArgument("value_written_by_the_user");

wysota
12th May 2007, 11:55
Ask the user through a dialog or other layout of lineedits about the values and then fire the slot where you start the process and add those values as arguments for the process.

parsito
12th May 2007, 18:18
I'm sorry but now I'm completely lost. I created the dialog as you said, to ask the user about the values that I need, and now I have the file fedfangdialog.ui , when I compile the main project as always, It appear automatically two files: redfangdialog.h and redfangdialog.cpp.
And now my question.
What I want that the project does is:
I have one main GUI, with the menu and the textEdit areas. Now, as I can guess, what I have to achieve is that one of the buttons, the redFang button, launch the redfangdialog dialog.
I put in the redfangdialog one button to start all the process, to do that the values that the user enters in the lineedit areas, they have to "come back" to the slot of the button of the main GUI, where I have to add them as arguments to the redfang process.
Another option is that the redfangdialog runs the redfang process with the arguments that the user has entered into the lineEdit areas. The problem is that I still don't know how to run the redfangdialog from the main GUI, when i press the button of the menu.
I don't know how to deal with It :confused:
Can anybody help me please?

wysota
12th May 2007, 19:51
First you ask the user for values, then you start the process and then you display results. So when you click the button that starts the process, the values should already be in line edits, so you can read them and start the process. You don't need any slots to read values from line edits.

parsito
13th May 2007, 18:28
Ok, I decided to do It in this way. I created the dialog to ask the user for the values, with lineEdits and one button that I decides that will run the process. So, what I was looking for was to launch the other dialog in the redFang button of the main menu. I did It like this:
I added in main.cpp and in btscanning.cpp, the include: #include "redfangdialog.h", and in the slot of the button of the main menu I did:
static Form1 *dialog = new Form1(this);
dialog->show();
dialog->setActiveWindow();
dialog->raise();

and the dialog appears, but it appears in the same window of the other gui, and it hides everything.I want that the dialog appears in another window, how can I do it?

wysota
13th May 2007, 20:14
Does "Form1" inherit QDialog (please check, don't guess)?

parsito
13th May 2007, 21:31
I'm sorry, I did it wrong. It was a QWidget.......now is working perfectly, thank you.:)

parsito
13th May 2007, 21:41
Sorry, but I have another question. I have also one Exit button that is like this:
void BTScanning::exit()
{
close();
}

but it only close the GUI, it doesn't kill the process in the computer. I have to press "Ctrl+C" to kill the process in the command promp.
Is there any way to kill the process at the same time that I close the GUI inside the slot?

wysota
13th May 2007, 21:52
Yes. Connect the lastWindowClosed() signal of the application object to its quit() slot.

parsito
15th May 2007, 13:46
Hi again,
I have another little problem with one of the buttons of the GUI. I'll try to explain. I have the redFang Dialog where I asked for the values to the user using lineedits and getting the values when the user presses the button. The process that I have to launch then is a program that is in the same directory of the project but in another folder.
the project is in a folder named proj. then, inside this folder I have another one called redfang-2.5, in this way proj/redfang-2.5, and inside there is the file called fang, that is the file I have to run.
So I did like this inside the dialog:
QString max_val;
QString min_val;
QString time;
QDir dir;

max_val = max_add->text();
min_val = min_add->text();
time = timeout->text();


dir.cd("redfang-2.5");
process->addArgument("fang");
process->addArgument("-n");
process->addArgument("1");
process->addArgument("-r");
process->addArgument("0016755116A8");
process->addArgument("-0016755116AA");
process->addArgument("-t");
process->addArgument("5000");//%d es el timeout

connect(process, SIGNAL( readyReadStdout() ), this, SLOT( onRedFangReadyRead() ) );

process->start();// starts RedFang program

if(!process->start())
te_resul->insertParagraph(QString("proc is not running"),-1);

and then i created the onRedFangReadyRead() slot like this:
QProcess *process = (QProcess*)sender();

while(process->canReadLineStdout()){
te_resul->insertParagraph(process->readLineStdout(), -1);
}

if(process->normalExit()){
te_resul->insertParagraph(process->readStdout(), -1);
}

everything compiles good, but the result in te_resul area is "proc is not running".

The input for the redfang program has to be:
fang -n 1 -r %s-%s -t %d where %s are tho chars[25] and the %d is an integer for the timeout.
The problem is that I have to put strings as arguments for the process.....and also, i don't know if the path for the fang file is ok like I put.
Can anybody help me?

wysota
16th May 2007, 09:27
No, the path is not ok. System won't be able to find your program. You have to provide a correct path or put the program into system $PATH

parsito
16th May 2007, 13:24
I want to put the relative path but still doesn't work.......can you please tell me how to do It or where can I find some examples? Because I have found some of them but I tried everything and it doesn't work.

dir.cd("redfang-2.5/fang")
process->addArgument("fang");
process->addArgument("-n");
process->addArgument("1");
process->addArgument("-r");
process->addArgument("0016755116A8");
process->addArgument("-0016755116AA");
process->addArgument("-t");
process->addArgument("5000");

wysota
16th May 2007, 13:40
Just make sure the path is correct. Try
process->addArgument("redfang-2.5/fang/fang");
or something like that.

parsito
16th May 2007, 14:37
The exec file of the program is called "fang" and is directly inside the redfang-2.5 folder. So I put:
process->arrArgument("redfang-2.5/fang");
but is nor working, the message is still "proc is not running".
to run the process directly in the command promp what I have to put is:
redfang-2.5/fang -n 1 -r %s-%s -t %d

where %s are two strings and %d is an integer.
I did this:
process->addArgument("redfang-2.5/fang");
process->addArgument("-n");
process->addArgument("1");
process->addArgument("-r");
process->addArgument("0016755116A8");
process->addArgument("-0016755116AA");
process->addArgument("-t");
process->addArgument("5000");
but still "proc is not running"

wysota
16th May 2007, 17:39
Please first check what is the current working directory of the application while running. Don't assume you think what it is, just check it. If you can't handle it, just copy or link the application to the directory where your main binary resides.

parsito
16th May 2007, 19:39
Finally I put the absolute path of the application an It works.......thank you very much for everything.
I've been thinking about this problem that I had with the path. Is impossible to put the relative path of the program? I tried a lot of different combinations and nothing worked, it only works with the absolute path and this is not really useful for an open source program that will go from one computer to another, isn't it?
The other question is about lineedits. What you can get from a lineedit is a string, just doing lineedit->text(); but what happens if what I have to get from the lineedit is an integer? Is possible to get an integer as an integer, not as a string, from the lineedit? How?
Thanks a lot for your help.

wysota
16th May 2007, 20:09
You can use a path relative to the application path by using QApplication::applicationDirPath()

As for the integer - convert the string to integer or use a spin box.

parsito
21st May 2007, 22:01
Hi, I would like to say thank you for everything. Now the project is working perfectly. I would like to thank everyone who have helped me.
I have to say that when I started the project I had no idea about Qt language but now I know how useful it is and I will try other things with it, other projects.
Thanks a lot again.

high_flyer
22nd May 2007, 09:29
Qt language
Except, there is no Qt language... ;)