Changeset 356169a3d3 in tspsg


Ignore:
Timestamp:
Jul 11, 2012, 6:46:48 PM (12 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
ff8d0488a0
Parents:
c90b437dd8
Message:

Updated code to become compilable with Qt 5.

Compiling with Qt 4 is still possible and it will be the main platform
for TSPSG releases until first Qt 5 release is made.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/3rdparty/qttoolbardialog-2.2_1-opensource/src/qttoolbardialog.cpp

    rc90b437dd8 r356169a3d3  
    4848#include "ui_qttoolbardialog.h"
    4949#include <QtCore/QSet>
    50 #include <QtGui/QAction>
    51 #include <QtGui/QToolBar>
    52 #include <QtGui/QMainWindow>
     50#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
     51#   include <QtGui/QAction>
     52#   include <QtGui/QToolBar>
     53#   include <QtGui/QMainWindow>
     54#   include <QtGui/QHeaderView>
     55#   include <QtGui/QPushButton>
     56#else
     57#   include <QtWidgets/QAction>
     58#   include <QtWidgets/QToolBar>
     59#   include <QtWidgets/QMainWindow>
     60#   include <QtWidgets/QHeaderView>
     61#   include <QtWidgets/QPushButton>
     62#endif
    5363#include <QtGui/QShowEvent>
    5464#include <QtGui/QHideEvent>
    55 #include <QtGui/QHeaderView>
    56 #include <QtGui/QPushButton>
    5765
    5866#ifndef GET_ICON
    59 #   if QT_VERSION >= 0x040600
     67#   if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    6068#       define GET_ICON(x) QIcon::fromTheme(x, QIcon(":/images/icons/128x128/"x".png"))
    6169#   else
  • src/3rdparty/qttoolbardialog-2.2_1-opensource/src/qttoolbardialog.h

    rc90b437dd8 r356169a3d3  
    4848#define QTTOOLBARDIALOG_H
    4949
    50 #include <QtGui/QDialog>
     50#include <QtCore>
     51
     52#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
     53#   include <QtGui/QDialog>
     54#else
     55#   include <QtWidgets/QDialog>
     56#endif
    5157
    5258#if defined(Q_WS_WIN)
  • src/globals.h

    rc90b437dd8 r356169a3d3  
    3131// INCLUDES
    3232#include <QtCore>
    33 #if QT_VERSION < 0x040500
     33#if QT_VERSION < QT_VERSION_CHECK(4,5,0)
    3434#   error You are using Qt version < 4.5 but minimum required version is 4.5.0. Compilation aborted.
    3535#endif
     
    4646#   include <QtSvg>
    4747#endif // NOSVG
     48#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
     49#   include <QtConcurrent>
     50#   include <QtPrintSupport>
     51#endif
    4852
    4953#ifndef HANDHELD
     
    160164#endif
    161165
    162 #if QT_VERSION >= 0x040600
     166#if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    163167#   define GET_ICON(x) QIcon::fromTheme(x, QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT))
    164168#else
  • src/main.cpp

    rc90b437dd8 r356169a3d3  
    2323
    2424#include "mainwindow.h"
    25 #if QT_VERSION < 0x040600
     25#if QT_VERSION < QT_VERSION_CHECK(4,6,0)
    2626#   ifdef Q_CC_MSVC
    2727#       pragma message("WARNING: You are using Qt version < 4.6. Application will not support some non-critical features.")
     
    4949    app.setOverrideCursor(QCursor(Qt::WaitCursor));
    5050    QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
     51#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
    5152    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
    5253    QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
     54#endif
    5355    app.setOrganizationName("Oleksii Serdiuk");
    5456    app.setOrganizationDomain("oleksii.name");
  • src/mainwindow.cpp

    rc90b437dd8 r356169a3d3  
    13041304QColor hilight;
    13051305    if (color.value() < 192)
    1306         hilight.setHsv(color.hue(), color.saturation(), 127 + qRound(color.value() / 2));
     1306        hilight.setHsv(color.hue(), color.saturation(), 127 + (color.value() / 2));
    13071307    else
    13081308        hilight.setHsv(color.hue(), color.saturation(), color.value() / 2);
     
    13621362        a->setStatusTip(language.at(3));
    13631363#endif
    1364 #if QT_VERSION >= 0x040600
     1364#if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    13651365        a->setIcon(QIcon::fromTheme(QString("flag-%1").arg(language.at(1)), QIcon(QString(":/images/icons/l10n/flag-%1.png").arg(language.at(1)))));
    13661366#else
     
    16821682#ifndef HANDHELD
    16831683    menuSettingsLanguage->setIcon(GET_ICON("preferences-desktop-locale"));
    1684 #if QT_VERSION >= 0x040600
     1684#if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    16851685    actionSettingsLanguageEnglish->setIcon(QIcon::fromTheme("flag-gb", QIcon(":/images/icons/l10n/flag-gb.png")));
    1686 #else // QT_VERSION >= 0x040600
     1686#else
    16871687    actionSettingsLanguageEnglish->setIcon(QIcon(":/images/icons/l10n/flag-gb.png"));
    1688 #endif // QT_VERSION >= 0x040600
     1688#endif // QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    16891689    menuSettingsStyle->setIcon(GET_ICON("preferences-desktop-theme"));
    16901690#endif // HANDHELD
     
    16971697    actionHelpReportBug->setIcon(GET_ICON("tools-report-bug"));
    16981698    actionHelpAbout->setIcon(GET_ICON("help-about"));
     1699#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
    16991700    actionHelpAboutQt->setIcon(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"));
    1700 #endif
     1701#else
     1702    actionHelpAboutQt->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
     1703#endif // QT_VERSION < QT_VERSION_CHECK(5,0,0)
     1704#endif // HANDHELD
    17011705    // Buttons
    17021706    buttonRandom->setIcon(GET_ICON("roll"));
     
    17071711//      action->setIcon(GET_ICON(""));
    17081712
    1709 #if QT_VERSION >= 0x040600
     1713#if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    17101714    setToolButtonStyle(Qt::ToolButtonFollowStyle);
    17111715#endif
     
    17561760    actionFilePageSetup->setObjectName("actionFilePrintSetup");
    17571761//    actionFilePageSetup->setEnabled(false);
    1758 #if QT_VERSION >= 0x040600
     1762#if QT_VERSION >= QT_VERSION_CHECK(4,6,0)
    17591763    actionFilePageSetup->setIcon(QIcon::fromTheme("document-page-setup", QIcon(":/trolltech/dialogs/qprintpreviewdialog/images/page-setup-32.png")));
    17601764#else
  • src/settingsdialog.cpp

    rc90b437dd8 r356169a3d3  
    258258#endif
    259259
    260 #if !defined(NOSVG) && (QT_VERSION >= 0x040500)
     260#if !defined(NOSVG) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0))
    261261    comboGraphImageFormat->addItem("svg");
    262 #endif // NOSVG && QT_VERSION >= 0x040500
     262#endif
    263263    // We create whitelist of formats, supported by the most popular web browsers according to
    264264    //  http://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support
  • tspsg.pro

    rc90b437dd8 r356169a3d3  
    1515} else {
    1616    DEFINES += NOSVG
     17}
     18
     19greaterThan(QT_MAJOR_VERSION, 4) {
     20    QT += printsupport concurrent
    1721}
    1822
Note: See TracChangeset for help on using the changeset viewer.