Thanks Jacek.
I don't know how to implement your suggestion
|
Source code
|
1
|
QApplication::applicationDirPath().
|
I put <,application.h> in my "dlgmain.cpp" file and changed code as follows
|
Source code
|
1
2
3
|
k = QApplication::applicationDirPath();
//k = QDir::currentDirPath();
k.append( "/jobs/" + projectIndex + "/" + f );
|
and got the error message
|
Source code
|
1
|
dlgmain.cpp:905: error: cannot call member function `QString QApplication::applicationDirPath()' without object
|
I then put
|
Source code
|
1
|
QApplication myApp = new QApplication( this );
|
in the "dlgmain.cpp" constructor and revised the code to
|
Source code
|
1
2
3
|
k = myApp.applicationDirPath();
//k = QDir::currentDirPath();
k.append( "/jobs/" + projectIndex + "/" + f );
|
and my error was
|
Source code
|
1
2
3
4
5
6
7
|
usr/lib/qt-3.3/include/qapplication.h:435: note: candidates are: QApplication::QApplication(const QApplication&)
/usr/lib/qt-3.3/include/qapplication.h:81: note: QApplication::QApplication(Display*, int,char**, long unsigned int, long unsigned int)
/usr/lib/qt-3.3/include/qapplication.h:79: note: QApplication::QApplication(Display*, longunsigned int, long unsigned int)
/usr/lib/qt-3.3/include/qapplication.h:77: note: QApplication::QApplication(int&, char**, QApplication::Type)
/usr/lib/qt-3.3/include/qapplication.h:75: note: QApplication::QApplication(int&, char**, bool)
/usr/lib/qt-3.3/include/qapplication.h:74: note: QApplication::QApplication(int&, char**)
dlgmain.cpp:167: warning: unused variable 'myApp'
|
ObviouslyI don't know how to implement your suggestion. Do I have to place it in "main.cpp" and to be able to use it in "dlgmain.cpp" and other ".cpp" files? If so what would be the code? This problem has been bothering me for a long time and Marioo's thread got my attention. (Thanks Marioo)