mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-03 07:12:47 -08:00
Improve file dialog filter for adding custom icons.
This commit is contained in:
1 parent
5a08e4619c
commit
ce0007acd2
3 files changed
+24
-1
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include <QtCore/QIODevice>
|
||||
#include <QtCore/QLocale>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtGui/QImageReader>
|
||||
|
||||
namespace Tools {
|
||||
|
||||
@@ -84,4 +85,22 @@ QDateTime currentDateTimeUtc ()
|
||||
#endif
|
||||
}
|
||||
|
||||
QString imageReaderFilter()
|
||||
{
|
||||
QList<QByteArray> formats = QImageReader::supportedImageFormats();
|
||||
QStringList formatsStringList;
|
||||
|
||||
Q_FOREACH (const QByteArray& format, formats) {
|
||||
for (int i = 0; i < format.size(); i++) {
|
||||
if (!QChar(format.at(i)).isLetterOrNumber()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
formatsStringList.append("*." + QString::fromAscii(format).toLower());
|
||||
}
|
||||
|
||||
return formatsStringList.join(" ");
|
||||
}
|
||||
|
||||
} // namespace Tools
|
||||
Reference in new issue
Block a user