C++ (Qt)void FileFinder::start(const QDir& dir){ QApplication::processEvents(); QStringList listFiles = dir.entryList(m_ptxtMask->text().split(" "), QDir::Files); foreach (QString file, listFiles) { m_ptxtResult->append(dir.absoluteFilePath(file)); } QStringList listDir = dir.entryList(QDir::Dirs); foreach (QString subdir, listDir) { if (subdir == "." || subdir == "..") { continue; } start(QDir(dir.absoluteFilePath(subdir))); }}
C++ (Qt) QStringList listFiles = dir.entryList(m_ptxtMask->text().split(" "), QDir::Files);
C++ (Qt) m_ptxtDir = new QLineEdit(QDir::current().absolutePath()); m_ptxtMask = new QLineEdit("*.cpp *.h"); m_ptxtResult = new QTextEdit;
C++ (Qt)QStringList QDir::entryList(const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort) const
C++ (Qt)QStringList listFiles = dir.entryList(QStringList("*.jpg"), QDir::Files);
C++ (Qt) foreach (QString file, listFiles) { query.prepare("INSERT INTO ImageTable" "VALUES (:Name)"); query.bindValue(":Name", dir.absoluteFilePath(file) ); }
C++ (Qt) query.prepare("INSERT INTO ImageTable (Name) " "VALUES (:Name)"); foreach (QString file, listFiles) { query.bindValue(":Name", dir.absoluteFilePath(file) ); query.exec (); }