A bit more clang-format
This commit is contained in:
@@ -19,42 +19,41 @@
|
||||
#include <QWidget>
|
||||
#include <QApplication>
|
||||
#if QT_VERSION <= QT_VERSION_CHECK(5, 14, 0)
|
||||
#include <QDesktopWidget>
|
||||
# include <QDesktopWidget>
|
||||
#endif
|
||||
#include "qt_util.hpp"
|
||||
|
||||
namespace util
|
||||
namespace util {
|
||||
QScreen *
|
||||
screenOfWidget(QWidget *widget)
|
||||
{
|
||||
QScreen* screenOfWidget(QWidget* widget)
|
||||
{
|
||||
#if QT_VERSION <= QT_VERSION_CHECK(5, 14, 0)
|
||||
return QApplication::screens()[QApplication::desktop()->screenNumber(widget) == -1 ? 0 : QApplication::desktop()->screenNumber(widget)];
|
||||
return QApplication::screens()[QApplication::desktop()->screenNumber(widget) == -1 ? 0 : QApplication::desktop()->screenNumber(widget)];
|
||||
#else
|
||||
return widget->screen();
|
||||
return widget->screen();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
QString DlgFilter(std::initializer_list<QString> extensions, bool last)
|
||||
{
|
||||
QStringList temp;
|
||||
QString
|
||||
DlgFilter(std::initializer_list<QString> extensions, bool last)
|
||||
{
|
||||
QStringList temp;
|
||||
|
||||
for (auto ext : extensions)
|
||||
{
|
||||
for (auto ext : extensions) {
|
||||
#ifdef Q_OS_UNIX
|
||||
if (ext == "*")
|
||||
{
|
||||
temp.append("*");
|
||||
continue;
|
||||
}
|
||||
temp.append("*." % ext.toUpper());
|
||||
#endif
|
||||
temp.append("*." % ext);
|
||||
if (ext == "*") {
|
||||
temp.append("*");
|
||||
continue;
|
||||
}
|
||||
temp.append("*." % ext.toUpper());
|
||||
#endif
|
||||
temp.append("*." % ext);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
temp.removeDuplicates();
|
||||
temp.removeDuplicates();
|
||||
#endif
|
||||
return " (" % temp.join(' ') % ")" % (!last ? ";;" : "");
|
||||
}
|
||||
return " (" % temp.join(' ') % ")" % (!last ? ";;" : "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user