QString FilePath2 = QFileDialog::getOpenFileName(this, tr("Open Directory"), "C:/", tr("Text files (*.txt)"));
QDir a = FilePath2;
qDebug() << a.absolutePath();
Code works fine. But absolutePath() is still returning the path + filename instead of only path.
C:/Users/Blastcore/Desktop/text.txt instead of only C:/Users/Blastcore/Desktop
Any idea?