diff --git a/src/plugins/imageformats/dds/dds.pro b/src/plugins/imageformats/dds/dds.pro
index 331a912a819087ef40c237c370dec9495e019411..b645576e4ba9505c5d7dfa2373e8bd1d0a0bbc26 100644
--- a/src/plugins/imageformats/dds/dds.pro
+++ b/src/plugins/imageformats/dds/dds.pro
@@ -6,7 +6,6 @@ load(qt_plugin)
 
 HEADERS += \
     ddsheader.h \
-    main.h \
     qddshandler.h
 
 SOURCES += \
diff --git a/src/plugins/imageformats/dds/main.cpp b/src/plugins/imageformats/dds/main.cpp
index ef57cc52c573047718151baced98b850716a2ac6..b01299fd4294cfcecd0699a03dc1bb123fcecbbd 100644
--- a/src/plugins/imageformats/dds/main.cpp
+++ b/src/plugins/imageformats/dds/main.cpp
@@ -40,7 +40,7 @@
 **
 ****************************************************************************/
 
-#include "main.h"
+#include <QtGui/qimageiohandler.h>
 
 #ifndef QT_NO_IMAGEFORMATPLUGIN
 
@@ -48,6 +48,15 @@
 
 QT_BEGIN_NAMESPACE
 
+class QDDSPlugin : public QImageIOPlugin
+{
+    Q_OBJECT
+    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "dds.json")
+public:
+    Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
+    QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
+};
+
 QImageIOPlugin::Capabilities QDDSPlugin::capabilities(QIODevice *device, const QByteArray &format) const
 {
     if (format == QByteArrayLiteral("dds"))
@@ -75,4 +84,6 @@ QImageIOHandler *QDDSPlugin::create(QIODevice *device, const QByteArray &format)
 
 QT_END_NAMESPACE
 
+#include "main.moc"
+
 #endif // QT_NO_IMAGEFORMATPLUGIN
diff --git a/src/plugins/imageformats/dds/main.h b/src/plugins/imageformats/dds/main.h
deleted file mode 100644
index 937caca6f8f5b94d98f4d4f43dc3816b5ecbd74e..0000000000000000000000000000000000000000
--- a/src/plugins/imageformats/dds/main.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Copyright (C) 2013 Ivan Komissarov.
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the DDS plugin in the Qt ImageFormats module.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.  For licensing terms and
-** conditions see http://qt.digia.com/licensing.  For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights.  These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAIN_H
-#define MAIN_H
-
-#include <QtGui/qimageiohandler.h>
-
-#ifndef QT_NO_IMAGEFORMATPLUGIN
-
-#ifdef QT_NO_IMAGEFORMAT_DDS
-#undef QT_NO_IMAGEFORMAT_DDS
-#endif
-
-QT_BEGIN_NAMESPACE
-
-class QDDSPlugin : public QImageIOPlugin
-{
-    Q_OBJECT
-    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "dds.json")
-public:
-    Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
-    QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
-};
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_IMAGEFORMATPLUGIN
-
-#endif // MAIN_H