summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qdialog.h4
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp32
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp2
4 files changed, 31 insertions, 9 deletions
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index 7d3052a782..f20ff46d41 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -91,8 +91,8 @@ Q_SIGNALS:
void rejected();
public Q_SLOTS:
- void open();
- int exec();
+ virtual void open();
+ virtual int exec();
virtual void done(int);
virtual void accept();
virtual void reject();
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 5446eca383..809024ae6d 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -48,6 +48,8 @@
#include <qmessagebox.h>
#include <qapplication.h>
+#include <algorithm>
+
#ifdef Q_OS_WIN
# include <QtCore/QVarLengthArray>
# include <qt_windows.h>
@@ -1081,15 +1083,35 @@ public:
r->fileName, Qt::CaseInsensitive) < 0;
}
case 1:
+ {
// Directories go first
- if (l->isDir() && !r->isDir())
- return true;
- return l->size() < r->size();
+ bool left = l->isDir();
+ bool right = r->isDir();
+ if (left ^ right)
+ return left;
+
+ qint64 sizeDifference = l->size() - r->size();
+ if (sizeDifference == 0)
+ return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0;
+
+ return sizeDifference < 0;
+ }
case 2:
- return l->type() < r->type();
+ {
+ int compare = QString::localeAwareCompare(l->type(), r->type());
+ if (compare == 0)
+ return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0;
+
+ return compare < 0;
+ }
case 3:
+ {
+ if (l->lastModified() == r->lastModified())
+ return QFileSystemModelPrivate::naturalCompare(l->fileName, r->fileName, Qt::CaseInsensitive) < 0;
+
return l->lastModified() < r->lastModified();
}
+ }
Q_ASSERT(false);
return false;
}
@@ -1129,7 +1151,7 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent
i++;
}
QFileSystemModelSorter ms(column);
- qStableSort(values.begin(), values.end(), ms);
+ std::sort(values.begin(), values.end(), ms);
// First update the new visible list
indexNode->visibleChildren.clear();
//No more dirty item we reset our internal dirty index
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 2b932b0724..ea33dc8d0b 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -369,7 +369,7 @@ void QMessageBoxPrivate::updateSize()
label->setSizePolicy(policy);
}
- QFontMetrics fm(QApplication::font("QWorkspaceTitleBar"));
+ QFontMetrics fm(QApplication::font("QMdiSubWindowTitleBar"));
int windowTitleWidth = qMin(fm.width(q->windowTitle()) + 50, hardLimit);
if (windowTitleWidth > width)
width = windowTitleWidth;
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 2c4c738681..49450be75b 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -335,7 +335,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
const int verticalCenter = (btnTop + btnHeight / 2) - 1;
const QString text = wizard->window()->windowTitle();
- const QFont font = QApplication::font("QWorkspaceTitleBar");
+ const QFont font = QApplication::font("QMdiSubWindowTitleBar");
const QFontMetrics fontMetrics(font);
const QRect brect = fontMetrics.boundingRect(text);
int textHeight = brect.height();