Alan_K
3rd April 2011, 18:26
Hi all.
I have quite a large problem, I have no idea how to get the names of all files in the directory "data" and insert in to listWidget (addItem?). My code looks like this:
void printDialog::getFiles()
{
QDir dir("data");
if (!dir.exists())
{
qDebug() << "Komunikat: niepoprawna sciezka (data)";
QDir().mkdir("data");
QMessageBox::information(this, "Błąd", "Nie odnaleziono katalogu <i>data</i>, przez co program nie mógł dalej działać. Folder został utworzony automatycznie, aby kontynuować użyj tej funkcji jeszcze raz.");
}
else
{
// yyy... :<
}
}
I don't have any idea - nothing I have achieved.
I have quite a large problem, I have no idea how to get the names of all files in the directory "data" and insert in to listWidget (addItem?). My code looks like this:
void printDialog::getFiles()
{
QDir dir("data");
if (!dir.exists())
{
qDebug() << "Komunikat: niepoprawna sciezka (data)";
QDir().mkdir("data");
QMessageBox::information(this, "Błąd", "Nie odnaleziono katalogu <i>data</i>, przez co program nie mógł dalej działać. Folder został utworzony automatycznie, aby kontynuować użyj tej funkcji jeszcze raz.");
}
else
{
// yyy... :<
}
}
I don't have any idea - nothing I have achieved.