Commit 847f10e9 authored by Christian Kandeler's avatar Christian Kandeler

Remove Qt version checks.

Qt 5.3 is the minimum requirement these days. Remove all fallback code
from sources and project files.

Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 6f58e5b7
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
HELPGENERATOR = $$shell_path($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
QDOC_BIN = $$shell_path($$[QT_INSTALL_BINS]/qdoc)
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS/src] QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS]
COMPAT =
......@@ -90,6 +90,6 @@ QMAKE_EXTRA_TARGETS += html_docs dev_html_docs html_docs_online dev_html_docs_on
OTHER_FILES = $$HELP_DEP_FILES $$DEV_HELP_DEP_FILES
fixnavi.commands = \
cd $$targetPath($$PWD) && \
cd $$shell_path($$PWD) && \
perl fixnavi.pl -Dqcmanual -Dqtquick src
QMAKE_EXTRA_TARGETS += fixnavi
......@@ -8,14 +8,6 @@ BINARY_ARTIFACTS_BRANCH = master
# enable c++11
CONFIG += c++11
defineReplace(cleanPath) {
return($$clean_path($$1))
}
defineReplace(targetPath) {
return($$shell_path($$1))
}
defineReplace(qtLibraryName) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
......@@ -78,7 +70,7 @@ IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
sub_dir = $$_PRO_FILE_PWD_
sub_dir ~= s,^$$re_escape($$PWD),,
IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
IDE_BUILD_TREE = $$clean_path($$OUT_PWD)
IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
......
......@@ -88,7 +88,7 @@ defineReplace(stripSrcResourceDir) {
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out = $$clean_path($$1)
out ~= s|^$$re_escape($$SRCRESOURCEDIR)||$$i_flag
return($$out)
}
......
......@@ -10,10 +10,10 @@ defineReplace(prependAll) {
return($$result)
}
XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)
LCONVERT = $$targetPath($$[QT_INSTALL_BINS]/lconvert)
XMLPATTERNS = $$shell_path($$[QT_INSTALL_BINS]/xmlpatterns)
LUPDATE = $$shell_path($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
LRELEASE = $$shell_path($$[QT_INSTALL_BINS]/lrelease)
LCONVERT = $$shell_path($$[QT_INSTALL_BINS]/lconvert)
wd = $$replace(IDE_SOURCE_TREE, /, $$QMAKE_DIR_SEP)
......
......@@ -309,9 +309,7 @@ int main(int argc, char **argv)
QtSystemExceptionHandler systemExceptionHandler;
#endif
#if QT_VERSION >= 0x050100
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
// Manually determine -settingspath command line option
// We can't use the regular way of the plugin manager, because that needs to parse plugin meta data
......@@ -365,23 +363,14 @@ int main(int argc, char **argv)
QTranslator translator;
QTranslator qtTranslator;
QStringList uiLanguages;
// uiLanguages crashes on Windows with 4.8.0 release builds
#if (QT_VERSION >= 0x040801) || (QT_VERSION >= 0x040800 && !defined(Q_OS_WIN))
uiLanguages = QLocale::system().uiLanguages();
#else
uiLanguages << QLocale::system().name();
#endif
QString overrideLanguage = settings->value(QLatin1String("General/OverrideLanguage")).toString();
if (!overrideLanguage.isEmpty())
uiLanguages.prepend(overrideLanguage);
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
+ QLatin1String(SHARE_PATH "/translations");
foreach (QString locale, uiLanguages) {
#if (QT_VERSION >= 0x050000)
locale = QLocale(locale).name();
#else
locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973
#endif
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
const QString &qtTrFile = QLatin1String("qt_") + locale;
......
......@@ -8,7 +8,7 @@ INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/3rdparty
include(../3rdparty/cplusplus/cplusplus.pri)
greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent
QT += concurrent
#DEFINES += DEBUG_INCLUDE_GUARD_TRACKING
......
......@@ -714,11 +714,7 @@ void PluginManager::startTests()
const QMetaObject *metaObject = pluginSpec->plugin()->metaObject();
for (int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i) {
#if QT_VERSION >= 0x050000
const QByteArray signature = metaObject->method(i).methodSignature();
#else
const QByteArray signature = metaObject->method(i).signature();
#endif
if (signature.startsWith("test") && !signature.endsWith("_data()")) {
const QString method = QString::fromLatin1(signature);
const QString methodName = method.left(method.size() - 2);
......
......@@ -248,13 +248,8 @@ CppComponentValue::CppComponentValue(FakeMetaObject::ConstPtr metaObject, const
CppComponentValue::~CppComponentValue()
{
#if QT_VERSION >= 0x050000
delete m_metaSignatures.load();
delete m_signalScopes.load();
#else
delete m_metaSignatures;
delete m_signalScopes;
#endif
}
static QString generatedSlotName(const QString &base)
......@@ -292,11 +287,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const
QSet<QString> explicitSignals;
// make MetaFunction instances lazily when first needed
#if QT_VERSION >= 0x050000
QList<const Value *> *signatures = m_metaSignatures.load();
#else
QList<const Value *> *signatures = m_metaSignatures;
#endif
if (!signatures) {
signatures = new QList<const Value *>;
signatures->reserve(m_metaObject->methodCount());
......@@ -304,11 +295,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const
signatures->append(new Internal::MetaFunction(m_metaObject->method(index), valueOwner()));
if (!m_metaSignatures.testAndSetOrdered(0, signatures)) {
delete signatures;
#if QT_VERSION >= 0x050000
signatures = m_metaSignatures.load();
#else
signatures = m_metaSignatures;
#endif
}
}
......@@ -536,11 +523,7 @@ const QmlEnumValue *CppComponentValue::getEnumValue(const QString &typeName, con
const ObjectValue *CppComponentValue::signalScope(const QString &signalName) const
{
#if QT_VERSION >= 0x050000
QHash<QString, const ObjectValue *> *scopes = m_signalScopes.load();
#else
QHash<QString, const ObjectValue *> *scopes = m_signalScopes;
#endif
if (!scopes) {
scopes = new QHash<QString, const ObjectValue *>;
// usually not all methods are signals
......@@ -566,11 +549,7 @@ const ObjectValue *CppComponentValue::signalScope(const QString &signalName) con
}
if (!m_signalScopes.testAndSetOrdered(0, scopes)) {
delete scopes;
#if QT_VERSION >= 0x050000
scopes = m_signalScopes.load();
#else
scopes = m_signalScopes;
#endif
}
}
......
......@@ -120,10 +120,8 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
m_defaultProjectInfo.qtImportsPath = QFileInfo(
QLibraryInfo::location(QLibraryInfo::ImportsPath)).canonicalFilePath();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
m_defaultProjectInfo.qtQmlPath = QFileInfo(
QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
#endif
m_defaultImportPaths << environmentImportPaths();
updateImportPaths();
......
......@@ -262,11 +262,7 @@ static void printParseWarnings(const QString &libraryPath, const QString &warnin
static QString qmlPluginDumpErrorMessage(QProcess *process)
{
QString errorMessage;
#if QT_VERSION >= 0x050000
const QString binary = QDir::toNativeSeparators(process->program());
#else
const QString binary = QLatin1String("qmlplugindump");
#endif
switch (process->error()) {
case QProcess::FailedToStart:
errorMessage = PluginDumper::tr("\"%1\" failed to start: %2").arg(binary, process->errorString());
......@@ -286,9 +282,7 @@ static QString qmlPluginDumpErrorMessage(QProcess *process)
errorMessage = PluginDumper::tr("\"%1\" returned exit code %2.").arg(binary).arg(process->exitCode());
break;
}
#if QT_VERSION >= 0x050000
errorMessage += QLatin1Char('\n') + PluginDumper::tr("Arguments: %1").arg(process->arguments().join(QLatin1Char(' ')));
#endif
if (process->error() != QProcess::FailedToStart) {
const QString stdErr = QString::fromLocal8Bit(process->readAllStandardError());
if (!stdErr.isEmpty()) {
......
......@@ -30,21 +30,11 @@
#ifndef ALGORITHM_H
#define ALGORITHM_H
#include <qcompilerdetection.h> // for Q_REQUIRED_RESULT
#include <algorithm>
#include <functional>
#if QT_VERSION < 0x050000
#ifndef Q_REQUIRED_RESULT
# if defined(Q_CC_GNU)
# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
# else
# define Q_REQUIRED_RESULT
# endif
#endif
#else
#include <qcompilerdetection.h> // for Q_REQUIRED_RESULT
#endif
namespace Utils
{
//////////////////
......
......@@ -43,11 +43,7 @@ class QTimer;
QT_END_NAMESPACE
#ifdef Q_OS_WIN
# if QT_VERSION >= 0x050000
# include <QWinEventNotifier>
# else
# include <private/qwineventnotifier_p.h>
# endif
# include <QWinEventNotifier>
# include <windows.h>
#endif
......
......@@ -32,15 +32,12 @@
#include <utils/hostosinfo.h>
#include <QGraphicsOpacityEffect>
#include <QGuiApplication>
#include <QPropertyAnimation>
#include <QPaintEvent>
#include <QPainter>
#include <QStyleOption>
#if QT_VERSION >= 0x050100
#include <QGuiApplication>
#endif
using namespace Utils;
FadingWidget::FadingWidget(QWidget *parent) :
......@@ -127,19 +124,12 @@ void DetailsButton::paintEvent(QPaintEvent *e)
if (!HostOsInfo::isMacHost() && !isDown() && m_fader > 0)
p.fillRect(rect().adjusted(1, 1, -2, -2), QColor(255, 255, 255, int(m_fader*180)));
qreal checkedPixmapRatio = 1.0;
qreal uncheckedPixmapRatio = 1.0;
#if QT_VERSION >= 0x050100
checkedPixmapRatio = m_checkedPixmap.devicePixelRatio();
uncheckedPixmapRatio = m_uncheckedPixmap.devicePixelRatio();
#endif
if (isChecked()) {
if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / checkedPixmapRatio != contentsRect().size())
if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / m_checkedPixmap.devicePixelRatio() != contentsRect().size())
m_checkedPixmap = cacheRendering(contentsRect().size(), true);
p.drawPixmap(contentsRect(), m_checkedPixmap);
} else {
if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / uncheckedPixmapRatio != contentsRect().size())
if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / m_uncheckedPixmap.devicePixelRatio() != contentsRect().size())
m_uncheckedPixmap = cacheRendering(contentsRect().size(), false);
p.drawPixmap(contentsRect(), m_uncheckedPixmap);
}
......@@ -156,14 +146,9 @@ QPixmap DetailsButton::cacheRendering(const QSize &size, bool checked)
lg.setCoordinateMode(QGradient::ObjectBoundingMode);
lg.setFinalStop(0, 1);
qreal pixelRatio = 1.0;
#if QT_VERSION >= 0x050100
pixelRatio = devicePixelRatio();
#endif
const qreal pixelRatio = devicePixelRatio();
QPixmap pixmap(size * pixelRatio);
#if QT_VERSION >= 0x050100
pixmap.setDevicePixelRatio(pixelRatio);
#endif
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
p.setRenderHint(QPainter::Antialiasing, true);
......
......@@ -498,10 +498,7 @@ IconButton::IconButton(QWidget *parent)
void IconButton::paintEvent(QPaintEvent *)
{
qreal pixmapRatio = 1.0;
#if QT_VERSION >= 0x050100
pixmapRatio = m_pixmap.devicePixelRatio();
#endif
const qreal pixmapRatio = m_pixmap.devicePixelRatio();
QStylePainter painter(this);
QRect pixmapRect = QRect(0, 0, m_pixmap.width()/pixmapRatio, m_pixmap.height()/pixmapRatio);
pixmapRect.moveCenter(rect().center());
......@@ -541,10 +538,7 @@ void IconButton::animateShow(bool visible)
QSize IconButton::sizeHint() const
{
qreal pixmapRatio = 1.0;
#if QT_VERSION >= 0x050100
pixmapRatio = m_pixmap.devicePixelRatio();
#endif
const qreal pixmapRatio = m_pixmap.devicePixelRatio();
return QSize(m_pixmap.width()/pixmapRatio, m_pixmap.height()/pixmapRatio);
}
......
......@@ -349,16 +349,6 @@ void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const Q
}
}
static qreal pixmapDevicePixelRatio(const QPixmap &pixmap)
{
#if QT_VERSION > 0x050000
return pixmap.devicePixelRatio();
#else
Q_UNUSED(pixmap);
return 1.0;
#endif
}
// Draws a cached pixmap with shadow
void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
QPainter *p, QIcon::Mode iconMode, int dipRadius, const QColor &color, const QPoint &dipOffset)
......@@ -373,7 +363,7 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
// different than 1. The shadow drawing caluculations are done in device
// pixels.
QPixmap px = icon.pixmap(rect.size());
int devicePixelRatio = qCeil(pixmapDevicePixelRatio(px));
int devicePixelRatio = qCeil(px.devicePixelRatio());
int radius = dipRadius * devicePixelRatio;
QPoint offset = dipOffset * devicePixelRatio;
cache = QPixmap(px.size() + QSize(radius * 2, radius * 2));
......@@ -428,14 +418,12 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
// Draw the actual pixmap...
cachePainter.drawPixmap(QRect(QPoint(radius, radius) + offset, QSize(px.width(), px.height())), px);
#if QT_VERSION > 0x050000
cache.setDevicePixelRatio(devicePixelRatio);
#endif
QPixmapCache::insert(pixmapName, cache);
}
QRect targetRect = cache.rect();
targetRect.setSize(targetRect.size() / pixmapDevicePixelRatio(cache));
targetRect.setSize(targetRect.size() / cache.devicePixelRatio());
targetRect.moveCenter(rect.center() - dipOffset);
p->drawPixmap(targetRect, cache);
}
......
......@@ -614,14 +614,7 @@ bool SynchronousProcess::readDataFromProcess(QProcess &p, int timeOutMS,
}
// Prompt user, pretend we have data if says 'No'.
const bool hang = !hasData && !finished;
if (hang && showTimeOutMessageBox) {
QString binary;
#if QT_VERSION >= 0x050000
binary = p.program();
#endif
if (!askToKill(binary))
hasData = true;
}
hasData = hang && showTimeOutMessageBox && !askToKill(p.program());
} while (hasData && !finished);
if (syncDebug)
qDebug() << "<readDataFromProcess" << finished;
......
......@@ -1958,12 +1958,7 @@ ZConfLib::ConnectionRef MainConnection::mainRef()
MainConnection::Status MainConnection::status()
{
#if QT_VERSION >= 0x050000
return static_cast<MainConnection::Status>(m_status.load());
#else
int val = m_status;
return static_cast<MainConnection::Status>(val);
#endif
}
QList<ErrorMessage> MainConnection::errors()
......
......@@ -855,11 +855,7 @@ int extractVersion(const QString &string)
int index = string.indexOf(QLatin1Char(':'));
if (index == -1)
return 0;
#if QT_VERSION < 0x050100
return string.mid(4, index - 4).toInt();
#else
return string.midRef(4, index - 4).toInt();
#endif
}
void AndroidManifestEditorWidget::syncToEditor()
......
......@@ -65,11 +65,7 @@ QStringList AbstractSettings::completerWords()
QStringList AbstractSettings::styles() const
{
QStringList list = m_styles.keys();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
list.sort(Qt::CaseInsensitive);
#else //QT_VERSION_CHECK(5, 0, 0)
list.sort();
#endif // QT_VERSION_CHECK(5, 0, 0)
return list;
}
......
......@@ -123,11 +123,7 @@ void ConfigurationEditor::setSettings(AbstractSettings *settings)
QStringList keywords = m_settings->options();
m_highlighter->setKeywords(keywords);
keywords << m_settings->completerWords();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
keywords.sort(Qt::CaseInsensitive);
#else //QT_VERSION_CHECK(5, 0, 0)
keywords.sort();
#endif //QT_VERSION_CHECK(5, 0, 0)
m_model->setStringList(keywords);
}
......
DEFINES += CORE_LIBRARY
QT += network \
QT += help \
network \
printsupport \
script \
sql
greaterThan(QT_MAJOR_VERSION, 4) {
QT += help printsupport
} else {
CONFIG += help
}
include(../../qtcreatorplugin.pri)
include(../../shared/scriptwrapper/scriptwrapper.pri)
win32-msvc*:QMAKE_CXXFLAGS += -wd4251 -wd4290 -wd4250
......@@ -227,7 +223,7 @@ include(locator/locator.pri)
win32 {
SOURCES += progressmanager/progressmanager_win.cpp
greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private # Uses QPlatformNativeInterface.
QT += gui-private # Uses QPlatformNativeInterface.
LIBS += -lole32 -luser32
}
else:macx {
......
......@@ -309,12 +309,10 @@ void ProxyModel::setSourceModel(QAbstractItemModel *sm)
}
}
#if QT_VERSION >= 0x050000
QModelIndex ProxyModel::sibling(int row, int column, const QModelIndex &idx) const
{
return QAbstractItemModel::sibling(row, column, idx);
}
#endif
void ProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
......
......@@ -57,10 +57,8 @@ public:
void setSourceModel(QAbstractItemModel *sourceModel);
#if QT_VERSION >= 0x050000
// QAbstractProxyModel::sibling is broken in Qt 5
QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
#endif
private slots:
void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
......
......@@ -160,11 +160,7 @@ void OpenEditorsWindow::selectPreviousEditor()
QSize OpenEditorsTreeWidget::sizeHint() const
{
return QSize(sizeHintForColumn(0) + verticalScrollBar()->width() + frameWidth() * 2,
#if QT_VERSION < 0x050200
minimumHeight());
#else
viewportSizeHint().height() + frameWidth() * 2);
#endif
}
QSize OpenEditorsWindow::sizeHint() const
......
......@@ -47,10 +47,6 @@
#include <QPushButton>
#include <QWidget>
#if QT_VERSION < 0x050000
#include <QAbstractFileEngine>
#endif
using namespace Utils;
namespace Core {
......@@ -187,11 +183,6 @@ void FileUtils::removeFile(const QString &filePath, bool deleteFromFS)
static inline bool fileSystemRenameFile(const QString &orgFilePath,
const QString &newFilePath)
{
#if QT_VERSION < 0x050000
QAbstractFileEngine *fileEngine = QAbstractFileEngine::create(orgFilePath); // Due to QTBUG-3570
if (!fileEngine->caseSensitive() && orgFilePath.compare(newFilePath, Qt::CaseInsensitive) == 0)
return fileEngine->rename(newFilePath);
#endif
// QTBUG-3570 is also valid for Qt 5 but QAbstractFileEngine is now in a private header file and
// the symbol is not exported.
return QFile::rename(orgFilePath, newFilePath);
......
......@@ -65,11 +65,7 @@ void SearchResultTreeItemDelegate::paint(QPainter *painter, const QStyleOptionVi
if (checkable) {
QVariant checkStateData = index.data(Qt::CheckStateRole);
checkState = static_cast<Qt::CheckState>(checkStateData.toInt());
#if QT_VERSION >= 0x050000
checkRect = doCheck(opt, opt.rect, checkStateData);
#else // Qt4
checkRect = check(opt, opt.rect, checkStateData);
#endif
}
// icon
......
......@@ -27,18 +27,16 @@
**
****************************************************************************/
#include <QGuiApplication>
#include <QVariant>
#include <QMainWindow>
#include <QFont>
#include <QFontMetrics>
#include <QPixmap>
#include <QPainter>
#if QT_VERSION >= 0x050000
# include <QGuiApplication>
# include <QWindow>
# include <qpa/qplatformnativeinterface.h>
#endif
#include <QWindow>
#include <QLabel>
#include <qpa/qplatformnativeinterface.h>
#include <coreplugin/icore.h>
#include <utils/stylehelper.h>
......@@ -58,8 +56,6 @@ namespace {
ITaskbarList3* pITask = 0;
}
#if QT_VERSION >= 0x050000
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p);
QT_END_NAMESPACE
......@@ -80,12 +76,6 @@ static inline HWND hwndOfWidget(const QWidget *w)
result = QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window);
return static_cast<HWND>(result);
}
#else
static inline HWND hwndOfWidget(const QWidget *w)
{
return w->winId();
}
#endif
void Core::Internal::ProgressManagerPrivate::initInternal()
{
......@@ -131,11 +121,7 @@ void Core::Internal::ProgressManagerPrivate::doSetApplicationLabel(const QString
font.setPixelSize(pix.height() * 0.5);
p.setFont(font);
p.drawText(pix.rect(), Qt::AlignCenter, text);
#if QT_VERSION >= 0x050000
const HICON icon = qt_pixmapToWinHICON(pix);
#else
const HICON icon = pix.toWinHICON();
#endif
pITask->SetOverlayIcon(winId, icon, (wchar_t*)text.utf16());
DestroyIcon(icon);
}
......
......@@ -2699,9 +2699,7 @@ QMessageBox *showMessageBox(int icon, const QString &title,
title, text, QMessageBox::StandardButtons(buttons),
ICore::mainWindow());
mb->setAttribute(Qt::WA_DeleteOnClose);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
mb->setTextInteractionFlags(Qt::TextSelectableByMouse);
#endif
mb->show();
return mb;
}
......
......@@ -34,9 +34,7 @@
#include <QDebug>
#include <QHostAddress>
#include <QRegExp>
#if QT_VERSION >= 0x050200
#include <QTimeZone>
#endif
#include <ctype.h>
......@@ -512,7 +510,6 @@ static QTime timeFromData(int ms)
return ms == -1 ? QTime() : QTime(0, 0, 0, 0).addMSecs(ms);
}
#if QT_VERSION >= 0x050200
// Stolen and adapted from qdatetime.cpp
static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
{
......@@ -559,7 +556,6 @@ static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
*date = (status & NullDate) ? QDate() : QDate::fromJulianDay(jd);
*time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds);
}
#endif
QString decodeData(const QByteArray &ba, int encoding)
{
......@@ -688,7 +684,6 @@ QString decodeData(const QByteArray &ba, int encoding)
return QString::fromUtf8(decodedBa);
}
case DateTimeInternal: { // 29, DateTimeInternal: msecs, spec, offset, tz, status
#if QT_VERSION >= 0x050200
int p0 = ba.indexOf('/');
int p1 = ba.indexOf('/', p0 + 1);
int p2 = ba.indexOf('/', p1 + 1);
......@@ -719,10 +714,6 @@ QString decodeData(const QByteArray &ba, int encoding)
dateTime = QDateTime(date, time, spec);
}
return dateTime.toString();
#else
// "Very plain".
return QString::fromLatin1(ba);
#endif
}
}
qDebug() << "ENCODING ERROR: " << encoding;
......
......@@ -49,11 +49,7 @@
* Tests after this macro will be skipped and warning printed.
* Uncomment it to test a feature -- if tests succeeds it should be removed from the test.
*/
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
# define NOT_IMPLEMENTED QSKIP("Not fully implemented!", SkipSingle);
#else
# define NOT_IMPLEMENTED QSKIP("Not fully implemented!");
#endif
#define NOT_IMPLEMENTED QSKIP("Not fully implemented!");
// Text cursor representation in comparisons.
#define X "|"
......
<
......@@ -63,21 +63,7 @@ void CppModelManagerHelper::waitForSourceFilesRefreshed(const QStringList &files
foreach (const QString &file, files) {
while (!m_refreshedSourceFiles.contains(file)) {
#if QT_VERSION >= 0x050000
QVERIFY(spy.wait());
#else // Qt 4.x
class MyThread: public QThread
{
public:
static void Zzzzz()
{
QThread::msleep(50);
}
};
MyThread::Zzzzz();
QCoreApplication::processEvents();
#endif
}