Commit f75ec56e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some compile error against qt6

parent 94610f4b
Pipeline #145879 passed with stage
in 2 minutes and 1 second
......@@ -203,7 +203,7 @@ public:
, mWorkingHoursYTop(0)
, mWorkingHoursYBottom(0)
, mHasSelection(false)
, mSelectedId(-1)
, mSelectedId(QChar(-1))
, mMarcusBains(nullptr)
, mActionType(Agenda::NOP)
, mItemMoved(false)
......@@ -406,7 +406,7 @@ void Agenda::init()
d->mItemMoved = false;
d->mSelectedItem = nullptr;
d->mSelectedId = -1;
d->mSelectedId = QChar(-1);
setAcceptDrops(true);
installEventFilter(this);
......
......@@ -1027,7 +1027,11 @@ void AgendaItem::paintEvent(QPaintEvent *ev)
p.setBackground(QBrush(bgColor));
p.setPen(textColor);
QString ws = ww.wrappedString();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (ws.leftRef(ws.length() - 1).indexOf(QLatin1Char('\n')) >= 0) {
#else
if (QStringView(ws).left(ws.length() - 1).indexOf(QLatin1Char('\n')) >= 0) {
#endif
ww.drawText(&p, eventX, y, Qt::AlignLeft | KWordWrap::FadeOut);
} else {
ww.drawText(&p, eventX + (txtWidth - ww.boundingRect().width() - 2 * margin) / 2, y, Qt::AlignHCenter | KWordWrap::FadeOut);
......
......@@ -8,8 +8,8 @@
#include "agendaview.h"
#include "calendarview_debug.h"
#include "helper.h"
#include <CalendarSupport/Utils>
#include <QSharedPointer>
using namespace EventViews;
......@@ -96,13 +96,13 @@ QString MultiViewCalendar::iconForIncidence(const KCalendarCore::Incidence::Ptr
bool MultiViewCalendar::isValid(const KCalendarCore::Incidence::Ptr &incidence) const
{
ViewCalendar::Ptr cal = findCalendar(incidence);
return cal;
return !cal.isNull();
}
bool MultiViewCalendar::isValid(const QString &incidenceIdentifier) const
{
ViewCalendar::Ptr cal = findCalendar(incidenceIdentifier);
return cal;
return !cal.isNull();
}
QColor MultiViewCalendar::resourceColor(const KCalendarCore::Incidence::Ptr &incidence) const
......
......@@ -17,8 +17,11 @@
#include <QBoxLayout>
using namespace EventViews;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void WhatsNextTextBrowser::setSource(const QUrl &name)
#else
void WhatsNextTextBrowser::doSetSource(const QUrl &name, QTextDocument::ResourceType type)
#endif
{
const QString uri = name.toString();
if (uri.startsWith(QLatin1String("event:"))) {
......
......@@ -28,7 +28,11 @@ public:
}
/** Reimplemented from QTextBrowser to handle links. */
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void setSource(const QUrl &name) override;
#else
void doSetSource(const QUrl &name, QTextDocument::ResourceType type = QTextDocument::UnknownResource) override;
#endif
Q_SIGNALS:
void showIncidence(const QString &uid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment