10 #include <QtGui/QDragEnterEvent> 11 #include <QtCore/QRegExp> 12 #include <QtCore/QUrl> 18 QWidget(parent, flags)
29 if (event->mimeData()->hasUrls())
31 event->acceptProposedAction();
37 QStringList fileNames;
39 QStringList extensions = Settings::getGeneral_imageFormats().split(
" ");
41 QList<QUrl> urls =
event->mimeData()->urls();
42 for(
int i=0; i<urls.size(); ++i)
44 QString path = urls.at(i).toLocalFile();
45 for(
int j=0; j<extensions.size(); ++j)
47 QRegExp reg(extensions[j]);
48 reg.setPatternSyntax(QRegExp::Wildcard);
49 if(reg.exactMatch(path))
51 fileNames.push_back(path);
62 event->acceptProposedAction();