diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index 46f1cdfe8e5c9127b466eb966aac09f95152bb05..b5ccc2dc0db1ede2562b5f4d88860de1e7b5b1a5 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -123,10 +123,12 @@ static bool isProcessName(const QString &procname)
     return true;
 }
 
+QT_BEGIN_NAMESPACE
 bool operator<(const ProcData &p1, const ProcData &p2)
 {
     return p1.name < p2.name;
 }
+QT_END_NAMESPACE
 
 // Determine UNIX processes by reading "/proc"
 static QList<ProcData> unixProcessList()
@@ -189,8 +191,8 @@ static void populateProcessModel(QStandardItemModel *model)
 AttachExternalDialog::AttachExternalDialog(QWidget *parent) :
         QDialog(parent),
         m_ui(new Ui::AttachExternalDialog),
-        m_model(createProcessModel(this)),
-        m_proxyModel(new QSortFilterProxyModel(this))
+        m_proxyModel(new QSortFilterProxyModel(this)),
+        m_model(createProcessModel(this))
 {
     m_ui->setupUi(this);
     m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);