Hi i have problem with currentPath on linux (debian).
i write simple code:
#include <QtGui/QApplication>
#include <QtGui>
#include <QtCore>
int main(int argc, char *argv[])
{
line.
setText(QDir::currentPath()); b
line.show();
return a.exec();
}
#include <QtGui/QApplication>
#include <QtGui>
#include <QtCore>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLineEdit line;
line.setText(QDir::currentPath()); b
line.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
and now if i build and execute in QtCreator then work, but if i change place binary file then he all time show my home directory (/home/username) . Why ???
Added after 1 53 minutes:
i change QDir::currentPath(); to QCoreApplication::applicationDirPath () and work correct
Bookmarks