Skip to content

Commit 29b1155

Browse files
committed
Added #ifdef for Qt4/Qt5 compilation
1 parent 1afec3d commit 29b1155

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

controls/main/mainwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ MainWindow::MainWindow(QWidget *parent) :
5050
ui(new Ui::MainWindow)
5151
{
5252
ui->setupUi(this);
53+
#ifndef USED_QT5
54+
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
55+
#endif
5356

5457
QIcon icon;
5558
icon.addFile(":/images/icon64", QSize(64, 64));

controls/setup/parts/matrix/matrixitemdelegate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
#define MATRIXITEMDELEGATE_H
2222
//-----------------------------------------------------------------------------
2323
#include <QtGui>
24+
25+
#ifdef USED_QT5
2426
#include <QtWidgets>
27+
#endif
2528
//-----------------------------------------------------------------------------
2629
class MatrixItemDelegate : public QItemDelegate
2730
{

controls/setup/parts/matrix/setuptabmatrix.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
#include "prepareoptions.h"
2727
#include "matrixoptions.h"
2828
#include "imageoptions.h"
29+
30+
#ifdef USED_QT5
2931
#include <QtWidgets>
32+
#endif
3033
//-----------------------------------------------------------------------------
3134
SetupTabMatrix::SetupTabMatrix(Preset *preset, QWidget *parent) :
3235
QWidget(parent),

controls/setup/parts/reordering/reorderingitemdelegate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
#define REORDERINGITEMDELEGATE_H
2222
//-----------------------------------------------------------------------------
2323
#include <QtGui>
24+
25+
#ifdef USED_QT5
2426
#include <QtWidgets>
27+
#endif
2528
//-----------------------------------------------------------------------------
2629
class ReorderingItemDelegate : public QItemDelegate
2730
{

main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
* along with this program. If not, see <http://www.gnu.org/licenses/
1818
*/
1919

20+
#ifdef USED_QT5
2021
#include <QtWidgets/QApplication>
22+
#else
23+
#include <QtGui/QApplication>
24+
#endif
25+
2126
#include "mainwindow.h"
2227
//-----------------------------------------------------------------------------
2328
int main(int argc, char *argv[])

0 commit comments

Comments
 (0)