OSDN Git Service

kuassel: remove code for Qt4 versions older than 4.8
authorIvailo Monev <xakepa10@gmail.com>
Wed, 15 Jul 2015 20:49:20 +0000 (20:49 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 15 Jul 2015 20:49:20 +0000 (20:49 +0000)
21 files changed:
kuassel/src/client/networkmodel.cpp
kuassel/src/common/basichandler.cpp
kuassel/src/common/eventmanager.cpp
kuassel/src/common/remotepeer.cpp
kuassel/src/common/signalproxy.cpp
kuassel/src/common/syncableobject.cpp
kuassel/src/core/corenetwork.cpp
kuassel/src/core/coreuserinputhandler.cpp
kuassel/src/core/eventstringifier.cpp
kuassel/src/core/sslserver.cpp
kuassel/src/core/sslserver.h
kuassel/src/qtui/chatviewsearchcontroller.h
kuassel/src/qtui/knotificationbackend.cpp
kuassel/src/qtui/settingspages/highlightsettingspage.cpp
kuassel/src/qtui/sslinfodlg.cpp
kuassel/src/qtui/statusnotifieritem.cpp
kuassel/src/qtui/topicwidget.cpp
kuassel/src/uisupport/bufferview.cpp
kuassel/src/uisupport/bufferview.h
kuassel/src/uisupport/multilineedit.cpp
kuassel/src/uisupport/styledlabel.cpp

index b465618..71fe447 100644 (file)
@@ -22,9 +22,7 @@
 
 #include <QAbstractItemView>
 #include <QMimeData>
-#if QT_VERSION < 0x050000
 #include <QTextDocument>        // for Qt::escape()
-#endif
 
 #include "buffermodel.h"
 #include "buffersettings.h"
@@ -211,13 +209,8 @@ QString NetworkItem::toolTip(int column) const
 {
     Q_UNUSED(column);
 
-#if QT_VERSION < 0x050000
     QStringList toolTip(QString("<b>%1</b>").arg(Qt::escape(networkName())));
     toolTip.append(i18n("Server: %1").arg(Qt::escape(currentServer())));
-#else
-    QStringList toolTip(QString("<b>%1</b>").arg(networkName().toHtmlEscaped()));
-    toolTip.append(i18n("Server: %1").arg(currentServer().toHtmlEscaped()));
-#endif
     toolTip.append(i18n("Users: %1").arg(nickCount()));
 
     if (_network) {
@@ -579,11 +572,7 @@ QString ChannelBufferItem::toolTip(int column) const
     Q_UNUSED(column);
     QStringList toolTip;
 
-#if QT_VERSION < 0x050000
     toolTip.append(i18n("<b>Channel %1</b>").arg(Qt::escape(bufferName())));
-#else
-    toolTip.append(i18n("<b>Channel %1</b>").arg(bufferName().toHtmlEscaped()));
-#endif
     if (isActive()) {
         //TODO: add channel modes
         toolTip.append(i18n("<b>Users:</b> %1").arg(nickCount()));
@@ -599,11 +588,7 @@ QString ChannelBufferItem::toolTip(int column) const
             QString _topic = topic();
             if (_topic != "") {
                 _topic = stripFormatCodes(_topic);
-#if QT_VERSION < 0x050000
                 _topic = Qt::escape(_topic);
-#else
-                _topic = _topic.toHtmlEscaped();
-#endif
                 toolTip.append(QString("<font size='-2'>&nbsp;</font>"));
                 toolTip.append(i18n("<b>Topic:</b> %1").arg(_topic));
             }
index 516a19b..ebddf1c 100644 (file)
@@ -52,11 +52,7 @@ const QHash<QString, int> &BasicHandler::handlerHash()
 {
     if (!_initDone) {
         for (int i = metaObject()->methodOffset(); i < metaObject()->methodCount(); i++) {
-#if QT_VERSION >= 0x050000
-            QString methodSignature = metaObject()->method(i).methodSignature();
-#else
             QString methodSignature = metaObject()->method(i).signature();
-#endif
             if (methodSignature.startsWith("defaultHandler")) {
                 _defaultHandler = i;
                 continue;
index 2860805..2eb623c 100644 (file)
@@ -148,11 +148,7 @@ int EventManager::findEventType(const QString &methodSignature_, const QString &
 void EventManager::registerObject(QObject *object, Priority priority, const QString &methodPrefix, const QString &filterPrefix)
 {
     for (int i = object->metaObject()->methodOffset(); i < object->metaObject()->methodCount(); i++) {
-#if QT_VERSION >= 0x050000
-        QString methodSignature = object->metaObject()->method(i).methodSignature();
-#else
         QString methodSignature = object->metaObject()->method(i).signature();
-#endif
 
         int eventType = findEventType(methodSignature, methodPrefix);
         if (eventType > 0) {
index 0f99fb7..d311d20 100644 (file)
@@ -254,11 +254,7 @@ void RemotePeer::handle(const HeartBeat &heartBeat)
 void RemotePeer::handle(const HeartBeatReply &heartBeatReply)
 {
     _heartBeatCount = 0;
-#if QT_VERSION >= 0x040700
     emit lagUpdated(heartBeatReply.timestamp.msecsTo(QDateTime::currentDateTime().toUTC()) / 2);
-#else
-    emit lagUpdated(heartBeatReply.timestamp.time().msecsTo(QDateTime::currentDateTime().toUTC().time()) / 2);
-#endif
 }
 
 
index 86a6c57..296e26f 100644 (file)
@@ -98,11 +98,7 @@ void SignalProxy::SignalRelay::attachSignal(QObject *sender, int signalId, const
     }
     else {
         fn = SIGNAL(fakeMethodSignature());
-#if QT_VERSION >= 0x050000
-        fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).methodSignature());
-#else
         fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).signature());
-#endif
     }
 
     _slots[slotId] = Signal(sender, signalId, fn);
@@ -147,11 +143,7 @@ int SignalProxy::SignalRelay::qt_metacall(QMetaObject::Call _c, int _id, void **
             const QList<int> &argTypes = eMeta->argTypes(signal.signalId);
             for (int i = 0; i < argTypes.size(); i++) {
                 if (argTypes[i] == 0) {
-#if QT_VERSION >= 0x050000
-                    kWarning(300000) << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).methodSignature().constData());
-#else
                     kWarning(300000) << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(_id).signature());
-#endif
                     kWarning(300000) << "                            - make sure all your data types are known by the Qt MetaSystem";
                     return _id;
                 }
@@ -651,11 +643,7 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList
     // check for argument compatibility and build params array
     for (int i = 0; i < numArgs; i++) {
         if (!params[i].isValid()) {
-#if QT_VERSION >= 0x050000
-            kWarning(300000) << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData());
-#else
             kWarning(300000) << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).signature());
-#endif
             kWarning(300000) << "                            - make sure all your data types are known by the Qt MetaSystem";
             return false;
         }
@@ -824,11 +812,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo
         if (_meta->method(i).methodType() != QMetaMethod::Slot)
             continue;
 
-#if QT_VERSION >= 0x050000
-        if (_meta->method(i).methodSignature().contains('*'))
-#else
         if (QByteArray(_meta->method(i).signature()).contains('*'))
-#endif
             continue;  // skip methods with ptr params
 
         QByteArray method = methodName(_meta->method(i));
@@ -857,11 +841,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo
             }
             if (checkConflicts) {
                 kWarning(300000) << "class" << meta->className() << "contains overloaded methods which is currently not supported!";
-#if QT_VERSION >= 0x050000
-                kWarning(300000) << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature();
-#else
                 kWarning(300000) << " - " << _meta->method(i).signature() << "conflicts with" << _meta->method(_methodIds[method]).signature();
-#endif
             }
             continue;
         }
@@ -901,11 +881,7 @@ const QHash<int, int> &SignalProxy::ExtendedMetaObject::receiveMap()
             if (QMetaType::Void == (QMetaType::Type)returnType(i))
                 continue;
 
-#if QT_VERSION >= 0x050000
-            signature = requestSlot.methodSignature();
-#else
             signature = QByteArray(requestSlot.signature());
-#endif
             if (!signature.startsWith("request"))
                 continue;
 
@@ -939,22 +915,14 @@ const QHash<int, int> &SignalProxy::ExtendedMetaObject::receiveMap()
 
 QByteArray SignalProxy::ExtendedMetaObject::methodName(const QMetaMethod &method)
 {
-#if QT_VERSION >= 0x050000
-    QByteArray sig(method.methodSignature());
-#else
     QByteArray sig(method.signature());
-#endif
     return sig.left(sig.indexOf("("));
 }
 
 
 QString SignalProxy::ExtendedMetaObject::methodBaseName(const QMetaMethod &method)
 {
-#if QT_VERSION >= 0x050000
-    QString methodname = QString(method.methodSignature()).section("(", 0, 0);
-#else
     QString methodname = QString(method.signature()).section("(", 0, 0);
-#endif
 
     // determine where we have to chop:
     int upperCharPos;
@@ -992,11 +960,7 @@ SignalProxy::ExtendedMetaObject::MethodDescriptor::MethodDescriptor(const QMetaM
     _argTypes = argTypes;
 
     // determine minArgCount
-#if QT_VERSION >= 0x050000
-    QString signature(method.methodSignature());
-#else
     QString signature(method.signature());
-#endif
     _minArgCount = method.parameterTypes().count() - signature.count("=");
 
     _receiverMode = (_methodName.startsWith("request"))
index 294a408..38477f6 100644 (file)
@@ -114,11 +114,7 @@ QVariantMap SyncableObject::toVariantMap()
 
         QVariant::Type variantType = QVariant::nameToType(method.typeName());
         if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) {
-#if QT_VERSION >= 0x050000
-            kWarning(300000) << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
-#else
             kWarning(300000) << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
-#endif
             continue;
         }
 
index ffd1d34..978d97f 100644 (file)
@@ -416,11 +416,7 @@ void CoreNetwork::socketHasData()
         else if (s.endsWith("\n"))
             s.chop(1);
         NetworkDataEvent *event = new NetworkDataEvent(EventManager::NetworkIncoming, this, s);
-#if QT_VERSION >= 0x040700
         event->setTimestamp(QDateTime::currentDateTimeUtc());
-#else
-        event->setTimestamp(QDateTime::currentDateTime().toUTC());
-#endif
         emit newEvent(event);
     }
 }
@@ -458,9 +454,7 @@ void CoreNetwork::socketInitialized()
     if (server.useSsl && !socket.isEncrypted())
         return;
 #endif
-#if QT_VERSION >= 0x040600
     socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
-#endif
 
     emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
 
index d309e7b..8b87f55 100644 (file)
@@ -169,11 +169,7 @@ void CoreUserInputHandler::handleCtcp(const BufferInfo &bufferInfo, const QStrin
     QString verboseMessage = i18n("sending CTCP-%1 request to %2").arg(ctcpTag).arg(nick);
 
     if (ctcpTag == "PING") {
-#if QT_VERSION >= 0x040700
         message = QString::number(QDateTime::currentMSecsSinceEpoch());
-#else
-        message = QString::number(QDateTime::currentDateTime().toTime_t());
-#endif
     }
 
     // FIXME make this a proper event
index 8dc0514..c653b74 100644 (file)
@@ -734,12 +734,7 @@ void EventStringifier::handleCtcpPing(CtcpEvent *e)
     if (e->ctcpType() == CtcpEvent::Query)
         defaultHandler(e->ctcpCmd(), e);
     else {
-#if QT_VERSION >= 0x040700
         displayMsg(e, Message::Server, i18n("Received CTCP-PING answer from %1 with %2 milliseconds round trip time")
             .arg(nickFromMask(e->prefix())).arg(QDateTime::fromMSecsSinceEpoch(e->param().toULongLong()).msecsTo(e->timestamp())));
-#else
-        displayMsg(e, Message::Server, i18n("Received CTCP-PING answer from %1 with %2 seconds round trip time")
-            .arg(nickFromMask(e->prefix())).arg(QDateTime::fromTime_t(e->param().toInt()).secsTo(e->timestamp())));
-#endif
     }
 }
index ec152b3..60137be 100644 (file)
@@ -58,11 +58,7 @@ QTcpSocket *SslServer::nextPendingConnection()
         return _pendingConnections.takeFirst();
 }
 
-#if QT_VERSION >= 0x050000
-void SslServer::incomingConnection(qintptr socketDescriptor)
-#else
 void SslServer::incomingConnection(int socketDescriptor)
-#endif
 {
     QSslSocket *serverSocket = new QSslSocket(this);
     if (serverSocket->setSocketDescriptor(socketDescriptor)) {
@@ -135,11 +131,7 @@ bool SslServer::setCertificate(const QString &path)
         kWarning(300000) << "SslServer: Certificate expired on" << _cert.expiryDate().toString();
 
     else { // Qt4's isValid() checks for time range and blacklist; avoid a double warning, hence the else block
-#if QT_VERSION < 0x050000
         if (!_cert.isValid())
-#else
-        if (_cert.isBlacklisted())
-#endif
             kWarning(300000) << "SslServer: Certificate blacklisted";
     }
     if (_key.isNull()) {
index c264453..e91510b 100644 (file)
@@ -43,11 +43,7 @@ public:
     virtual inline bool isCertValid() const { return _isCertValid; }
 
 protected:
-#if QT_VERSION >= 0x050000
-    virtual void incomingConnection(qintptr socketDescriptor);
-#else
     virtual void incomingConnection(int socketDescriptor);
-#endif
 
     virtual bool setCertificate(const QString &path);
 
index 7fb35c0..9d5506c 100644 (file)
@@ -92,9 +92,7 @@ private:
 class SearchHighlightItem : public QObject, public QGraphicsItem
 {
     Q_OBJECT
-#if QT_VERSION >= 0x040600
     Q_INTERFACES(QGraphicsItem)
-#endif
 
 public :
         SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0);
index 6d1763a..61434d1 100644 (file)
@@ -55,11 +55,7 @@ void KNotificationBackend::notify(const Notification &n)
         type = "PrivMsgFocused"; break;
     }
 
-#if QT_VERSION < 0x050000
     QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, Qt::escape(n.message));
-#else
-    QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, n.message.toHtmlEscaped());
-#endif
     KNotification *notification = KNotification::event(type, message, KIcon("dialog-information").pixmap(48), QtUi::mainWindow(),
         KNotification::RaiseWidgetOnActivation
         |KNotification::CloseWhenWidgetActivated
index ee7dc90..1ff0663 100644 (file)
@@ -43,19 +43,11 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
     ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setToolTip("<b>Channel</b>: This regular expression determines for which <b>channels</b> the highlight rule works. Leave blank to match any channel. Put <b>!</b> in the beginning to negate. Case insensitive.");
     ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis("<b>Channel</b>: This regular expression determines for which <b>channels</b> the highlight rule works. Leave blank to match any channel. Put <b>!</b> in the beginning to negate. Case insensitive.");
 
-#if QT_VERSION < 0x050000
     ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
     ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-#else
-    ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
-    ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
-    ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
-    ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
-    ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-#endif
 
     connect(ui.add, SIGNAL(clicked(bool)), this, SLOT(addNewRow()));
     connect(ui.remove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedRows()));
index f11820c..e1eae11 100644 (file)
@@ -87,20 +87,12 @@ void SslInfoDlg::setCurrentCert(int index)
 // in Qt5, subjectInfo returns a QStringList(); turn this into a comma-separated string instead
 QString SslInfoDlg::subjectInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const
 {
-#if QT_VERSION < 0x050000
     return cert.subjectInfo(subjectInfo);
-#else
-    return cert.subjectInfo(subjectInfo).join(", ");
-#endif
 }
 
 
 // same here
 QString SslInfoDlg::issuerInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const
 {
-#if QT_VERSION < 0x050000
     return cert.issuerInfo(subjectInfo);
-#else
-    return cert.issuerInfo(subjectInfo).join(", ");
-#endif
 }
index c641758..17e18c8 100644 (file)
@@ -52,14 +52,10 @@ protected:
     virtual QString iconNameForAction(QAction *action) // TODO Qt 4.7: fixme when we have converted our iconloader
     {
         QIcon icon(action->icon());
-#if QT_VERSION >= 0x040701
         // QIcon::name() is in the 4.7 git branch, but it is not in 4.7 TP.
         // If you get a build error here, you need to update your pre-release
         // of Qt 4.7.
         return icon.isNull() ? QString() : icon.name();
-#else
-        return QString();
-#endif
     }
 };
 
@@ -308,11 +304,7 @@ void StatusNotifierItem::showMessage(const QString &title, const QString &messag
     QString message = message_;
     if (_notificationsClient->isValid()) {
         if (_notificationsClientSupportsMarkup)
-#if QT_VERSION < 0x050000
             message = Qt::escape(message);
-#else
-            message = message.toHtmlEscaped();
-#endif
 
         QStringList actions;
         if (_notificationsClientSupportsActions)
index 1843e20..ddc1952 100644 (file)
@@ -115,19 +115,11 @@ void TopicWidget::setTopic(const QModelIndex &index)
         switch (Client::networkModel()->bufferType(id)) {
         case BufferInfo::StatusBuffer:
             if (network) {
-#if QT_VERSION < 0x050000
                 newtopic = QString("%1 (%2) | %3 | %4")
                            .arg(Qt::escape(network->networkName()))
                            .arg(Qt::escape(network->currentServer()))
                            .arg(i18n("Users: %1").arg(network->ircUsers().count()))
                            .arg(i18n("Lag: %1 msecs").arg(network->latency()));
-#else
-                newtopic = QString("%1 (%2) | %3 | %4")
-                           .arg(network->networkName().toHtmlEscaped())
-                           .arg(network->currentServer().toHtmlEscaped())
-                           .arg(i18n("Users: %1").arg(network->ircUsers().count()))
-                           .arg(i18n("Lag: %1 msecs").arg(network->latency()));
-#endif
             }
             else {
                 newtopic = index0.data(Qt::DisplayRole).toString();
index 00d15c4..324858d 100644 (file)
@@ -392,15 +392,9 @@ void BufferView::setExpandedState(const QModelIndex &networkIdx)
     storeExpandedState(networkIdx); // this call is needed to keep track of the isActive state
 }
 
-#if QT_VERSION < 0x050000
 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
 {
     QTreeView::dataChanged(topLeft, bottomRight);
-#else
-void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
-{
-    QTreeView::dataChanged(topLeft, bottomRight, roles);
-#endif
 
     // determine how many items have been changed and if any of them is a networkitem
     // which just swichted from active to inactive or vice versa
index 1c0c52e..021df37 100644 (file)
@@ -81,11 +81,7 @@ protected:
     virtual void focusInEvent(QFocusEvent *event) { QAbstractScrollArea::focusInEvent(event); }
     virtual void contextMenuEvent(QContextMenuEvent *event);
 
-#if QT_VERSION < 0x050000
     virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
-#else
-    virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
-#endif
 
 private slots:
     void joinChannel(const QModelIndex &index);
index b2b3610..a8e2894 100644 (file)
@@ -43,9 +43,7 @@ MultiLineEdit::MultiLineEdit(QWidget *parent)
     _emacsMode(false),
     _lastDocumentHeight(-1)
 {
-#if QT_VERSION >= 0x040500
     document()->setDocumentMargin(0); // new in Qt 4.5 and we really don't want it here
-#endif
 
     setAcceptRichText(false);
     enableFindReplace(false);
@@ -291,12 +289,7 @@ bool MultiLineEdit::event(QEvent *e)
 void MultiLineEdit::keyPressEvent(QKeyEvent *event)
 {
     // Workaround the fact that Qt < 4.5 doesn't know InsertLineSeparator yet
-#if QT_VERSION >= 0x040500
     if (event == QKeySequence::InsertLineSeparator) {
-#else
-
-    if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && event->modifiers() & Qt::SHIFT) {
-#endif
 
         if (_mode == SingleLine) {
             event->accept();
@@ -704,11 +697,7 @@ void MultiLineEdit::on_textChanged()
                 QString msg = i18n("Do you really want to paste %n line(s)?", lines.count());
                 msg += "<p>";
                 for (int i = 0; i < 4; i++) {
-#if QT_VERSION < 0x050000
                     msg += Qt::escape(lines[i].left(40));
-#else
-                    msg += lines[i].left(40).toHtmlEscaped();
-#endif
                     if (lines[i].count() > 40)
                         msg += "...";
                     msg += "<br />";
index e6c0712..af294c4 100644 (file)
@@ -156,11 +156,7 @@ void StyledLabel::setText(const QString &text)
 void StyledLabel::updateToolTip()
 {
     if (frameRect().width() - 2*frameWidth() < _layout.minimumWidth())
-#if QT_VERSION < 0x050000
         setToolTip(QString("<qt>%1</qt>").arg(Qt::escape(_layout.text())));  // only rich text gets wordwrapped!
-#else
-        setToolTip(QString("<qt>%1</qt>").arg(_layout.text().toHtmlEscaped()));  // only rich text gets wordwrapped!
-#endif
     else
         setToolTip(QString());
 }
@@ -216,11 +212,7 @@ int StyledLabel::posToCursor(const QPointF &pos)
 void StyledLabel::mouseMoveEvent(QMouseEvent *event)
 {
     if (event->buttons() == Qt::NoButton) {
-#if QT_VERSION < 0x050000
         Clickable click = _clickables.atCursorPos(posToCursor(event->posF()));
-#else
-        Clickable click = _clickables.atCursorPos(posToCursor(event->localPos()));
-#endif
         if (click.isValid())
             setHoverMode(click.start(), click.length());
         else
@@ -247,11 +239,7 @@ void StyledLabel::leaveEvent(QEvent *)
 void StyledLabel::mousePressEvent(QMouseEvent *event)
 {
     if (event->button() == Qt::LeftButton) {
-#if QT_VERSION < 0x050000
         Clickable click = _clickables.atCursorPos(posToCursor(event->posF()));
-#else
-        Clickable click = _clickables.atCursorPos(posToCursor(event->localPos()));
-#endif
         if (click.isValid())
             emit clickableActivated(click);
     }