This commit is contained in:
parent
7adf8f2c90
commit
dd7667b9f7
2 changed files with 12 additions and 21 deletions
|
@ -63,7 +63,7 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
#if QT_VERSION <= 0x060000
|
#if QT_VERSION >= 0x060000
|
||||||
QLocale::setDefault(QLocale(currentLanguage));
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
#else
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
@ -151,7 +151,7 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
#if QT_VERSION <= 0x060000
|
#if QT_VERSION >= 0x060000
|
||||||
QLocale::setDefault(QLocale(currentLanguage));
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
#else
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
@ -184,7 +184,7 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
#if QT_VERSION <= 0x060000
|
#if QT_VERSION >= 0x060000
|
||||||
QLocale::setDefault(QLocale(currentLanguage));
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
#else
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
@ -207,7 +207,7 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
#if QT_VERSION <= 0x060000
|
#if QT_VERSION >= 0x060000
|
||||||
QLocale::setDefault(QLocale(currentLanguage));
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
#else
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
@ -235,7 +235,7 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
#if QT_VERSION <= 0x060000
|
#if QT_VERSION >= 0x060000
|
||||||
QLocale::setDefault(QLocale(currentLanguage));
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
#else
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
@ -256,7 +256,7 @@ void TranslationClass::loadTranslation(QApplication *app)
|
||||||
{
|
{
|
||||||
app->installTranslator(&inQtTranslator);
|
app->installTranslator(&inQtTranslator);
|
||||||
}
|
}
|
||||||
#if QT_VERSION <= 0x060000
|
#if QT_VERSION >= 0x060000
|
||||||
QLocale::setDefault(QLocale(currentLanguage));
|
QLocale::setDefault(QLocale(currentLanguage));
|
||||||
#else
|
#else
|
||||||
QLocale::setDefault(currentLanguage);
|
QLocale::setDefault(currentLanguage);
|
||||||
|
|
|
@ -46,26 +46,21 @@ void UiModWidget::setImageDropEnabled(bool enabled)
|
||||||
|
|
||||||
void UiModWidget::dragEnterEvent(QDragEnterEvent *dragEnterEvent)
|
void UiModWidget::dragEnterEvent(QDragEnterEvent *dragEnterEvent)
|
||||||
{
|
{
|
||||||
if (filesDropEnabled && dragEnterEvent->mimeData()->hasUrls())
|
if (filesDropEnabled && dragEnterEvent->mimeData()->hasUrls()) {
|
||||||
{
|
QVector<QString> pathList;
|
||||||
QStringList pathList;
|
|
||||||
const QList<QUrl> urlList = dragEnterEvent->mimeData()->urls();
|
const QList<QUrl> urlList = dragEnterEvent->mimeData()->urls();
|
||||||
|
|
||||||
for (const QUrl ¤tUrl : urlList)
|
for (const QUrl ¤tUrl : urlList) {
|
||||||
{
|
if (currentUrl.isLocalFile()) {
|
||||||
if (currentUrl.isLocalFile())
|
|
||||||
{
|
|
||||||
pathList.append(currentUrl.toLocalFile());
|
pathList.append(currentUrl.toLocalFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pathList.isEmpty())
|
if (!pathList.isEmpty()) {
|
||||||
{
|
|
||||||
dragEnterEvent->acceptProposedAction();
|
dragEnterEvent->acceptProposedAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (imageDropEnabled && dragEnterEvent->mimeData()->hasImage())
|
else if (imageDropEnabled && dragEnterEvent->mimeData()->hasImage()) {
|
||||||
{
|
|
||||||
dragEnterEvent->acceptProposedAction();
|
dragEnterEvent->acceptProposedAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,11 +75,7 @@ void UiModWidget::paintEvent(QPaintEvent *paintEvent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(paintEvent)
|
Q_UNUSED(paintEvent)
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
#if QT_VERSION <= 0x060000
|
|
||||||
opt.initFrom(this);
|
opt.initFrom(this);
|
||||||
#else
|
|
||||||
opt.init(this);
|
|
||||||
#endif
|
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue