diff --git a/contrib/httpserver/httpconnectionhandler.h b/contrib/httpserver/httpconnectionhandler.h index 79c0a7864..7ea50295b 100644 --- a/contrib/httpserver/httpconnectionhandler.h +++ b/contrib/httpserver/httpconnectionhandler.h @@ -18,11 +18,7 @@ #include "httprequesthandler.h" /** Alias type definition, for compatibility to different Qt versions */ -#if QT_VERSION >= 0x050000 - typedef qintptr tSocketDescriptor; -#else - typedef int tSocketDescriptor; -#endif +typedef qintptr tSocketDescriptor; /** Alias for QSslConfiguration if OpenSSL is not supported */ #ifdef QT_NO_OPENSSL diff --git a/contrib/qtsolutions/flowlayout/flowlayout.cpp b/contrib/qtsolutions/flowlayout/flowlayout.cpp index eb076358d..4c5ffc589 100644 --- a/contrib/qtsolutions/flowlayout/flowlayout.cpp +++ b/contrib/qtsolutions/flowlayout/flowlayout.cpp @@ -155,7 +155,7 @@ QSize FlowLayout::sizeHint() const QSize FlowLayout::minimumSize() const { QSize size; - for (const QLayoutItem *item : qAsConst(itemList)) + for (const QLayoutItem *item : std::as_const(itemList)) size = size.expandedTo(item->minimumSize()); const QMargins margins = contentsMargins(); @@ -176,7 +176,7 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const //! [9] QList lineHeights; - for (QLayoutItem *item : qAsConst(itemList)) { + for (QLayoutItem *item : std::as_const(itemList)) { const QWidget *wid = item->widget(); int spaceX = horizontalSpacing(); if (spaceX == -1) @@ -207,7 +207,7 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const int row = 0; //! [10] - for (QLayoutItem *item : qAsConst(itemList)) { + for (QLayoutItem *item : std::as_const(itemList)) { lineHeight = lineHeights.value(row, item->sizeHint().height()); const QWidget *wid = item->widget(); int spaceX = horizontalSpacing(); diff --git a/contrib/qxt/src/qxtspanslider.cpp b/contrib/qxt/src/qxtspanslider.cpp index def6527c2..be383453b 100644 --- a/contrib/qxt/src/qxtspanslider.cpp +++ b/contrib/qxt/src/qxtspanslider.cpp @@ -625,16 +625,6 @@ void QxtSpanSlider::mousePressEvent(QMouseEvent* event) */ void QxtSpanSlider::mouseMoveEvent(QMouseEvent* event) { - // hack for uncompressed mouse events -#if defined(Q_OS_LINUX) && (QT_VERSION > 0x050000) && (QT_VERSION < 0x050600) - static QTime p; - if (p.elapsed() > 0 && p.elapsed() < 100) { - event->ignore(); - return; - } - p.start(); -#endif - if (qxt_d().lowerPressed != QStyle::SC_SliderHandle && qxt_d().upperPressed != QStyle::SC_SliderHandle) { event->ignore(); diff --git a/contrib/qxt/src/qxtstringspinbox.cpp b/contrib/qxt/src/qxtstringspinbox.cpp index 2e09a8b1c..ddae70c13 100755 --- a/contrib/qxt/src/qxtstringspinbox.cpp +++ b/contrib/qxt/src/qxtstringspinbox.cpp @@ -75,7 +75,7 @@ int QxtStringSpinBoxPrivate::startsWith(const QString& start, QString& string) c */ QxtStringSpinBox::QxtStringSpinBox(QWidget* pParent) : QSpinBox(pParent) { -#if (!defined Q_OS_MAC) && (QT_VERSION >= 0x050000) +#if (!defined Q_OS_MAC) setStyle(QStyleFactory::create("fusion")); #endif setRange(0, 0); diff --git a/contrib/qzip/zip.cpp b/contrib/qzip/zip.cpp index ba994f948..8a6e2ea08 100644 --- a/contrib/qzip/zip.cpp +++ b/contrib/qzip/zip.cpp @@ -739,7 +739,7 @@ void ZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const Q */ ZipReader::ZipReader(const QString &archive, QIODevice::OpenMode mode) { - QScopedPointer f(new QFile(archive)); + std::unique_ptr f = std::make_unique(archive); f->open(mode); ZipReader::Status status; if (f->error() == QFile::NoError) @@ -755,8 +755,7 @@ ZipReader::ZipReader(const QString &archive, QIODevice::OpenMode mode) status = FileError; } - d = new ZipReaderPrivate(f.data(), /*ownDevice=*/true); - f.take(); + d = new ZipReaderPrivate(&(*f), /*ownDevice=*/true); d->status = status; } @@ -1024,7 +1023,7 @@ void ZipReader::close() */ ZipWriter::ZipWriter(const QString &fileName, QIODevice::OpenMode mode) { - QScopedPointer f(new QFile(fileName)); + std::unique_ptr f = std::make_unique(fileName); f->open(mode); ZipWriter::Status status; if (f->error() == QFile::NoError) @@ -1040,8 +1039,7 @@ ZipWriter::ZipWriter(const QString &fileName, QIODevice::OpenMode mode) status = ZipWriter::FileError; } - d = new ZipWriterPrivate(f.data(), /*ownDevice=*/true); - f.take(); + d = new ZipWriterPrivate(&(*f), /*ownDevice=*/true); d->status = status; } diff --git a/src/Charts/AgendaWindow.cpp b/src/Charts/AgendaWindow.cpp index f985cb448..635bcd848 100644 --- a/src/Charts/AgendaWindow.cpp +++ b/src/Charts/AgendaWindow.cpp @@ -430,17 +430,6 @@ AgendaWindow::mkControls controlsTabs->addTab(activityScroller, tr("Activities")); controlsTabs->addTab(eventScroller, tr("Events")); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - connect(agendaPastDaysSpin, QOverload::of(&QSpinBox::valueChanged), this, &AgendaWindow::setAgendaPastDays); - connect(agendaFutureDaysSpin, QOverload::of(&QSpinBox::valueChanged), this, &AgendaWindow::setAgendaFutureDays); - connect(primaryMainCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &AgendaWindow::updateActivities); - connect(primaryFallbackCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &AgendaWindow::updateActivities); - connect(secondaryCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &AgendaWindow::updateActivities); - connect(showTertiaryForCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &AgendaWindow::updateActivities); - connect(tertiaryCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &AgendaWindow::updateActivities); - connect(activityMaxTertiaryLinesSpin, QOverload::of(&QSpinBox::valueChanged), this, &AgendaWindow::setActivityMaxTertiaryLines); - connect(eventMaxTertiaryLinesSpin, QOverload::of(&QSpinBox::valueChanged), this, &AgendaWindow::setEventMaxTertiaryLines); -#else connect(agendaPastDaysSpin, &QSpinBox::valueChanged, this, &AgendaWindow::setAgendaPastDays); connect(agendaFutureDaysSpin, &QSpinBox::valueChanged, this, &AgendaWindow::setAgendaFutureDays); connect(primaryMainCombo, &QComboBox::currentIndexChanged, this, &AgendaWindow::updateActivities); @@ -450,7 +439,6 @@ AgendaWindow::mkControls connect(tertiaryCombo, &QComboBox::currentIndexChanged, this, &AgendaWindow::updateActivities); connect(activityMaxTertiaryLinesSpin, &QSpinBox::valueChanged, this, &AgendaWindow::setActivityMaxTertiaryLines); connect(eventMaxTertiaryLinesSpin, &QSpinBox::valueChanged, this, &AgendaWindow::setEventMaxTertiaryLines); -#endif connect(showSecondaryLabelCheck, &QCheckBox::toggled, this, &AgendaWindow::updateActivities); setControls(controlsTabs); @@ -678,11 +666,8 @@ AgendaWindow::getPhases std::sort(futurePhases.begin(), futurePhases.end(), [](const CalendarEntry &a, const CalendarEntry &b) { return a.spanStart < b.spanStart; }); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - return std::pair, QList>(ongoingPhases, futurePhases); -#else + return std::pair(ongoingPhases, futurePhases); -#endif } diff --git a/src/Charts/AllPlot.cpp b/src/Charts/AllPlot.cpp index f34a844be..1d1cc6569 100644 --- a/src/Charts/AllPlot.cpp +++ b/src/Charts/AllPlot.cpp @@ -7185,7 +7185,7 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) if (mouseEvent->button() == Qt::MouseButton::MiddleButton) { isPanning = true; - panOriginX = mouseEvent->globalX(); + panOriginX = mouseEvent->globalPosition().x(); } } else if (event->type() == QEvent::MouseButtonRelease) @@ -7198,7 +7198,7 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) { // the actual panning logic QMouseEvent* mouseEvent = static_cast(event); - int diffX = mouseEvent->globalX() - panOriginX; + int diffX = mouseEvent->globalPosition().x() - panOriginX; QxtSpanSlider* slider = window->spanSlider; // ride length in seconds @@ -7206,7 +7206,7 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) int movement = (int)(diffX * (total / 1000.0)); if (movement != 0) { - panOriginX = mouseEvent->globalX(); + panOriginX = mouseEvent->globalPosition().x(); int newLower = slider->lowerValue() + movement; int newUpper = slider->upperValue() + movement; if (newUpper <= slider->maximum() && newLower >= slider->minimum()) @@ -7272,18 +7272,18 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) if (axis == QwtAxis::YLeft && event->type() == QEvent::MouseButtonDblClick) { QMouseEvent *m = static_cast(event); - confirmTmpReference(invTransform(axis, m->y()),axis, RideFile::watts, true); // do show delete stuff + confirmTmpReference(invTransform(axis, m->position().y()),axis, RideFile::watts, true); // do show delete stuff return false; } if (axis == QwtAxis::YLeft && event->type() == QEvent::MouseMove) { QMouseEvent *m = static_cast(event); - plotTmpReference(axis, m->x()-axisWidget(axis)->width(), m->y(), RideFile::watts); + plotTmpReference(axis, m->position().x()-axisWidget(axis)->width(), m->position().y(), RideFile::watts); return false; } if (axis == QwtAxis::YLeft && event->type() == QEvent::MouseButtonRelease) { QMouseEvent *m = static_cast(event); - if (m->x()>axisWidget(axis)->width()) { - confirmTmpReference(invTransform(axis, m->y()),axis, RideFile::watts, false); // don't show delete stuff + if (m->position().x()>axisWidget(axis)->width()) { + confirmTmpReference(invTransform(axis, m->position().y()),axis, RideFile::watts, false); // don't show delete stuff return false; } else if (standard->tmpReferenceLines.count()) { plotTmpReference(axis, 0, 0, RideFile::watts); //unplot @@ -7303,18 +7303,18 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) if (axis != QwtAxisId(-1,-1) && event->type() == QEvent::MouseButtonDblClick) { QMouseEvent *m = static_cast(event); - confirmTmpReference(invTransform(axis, m->y()),axis.id, RideFile::hr, true); // do show delete stuff + confirmTmpReference(invTransform(axis, m->position().y()),axis.id, RideFile::hr, true); // do show delete stuff return false; } if (axis != QwtAxisId(-1,-1) && event->type() == QEvent::MouseMove) { QMouseEvent *m = static_cast(event); - plotTmpReference(axis, m->x()-axisWidget(axis)->width(), m->y(), RideFile::hr); + plotTmpReference(axis, m->position().x()-axisWidget(axis)->width(), m->position().y(), RideFile::hr); return false; } if (axis != QwtAxisId(-1,-1) && event->type() == QEvent::MouseButtonRelease) { QMouseEvent *m = static_cast(event); - if (m->x()>axisWidget(axis)->width()) { - confirmTmpReference(invTransform(axis, m->y()),axis.id, RideFile::hr, false); // don't show delete stuff + if (m->position().x()>axisWidget(axis)->width()) { + confirmTmpReference(invTransform(axis, m->position().y()),axis.id, RideFile::hr, false); // don't show delete stuff return false; } else if (standard->tmpReferenceLines.count()) { plotTmpReference(axis.id, 0, 0, RideFile::hr); //unplot @@ -7334,23 +7334,23 @@ AllPlot::eventFilter(QObject *obj, QEvent *event) if (event->type() == QEvent::MouseButtonDblClick) { - confirmTmpExhaustion(m->x(), true); // do show delete stuff + confirmTmpExhaustion(m->position().x(), true); // do show delete stuff return false; } else if (event->type() == QEvent::MouseMove) { // plot a temporary marker - plotTmpExhaustion(m->x()); + plotTmpExhaustion(m->position().x()); return true; } else if (event->type() == QEvent::MouseButtonRelease) { // only respond if we are on the plot, which is above so // therefore has a y-value that is negative - if (m->y() < 0) { + if (m->position().y() < 0) { // confirm and add to references + intervals - confirmTmpExhaustion(m->x()); + confirmTmpExhaustion(m->position().x()); return true; } else { diff --git a/src/Charts/CalendarWindow.cpp b/src/Charts/CalendarWindow.cpp index 4c7d75528..cd07a6437 100644 --- a/src/Charts/CalendarWindow.cpp +++ b/src/Charts/CalendarWindow.cpp @@ -581,16 +581,6 @@ CalendarWindow::mkControls controlsTabs->addTab(centerLayoutInWidget(entriesForm, false), tr("Calendar Entries")); controlsTabs->addTab(multiMetricSelector, tr("Summary")); -#if QT_VERSION < 0x060000 - connect(startHourSpin, QOverload::of(&QSpinBox::valueChanged), this, &CalendarWindow::setStartHour); - connect(endHourSpin, QOverload::of(&QSpinBox::valueChanged), this, &CalendarWindow::setEndHour); - connect(defaultViewCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &CalendarWindow::setDefaultView); - connect(firstDayOfWeekCombo, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int idx) { setFirstDayOfWeek(idx + 1); }); - connect(primaryMainCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &CalendarWindow::updateActivities); - connect(primaryFallbackCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &CalendarWindow::updateActivities); - connect(secondaryCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &CalendarWindow::updateActivities); - connect(tertiaryCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &CalendarWindow::updateActivities); -#else connect(startHourSpin, &QSpinBox::valueChanged, this, &CalendarWindow::setStartHour); connect(endHourSpin, &QSpinBox::valueChanged, this, &CalendarWindow::setEndHour); connect(defaultViewCombo, &QComboBox::currentIndexChanged, this, &CalendarWindow::setDefaultView); @@ -599,7 +589,6 @@ CalendarWindow::mkControls connect(primaryFallbackCombo, &QComboBox::currentIndexChanged, this, &CalendarWindow::updateActivities); connect(secondaryCombo, &QComboBox::currentIndexChanged, this, &CalendarWindow::updateActivities); connect(tertiaryCombo, &QComboBox::currentIndexChanged, this, &CalendarWindow::updateActivities); -#endif connect(summaryDayCheck, &QCheckBox::toggled, this, &CalendarWindow::setSummaryVisibleDay); connect(summaryWeekCheck, &QCheckBox::toggled, this, &CalendarWindow::setSummaryVisibleWeek); connect(summaryMonthCheck, &QCheckBox::toggled, this, &CalendarWindow::setSummaryVisibleMonth); diff --git a/src/Charts/ChartBar.cpp b/src/Charts/ChartBar.cpp index 16e648f45..49556fd1d 100644 --- a/src/Charts/ChartBar.cpp +++ b/src/Charts/ChartBar.cpp @@ -555,8 +555,8 @@ ChartBarItem::event(QEvent *e) // selected with a click (not release) state = Click; - clickpos.setX(static_cast(e)->x()); - clickpos.setY(static_cast(e)->y()); + clickpos.setX(static_cast(e)->position().x()); + clickpos.setY(static_cast(e)->position().y()); emit clicked(checked); } } @@ -605,21 +605,21 @@ ChartBarItem::event(QEvent *e) dragging->checked = checked; dragging->setFixedWidth(geometry().width()); dragging->setFixedHeight(geometry().height()); - QPoint newpos = chartbar->mapFromGlobal(static_cast(e)->globalPos()); + QPoint newpos = chartbar->mapFromGlobal(static_cast(e)->globalPosition().toPoint()); dragging->move(QPoint(newpos.x()-clickpos.x(),0)); dragging->show(); } else if (state == Drag) { // move the clone tab for visual feedback - QPoint newpos = chartbar->mapFromGlobal(static_cast(e)->globalPos()); + QPoint newpos = chartbar->mapFromGlobal(static_cast(e)->globalPosition().toPoint()); dragging->move(QPoint(newpos.x()-clickpos.x(),0)); // where are we currently? int cindex = chartbar->layout->indexOf(this); // work out where we should have dragged to - int indexpos = indexPos(static_cast(e)->x()); + int indexpos = indexPos(static_cast(e)->position().x()); // if moving left, just do it... if (cindex > indexpos) { diff --git a/src/Charts/GcOverlayWidget.cpp b/src/Charts/GcOverlayWidget.cpp index 2a0b7531e..7dc39afb0 100644 --- a/src/Charts/GcOverlayWidget.cpp +++ b/src/Charts/GcOverlayWidget.cpp @@ -267,7 +267,7 @@ bool GcOverlayWidget::eventFilter( QObject *obj, QEvent *evt ) void GcOverlayWidget::mousePressEvent(QMouseEvent *e) { - position = QPoint(e->globalX()-geometry().x(), e->globalY()-geometry().y()); + position = QPoint(e->globalPosition().x()-geometry().x(), e->globalPosition().y()-geometry().y()); if (!m_isEditing) return; if (!m_infocus) return; //QWidget::mouseMoveEvent(e); @@ -386,13 +386,13 @@ void GcOverlayWidget::mouseMoveEvent(QMouseEvent *e) if (!m_isEditing) return; if (!m_infocus) return; if (!(e->buttons() & Qt::LeftButton)) { - QPoint p = QPoint(e->x()+geometry().x(), e->y()+geometry().y()); + QPoint p = QPoint(e->position().x()+geometry().x(), e->position().y()+geometry().y()); setCursorShape(p); return; } if (mode == moving && (e->buttons() & Qt::LeftButton)) { - QPoint toMove = e->globalPos() - position; + QPoint toMove = e->globalPosition().toPoint() - position; if (toMove.x() < 0) return; if (toMove.y() < 0) return; if (toMove.x() > parentWidget()->width()-width()) return; @@ -404,47 +404,47 @@ void GcOverlayWidget::mouseMoveEvent(QMouseEvent *e) if ((mode != moving) && (e->buttons() & Qt::LeftButton)) { switch (mode){ case resizetl: { //Left-Top - int newwidth = e->globalX() - position.x() - geometry().x(); - int newheight = e->globalY() - position.y() - geometry().y(); - QPoint toMove = e->globalPos() - position; + int newwidth = e->globalPosition().x() - position.x() - geometry().x(); + int newheight = e->globalPosition().y() - position.y() - geometry().y(); + QPoint toMove = e->globalPosition().toPoint() - position; resize(geometry().width()-newwidth,geometry().height()-newheight); move(toMove.x(),toMove.y()); break; } case resizetr: { //Right-Top - int newheight = e->globalY() - position.y() - geometry().y(); - QPoint toMove = e->globalPos() - position; - resize(e->x(),geometry().height()-newheight); + int newheight = e->globalPosition().y() - position.y() - geometry().y(); + QPoint toMove = e->globalPosition().toPoint() - position; + resize(e->position().x(),geometry().height()-newheight); move(x(),toMove.y()); break; } case resizebl: { //Left-Bottom - int newwidth = e->globalX() - position.x() - geometry().x(); - QPoint toMove = e->globalPos() - position; - resize(geometry().width()-newwidth,e->y()); + int newwidth = e->globalPosition().x() - position.x() - geometry().x(); + QPoint toMove = e->globalPosition().toPoint() - position; + resize(geometry().width()-newwidth,e->position().y()); move(toMove.x(),y()); break; } case resizeb: { //Bottom - resize(width(),e->y()); break;} + resize(width(),e->position().y()); break;} case resizel: { //Left - int newwidth = e->globalX() - position.x() - geometry().x(); - QPoint toMove = e->globalPos() - position; + int newwidth = e->globalPosition().x() - position.x() - geometry().x(); + QPoint toMove = e->globalPosition().toPoint() - position; resize(geometry().width()-newwidth,height()); move(toMove.x(),y()); break; } case resizet: { //Top - int newheight = e->globalY() - position.y() - geometry().y(); - QPoint toMove = e->globalPos() - position; + int newheight = e->globalPosition().y() - position.y() - geometry().y(); + QPoint toMove = e->globalPosition().toPoint() - position; resize(width(),geometry().height()-newheight); move(x(),toMove.y()); break; } case resizer: { //Right - resize(e->x(),height()); break;} + resize(e->position().x(),height()); break;} case resizebr: { //Right-Bottom - resize(e->x(),e->y()); break;} + resize(e->globalPosition().x(),e->position().y()); break;} } parentWidget()->repaint(); } diff --git a/src/Charts/GcPane.cpp b/src/Charts/GcPane.cpp index 200b8727a..af57fefdf 100644 --- a/src/Charts/GcPane.cpp +++ b/src/Charts/GcPane.cpp @@ -150,16 +150,16 @@ GcPane::spotHotSpot(QMouseEvent *e) int corner = closeImage.width()/2; // account for offset - int _y = e->y() - (closeImage.height()/2); - int _x = e->x(); + int _y = e->position().y() - (closeImage.height()/2); + int _x = e->position().x(); int _height = height() - (closeImage.height()/2); int _width = width() - (closeImage.width()/2); - if (e->x() > (width() - (closeImage.width()+10)) && e->y() < (closeImage.height()+12)) + if (e->position().x() > (width() - (closeImage.width()+10)) && e->position().y() < (closeImage.height()+12)) return Close; - else if (e->x() > (width() - 5 - closeImage.width() - flipImage.width()) && - e->x() < (width() - 5 - closeImage.width()) && - e->y() < (closeImage.height()-2)) + else if (e->position().x() > (width() - 5 - closeImage.width() - flipImage.width()) && + e->position().x() < (width() - 5 - closeImage.width()) && + e->position().y() < (closeImage.height()-2)) return Flip; else if (_x <= corner && _y <= corner) return (TLCorner); else if (_x >= (_width-corner) && _y <= corner) return (TRCorner); @@ -173,11 +173,7 @@ GcPane::spotHotSpot(QMouseEvent *e) } void -#if QT_VERSION >= 0x060000 GcPane::enterEvent(QEnterEvent *) -#else -GcPane::enterEvent(QEvent *) -#endif { repaint(); } @@ -214,8 +210,8 @@ GcPane::mousePressEvent(QMouseEvent *e) oHeight = height(); oX = pos().x(); oY = pos().y(); - mX = e->globalX(); - mY = e->globalY(); + mX = e->globalPosition().x(); + mY = e->globalPosition().y(); setDragState(h); // set drag state then! @@ -239,8 +235,8 @@ GcPane::mouseMoveEvent(QMouseEvent *e) } // work out the relative move x and y - int relx = e->globalX() - mX; - int rely = e->globalY() - mY; + int relx = e->globalPosition().x() - mX; + int rely = e->globalPosition().y() - mY; switch (dragState) { diff --git a/src/Charts/GcPane.h b/src/Charts/GcPane.h index 4d6f3fc76..6b7e79ca2 100644 --- a/src/Charts/GcPane.h +++ b/src/Charts/GcPane.h @@ -54,11 +54,7 @@ class GcPane : public QWidget virtual void mousePressEvent(QMouseEvent *) override; virtual void mouseReleaseEvent(QMouseEvent *) override; virtual void mouseMoveEvent(QMouseEvent *) override; -#if QT_VERSION >= 0x060000 virtual void enterEvent(QEnterEvent *) override; -#else - virtual void enterEvent(QEvent *) override; -#endif virtual void leaveEvent(QEvent *) override; virtual bool eventFilter(QObject *object, QEvent *e) override; virtual void resizeEvent (QResizeEvent * e) override; diff --git a/src/Charts/GenericPlot.cpp b/src/Charts/GenericPlot.cpp index 7c7f60357..599fe2386 100644 --- a/src/Charts/GenericPlot.cpp +++ b/src/Charts/GenericPlot.cpp @@ -618,9 +618,6 @@ GenericPlot::addCurve(QString name, QVector xseries, QVector yse // hardware support? chartview->setRenderHint(QPainter::Antialiasing); -#if QT_VERSION < 0x060400 - add->setUseOpenGL(opengl); // for scatter or line only apparently -#endif qchart->setDropShadowEnabled(false); // no line, we are invisible @@ -697,9 +694,6 @@ GenericPlot::addCurve(QString name, QVector xseries, QVector yse // hardware support? chartview->setRenderHint(QPainter::Antialiasing); -#if QT_VERSION < 0x060400 - dec->setUseOpenGL(opengl); // for scatter or line only apparently -#endif qchart->setDropShadowEnabled(false); // chart @@ -764,9 +758,6 @@ GenericPlot::addCurve(QString name, QVector xseries, QVector yse // hardware support? chartview->setRenderHint(QPainter::Antialiasing); -#if QT_VERSION < 0x060400 - add->setUseOpenGL(opengl); // for scatter or line only apparently -#endif qchart->setDropShadowEnabled(false); // chart @@ -796,9 +787,6 @@ GenericPlot::addCurve(QString name, QVector xseries, QVector yse // hardware support? chartview->setRenderHint(QPainter::Antialiasing); -#if QT_VERSION < 0x060400 - dec->setUseOpenGL(opengl); // for scatter or line only apparently -#endif qchart->setDropShadowEnabled(false); // chart diff --git a/src/Charts/GenericSelectTool.cpp b/src/Charts/GenericSelectTool.cpp index bf897ebe2..382a61aa8 100644 --- a/src/Charts/GenericSelectTool.cpp +++ b/src/Charts/GenericSelectTool.cpp @@ -701,6 +701,7 @@ GenericSelectTool::moved(QPointF pos) // pointsVector if (series->type() == QAbstractSeries::SeriesTypeLine || series->type() == QAbstractSeries::SeriesTypeArea) { + QXYSeries *line = series->type() == QAbstractSeries::SeriesTypeLine ? static_cast(series) : static_cast(series)->upperSeries(); // value we want @@ -721,7 +722,6 @@ GenericSelectTool::moved(QPointF pos) if (p.x() != 0 && (nearestx == -9999 || (std::fabs(p.x()-xvalue)) < std::fabs((nearestx-xvalue)))) nearestx = p.x(); } } - } // run over what we found, updating paint points and signal (for legend) @@ -1009,10 +1009,8 @@ GenericSelectTool::updateScene() selection->setName(QString("%1_select").arg(line->name())); // all of this curve cloning should be in a new method xxx todo -#if QT_VERSION < 0x060400 - selection->setUseOpenGL(line->useOpenGL()); -#endif selection->setPen(line->pen()); + if (line->useOpenGL()) selection->setColor(Qt::gray); // use opengl ignores changing colors else { @@ -1087,9 +1085,7 @@ GenericSelectTool::updateScene() // all of this curve cloning should be in a new method xxx todo host->qchart->addSeries(selection); // before adding data and axis -#if QT_VERSION < 0x060400 - selection->setUseOpenGL(scatter->useOpenGL()); -#endif + if (selection->useOpenGL()) selection->setColor(Qt::gray); // use opengl ignores changing colors else { diff --git a/src/Charts/GoldenCheetah.cpp b/src/Charts/GoldenCheetah.cpp index 0b261279f..bbec73672 100644 --- a/src/Charts/GoldenCheetah.cpp +++ b/src/Charts/GoldenCheetah.cpp @@ -416,8 +416,8 @@ GcWindow::spotHotSpot(QMouseEvent *e) int borderWidth = 3; // account for offset by mapping to GcWindow geom - int _y = e->y(); - int _x = e->x(); + int _y = e->position().y(); + int _x = e->position().x(); int _height = height(); int _width = width(); @@ -647,11 +647,7 @@ GcWindow::setCursorShape(DragState d) } void -#if QT_VERSION >= 0x060000 GcWindow::enterEvent(QEnterEvent *) -#else -GcWindow::enterEvent(QEvent *) -#endif { if (_noevents) return; @@ -939,10 +935,6 @@ GcChartWindow::saveChart() // lets go to it QTextStream out(&outfile); -#if QT_VERSION < 0x060000 - out.setCodec ("UTF-8"); -#endif - serializeChartToQTextStream(out); // all done @@ -1004,10 +996,8 @@ GcChartWindow::chartPropertiesFromFile(QString filename) // read in the whole thing QTextStream in(&file); + // GC .JSON is stored in UTF-8 with BOM(Byte order mark) for identification -#if QT_VERSION < 0x060000 - in.setCodec ("UTF-8"); -#endif contents = in.readAll(); file.close(); } @@ -1024,7 +1014,7 @@ GcChartWindow::chartPropertiesFromString(QString contents) { QList > returning; - // parse via MVJson to avoid QT5 dependency + // parse via MVJson MVJSONReader json(string(contents.toStdString())); if (json.root && json.root->hasField("CHART")) { @@ -1090,9 +1080,6 @@ GcChartWindow::exportChartToCloudDB() chart.Header.GcVersion = QString::number(version); // get the gchart - definition json QTextStream out(&chart.ChartDef); -#if QT_VERSION < 0x060000 - out.setCodec ("UTF-8"); -#endif serializeChartToQTextStream(out); out.flush(); // get Type and View from properties diff --git a/src/Charts/GoldenCheetah.h b/src/Charts/GoldenCheetah.h index 63982b811..2e4a5ce29 100644 --- a/src/Charts/GoldenCheetah.h +++ b/src/Charts/GoldenCheetah.h @@ -47,12 +47,10 @@ class Perspective; #include "TimeUtils.h" class RideItem; -#if QT_VERSION >= 0x060000 // For RideItem and Perspective properties, this is required. // A normal include would lead to a circular dependency here. Q_MOC_INCLUDE("RideItem.h"); Q_MOC_INCLUDE("Perspective.h"); -#endif class GcOverlayWidget; class Perspective; @@ -228,11 +226,7 @@ public: void mousePressEvent(QMouseEvent *) override; void mouseReleaseEvent(QMouseEvent *) override; void mouseMoveEvent(QMouseEvent *) override; -#if QT_VERSION >= 0x060000 void enterEvent(QEnterEvent *) override; -#else - void enterEvent(QEvent *) override; -#endif void leaveEvent(QEvent *) override; void setDragState(DragState); void setCursorShape(DragState); diff --git a/src/Charts/LTMChartParser.cpp b/src/Charts/LTMChartParser.cpp index d227438ab..62f7b4711 100644 --- a/src/Charts/LTMChartParser.cpp +++ b/src/Charts/LTMChartParser.cpp @@ -96,10 +96,6 @@ LTMChartParser::serialize(QString filename, QList charts) }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif - serializeToQTextStream(out, charts); // close file @@ -110,10 +106,6 @@ void LTMChartParser::serializeToQString(QString* string, QList charts) { QTextStream out(string); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif - serializeToQTextStream(out, charts); // write all to out @@ -158,7 +150,7 @@ ChartTreeView::ChartTreeView(Context *context) : context(context) void ChartTreeView::dropEvent(QDropEvent* event) { - QTreeWidgetItem* target = (QTreeWidgetItem *)itemAt(event->pos()); + QTreeWidgetItem* target = (QTreeWidgetItem *)itemAt(event->position().toPoint()); int idxTo = indexFromItem(target).row(); // when dragging to past the last one, we get -1, so lets @@ -206,12 +198,7 @@ ChartTreeView::mimeTypes() const } QMimeData * -ChartTreeView::mimeData -#if QT_VERSION < 0x060000 -(const QList items) const -#else -(const QList &items) const -#endif +ChartTreeView::mimeData(const QList &items) const { QMimeData *returning = new QMimeData; diff --git a/src/Charts/LTMChartParser.h b/src/Charts/LTMChartParser.h index 52541ddd9..4650f35b2 100644 --- a/src/Charts/LTMChartParser.h +++ b/src/Charts/LTMChartParser.h @@ -62,11 +62,7 @@ class ChartTreeView : public QTreeWidget // for drag/drop QStringList mimeTypes () const override; -#if QT_VERSION < 0x060000 - QMimeData *mimeData(const QList items) const override; -#else QMimeData *mimeData(const QList &items) const override; -#endif signals: void itemMoved(QTreeWidgetItem* item, int previous, int actual); diff --git a/src/Charts/LTMPlot.cpp b/src/Charts/LTMPlot.cpp index 3c4294026..cab3c8f47 100644 --- a/src/Charts/LTMPlot.cpp +++ b/src/Charts/LTMPlot.cpp @@ -280,11 +280,7 @@ LTMPlot::setData(LTMSettings *set) setAxisVisible(QwtAxis::XTop, false); // wipe existing curves/axes details -#if QT_VERSION >= 0x060000 QMultiHashIterator c(curves); -#else - QHashIterator c(curves); -#endif while (c.hasNext()) { c.next(); QString symbol = c.key(); @@ -1360,11 +1356,7 @@ LTMPlot::setData(LTMSettings *set) refreshZoneLabels(QwtAxisId(-1,-1)); // turn em off } -#if QT_VERSION >= 0x060000 QMultiHashIterator p(curves); -#else - QHashIterator p(curves); -#endif while (p.hasNext()) { p.next(); @@ -1415,11 +1407,7 @@ LTMPlot::setCompareData(LTMSettings *set) //qDebug()<<"Starting.."<= 0x060000 QMultiHashIterator c(curves); -#else - QHashIterator c(curves); -#endif while (c.hasNext()) { c.next(); QString symbol = c.key(); @@ -2504,11 +2492,7 @@ LTMPlot::setCompareData(LTMSettings *set) if (settings->legend == false) this->legend()->hide(); else this->legend()->show(); -#if QT_VERSION >= 0x060000 QMultiHashIterator p(curves); -#else - QHashIterator p(curves); -#endif while (p.hasNext()) { p.next(); @@ -4049,11 +4033,7 @@ LTMPlot::pointHover(QwtPlotCurve *curve, int index) // we reference the metric definitions of name and // units to decide on the level of precision required -#if QT_VERSION >= 0x060000 QMultiHashIterator c(curves); -#else - QHashIterator c(curves); -#endif while (c.hasNext()) { c.next(); if (c.value() == curve) { diff --git a/src/Charts/LTMSettings.h b/src/Charts/LTMSettings.h index 81997b7f5..1d4594f2a 100644 --- a/src/Charts/LTMSettings.h +++ b/src/Charts/LTMSettings.h @@ -226,10 +226,6 @@ class LTMSettings { public: LTMSettings() { -#if QT_VERSION < 0x060000 - // we need to register the stream operators - qRegisterMetaTypeStreamOperators("LTMSettings"); -#endif bests = NULL; ltmTool = NULL; } diff --git a/src/Charts/LTMWindow.cpp b/src/Charts/LTMWindow.cpp index 2710d92a1..97f045f70 100644 --- a/src/Charts/LTMWindow.cpp +++ b/src/Charts/LTMWindow.cpp @@ -1677,9 +1677,6 @@ LTMWindow::exportData() // open stream and write header QTextStream stream(&f); -#if QT_VERSION < 0x060000 - stream.setCodec("UTF-8"); // Names and Units can be translated -#endif stream << content; // and we're done diff --git a/src/Charts/Overview.cpp b/src/Charts/Overview.cpp index 5fd6c1ae7..813f642bd 100644 --- a/src/Charts/Overview.cpp +++ b/src/Charts/Overview.cpp @@ -412,13 +412,13 @@ badconfig: QVector widths; QJsonArray w = root["widths"].toArray(); - foreach(const QJsonValue width, w) widths << width.toInt(); + for(const QJsonValue &width : w) widths << width.toInt(); space->setColumnWidths(widths); } // cards QJsonArray CHARTS = root["CHARTS"].toArray(); - foreach(const QJsonValue val, CHARTS) { + for(const QJsonValue &val : CHARTS) { // convert so we can inspect QJsonObject obj = val.toObject(); @@ -733,9 +733,6 @@ OverviewConfigDialog::exportChart() // truncate and start a stream outfile.resize(0); QTextStream out(&outfile); -#if QT_VERSION < 0x060000 - out.setCodec ("UTF-8"); -#endif QString viewName; int chartId = GcWindowTypes::None; diff --git a/src/Charts/OverviewItems.cpp b/src/Charts/OverviewItems.cpp index 9eb9fbbab..37b328f2f 100644 --- a/src/Charts/OverviewItems.cpp +++ b/src/Charts/OverviewItems.cpp @@ -2955,9 +2955,6 @@ DataOverviewItem::exportData() // stream, output without a BOM, unlikely to be expected (?) QTextStream out(&file); // unified codepage and BOM for identification on all platforms -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif //out.setGenerateByteOrderMark(true); // headers- taking care to protect for csv output diff --git a/src/Charts/RCanvas.cpp b/src/Charts/RCanvas.cpp index f41193a17..ce586f367 100644 --- a/src/Charts/RCanvas.cpp +++ b/src/Charts/RCanvas.cpp @@ -22,10 +22,6 @@ #include "Colors.h" #include "AbstractView.h" -#if QT_VERSION < 0x060000 -#include -#endif - // // // NOTE: X/Y CO-ORDINATES @@ -52,16 +48,6 @@ RCanvas::RCanvas(Context *context, QWidget *parent) : QGraphicsView(parent), con // no frame, its ugly setFrameStyle(QFrame::NoFrame); -#if QT_VERSION < 0x060000 -#ifdef Q_OS_LINUX // mac and windows both have issues. sigh. - // Enabled on Linux depending on Open GL version - if (QGLFormat::openGLVersionFlags().testFlag(QGLFormat::OpenGL_Version_2_0)) { - setViewport(new QGLWidget( QGLFormat(QGL::SampleBuffers))); - setViewportUpdateMode(QGraphicsView::FullViewportUpdate); - } -#endif -#endif - // allow to click and drag setDragMode(QGraphicsView::ScrollHandDrag); diff --git a/src/Charts/RideMapWindow.cpp b/src/Charts/RideMapWindow.cpp index 30dbeed80..3406f2e1c 100644 --- a/src/Charts/RideMapWindow.cpp +++ b/src/Charts/RideMapWindow.cpp @@ -1708,7 +1708,7 @@ MapWebBridge::drawOverlays() QString wNameEx = tr("Selection #"); if (wNameItr.contains(wNameEx, Qt::CaseSensitive)) { - int wSelCount = wNameItr.count() - wNameEx.count(); + int wSelCount = wNameItr.length() - wNameEx.length(); wNameSelectionIndexList.append(wNameItr.right(wSelCount).toInt()); } } diff --git a/src/Charts/SeriesIterator.h b/src/Charts/SeriesIterator.h index f0c65a84a..6d98d9ced 100644 --- a/src/Charts/SeriesIterator.h +++ b/src/Charts/SeriesIterator.h @@ -22,8 +22,14 @@ // Minimal iterator to traverse QXYSeries points without copying // Required to use std::lower_bound on QXYSeries data in-place -class SeriesIterator : public std::iterator { +class SeriesIterator { public: + typedef std::random_access_iterator_tag iterator_category; + typedef QPointF value_type; + typedef ptrdiff_t difference_type; + typedef QPointF* pointer; + typedef QPointF& reference; + SeriesIterator(QXYSeries *series, int index) : m_series(series), m_index(index) {} QPointF operator*() const { return m_series->at(m_index); } diff --git a/src/Charts/UserChart.cpp b/src/Charts/UserChart.cpp index d23e32bd9..1e0b88a89 100644 --- a/src/Charts/UserChart.cpp +++ b/src/Charts/UserChart.cpp @@ -567,9 +567,7 @@ UserChart::settings() const QString returning; QTextStream out(&returning); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif + out << "{ "; // chartinfo @@ -683,7 +681,7 @@ UserChart::applySettings(QString x) delete static_cast(series.user1); seriesinfo.clear(); - foreach(QJsonValue it, obj["SERIES"].toArray()) { + for(const QJsonValue &it : obj["SERIES"].toArray()) { // should be an array of objects QJsonObject series=it.toObject(); @@ -715,7 +713,7 @@ UserChart::applySettings(QString x) // array of axes axisinfo.clear(); - foreach(QJsonValue it, obj["AXES"].toArray()) { + for(const QJsonValue &it : obj["AXES"].toArray()) { // should be an array of objects QJsonObject axis=it.toObject(); diff --git a/src/Cloud/Nolio.cpp b/src/Cloud/Nolio.cpp index 51bb05359..5883728fe 100644 --- a/src/Cloud/Nolio.cpp +++ b/src/Cloud/Nolio.cpp @@ -342,7 +342,7 @@ QByteArray* Nolio::prepareResponse(QByteArray* data){ if (laps.size() > 0){ double start = 0.0; double end = 0.0; - foreach (QJsonValue value, laps) { + for (const QJsonValue &value : laps) { QJsonObject lap = value.toObject(); double duration = lap["duration"].toDouble(); if (start > 0.0){ diff --git a/src/Cloud/OAuthDialog.h b/src/Cloud/OAuthDialog.h index dade803ee..4fed0a73b 100644 --- a/src/Cloud/OAuthDialog.h +++ b/src/Cloud/OAuthDialog.h @@ -27,8 +27,6 @@ #include #include #include - -// QUrl split into QUrlQuerty in QT5 #include #include diff --git a/src/Cloud/Strava.cpp b/src/Cloud/Strava.cpp index 07ae7a7a5..dc0ab221d 100644 --- a/src/Cloud/Strava.cpp +++ b/src/Cloud/Strava.cpp @@ -966,7 +966,7 @@ Strava::prepareResponse(QByteArray* data) QJsonArray laps = each["laps"].toArray(); double last_lap = 0.0; - foreach (QJsonValue value, laps) { + for (const QJsonValue &value : laps) { QJsonObject lap = value.toObject(); double start = starttime.secsTo(QDateTime::fromString(lap["start_date_local"].toString(), Qt::ISODate)); diff --git a/src/Core/APIWebService.cpp b/src/Core/APIWebService.cpp index bfddad90e..c0d7ce44d 100644 --- a/src/Core/APIWebService.cpp +++ b/src/Core/APIWebService.cpp @@ -395,9 +395,6 @@ APIWebService::listActivity(QString athlete, QStringList paths, HttpRequest &req // read in the whole thing out.open(QFile::ReadOnly | QFile::Text); QTextStream in(&out); -#if QT_VERSION < 0x060000 - in.setCodec ("UTF-8"); -#endif contents = in.readAll(); out.close(); diff --git a/src/Core/DataFilter.h b/src/Core/DataFilter.h index 2b7c8102d..f0060118f 100644 --- a/src/Core/DataFilter.h +++ b/src/Core/DataFilter.h @@ -47,9 +47,6 @@ class Result { Result (double value) : isNumber(true), string_(""), number_(value) {} Result (QVectorx) : isNumber(true), string_(""), number_(0), vector(x) { foreach(double n, x) number_ += n; } Result (QString value) : isNumber(false), string_(value), number_(0.0f) {} -#if QT_VERSION < 0x060000 - Result (QVector &list) : isNumber(false), string_(""), number_(0.0f), strings(list) {} -#endif Result (QStringList &list) : isNumber(false), string_(""), number_(0.0f) { foreach (QString string, list) strings< &data) }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif Measure *m = NULL; QJsonArray measures; @@ -360,10 +353,6 @@ Measures::Measures(QDir dir, bool withData) : dir(dir), withData(withData) QSettings config(filename, QSettings::IniFormat); -#if QT_VERSION < 0x060000 - config.setIniCodec("UTF-8"); // to allow translated names -#endif - foreach (QString group, config.value("Measures", "").toStringList()) { if (getGroupSymbols().contains(group)) continue; @@ -431,10 +420,6 @@ Measures::saveConfig() QString filename = QDir(gcroot).canonicalPath() + "/measures.ini"; QSettings config(filename, QSettings::IniFormat); -#if QT_VERSION < 0x060000 - config.setIniCodec("UTF-8"); // to allow translated names -#endif - config.clear(); config.setValue("Measures", getGroupSymbols()); diff --git a/src/Core/NamedSearch.cpp b/src/Core/NamedSearch.cpp index 142510b42..61e8e3c7a 100644 --- a/src/Core/NamedSearch.cpp +++ b/src/Core/NamedSearch.cpp @@ -204,9 +204,6 @@ NamedSearchParser::serialize(QString filename, QListNamedSearches) }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // begin document out << "\n"; diff --git a/src/Core/RideCache.cpp b/src/Core/RideCache.cpp index ea1370a30..5158c53cd 100644 --- a/src/Core/RideCache.cpp +++ b/src/Core/RideCache.cpp @@ -463,9 +463,6 @@ RideCache::writeAsCSV(QString filename) }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); // Metric names can be translated -#endif // write headings out<<"date, time, filename"; diff --git a/src/Core/RideDB.y b/src/Core/RideDB.y index 940f64a9c..ae7171b35 100644 --- a/src/Core/RideDB.y +++ b/src/Core/RideDB.y @@ -491,9 +491,6 @@ void RideCache::save(bool opendata, QString filename) // ok, lets write out the cache QTextStream stream(&rideDB); -#if QT_VERSION < 0x060000 - stream.setCodec("UTF-8"); -#endif // no BOM needed for opendata as it doesn't contain textual data if (!opendata) stream.setGenerateByteOrderMark(true); @@ -992,9 +989,6 @@ APIWebService::listRides(QString athlete, HttpRequest &request, HttpResponse &re // ok, lets read it in QTextStream stream(&rideDB); -#if QT_VERSION < 0x060000 - stream.setCodec("UTF-8"); -#endif // Read the entire file into a QString -- we avoid using fopen since it // doesn't handle foreign characters well. Instead we use QFile and parse diff --git a/src/Core/RideItem.cpp b/src/Core/RideItem.cpp index 22f701df9..a9f0f0ab6 100644 --- a/src/Core/RideItem.cpp +++ b/src/Core/RideItem.cpp @@ -168,11 +168,7 @@ RideItem::metaCRC() ba.append(i.key().toUtf8()); ba.append(i.value().toUtf8()); } -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } RideFile *RideItem::ride(bool open) diff --git a/src/Core/Route.cpp b/src/Core/Route.cpp index f3c2f0b0d..f4727f41f 100644 --- a/src/Core/Route.cpp +++ b/src/Core/Route.cpp @@ -338,11 +338,7 @@ Routes::getFingerprint() const foreach(RouteSegment segment, routes) ba += segment.id().toByteArray(); // we spot other things separately -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } void diff --git a/src/Core/SeasonDialogs.cpp b/src/Core/SeasonDialogs.cpp index 6901fe2ea..d979afd9a 100644 --- a/src/Core/SeasonDialogs.cpp +++ b/src/Core/SeasonDialogs.cpp @@ -662,12 +662,7 @@ SeasonTreeView::mimeTypes() const } QMimeData * -SeasonTreeView::mimeData -#if QT_VERSION < 0x060000 -(const QList items) const -#else -(const QList &items) const -#endif +SeasonTreeView::mimeData(const QList &items) const { QMimeData *returning = new QMimeData; diff --git a/src/Core/SeasonDialogs.h b/src/Core/SeasonDialogs.h index 9657a1fa4..a0d0f38c4 100644 --- a/src/Core/SeasonDialogs.h +++ b/src/Core/SeasonDialogs.h @@ -153,11 +153,7 @@ class SeasonTreeView : public QTreeWidget // for drag/drop QStringList mimeTypes () const override; -#if QT_VERSION < 0x060000 - QMimeData *mimeData(const QList items) const override; -#else QMimeData *mimeData(const QList &items) const override; -#endif signals: void itemMoved(QTreeWidgetItem* item, int previous, int actual); diff --git a/src/Core/Seasons.cpp b/src/Core/Seasons.cpp index b32cdc40c..f254b04bb 100644 --- a/src/Core/Seasons.cpp +++ b/src/Core/Seasons.cpp @@ -235,9 +235,6 @@ SeasonParser::serialize(QString filename, QList Seasons) }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // begin document out << "\n"; diff --git a/src/Core/main.cpp b/src/Core/main.cpp index c3cfd5f80..156b1c928 100644 --- a/src/Core/main.cpp +++ b/src/Core/main.cpp @@ -57,10 +57,8 @@ #include #ifdef Q_OS_WIN -#if QT_VERSION > 0x060500 #include #endif -#endif // // bootstrap state @@ -224,9 +222,6 @@ main(int argc, char *argv[]) freopen("CONOUT$", "w", stderr); freopen("CONOUT$", "w", stdout); } -#if QT_VERSION < 0x060000 - bool angle=true; -#endif #endif // @@ -300,11 +295,6 @@ main(int argc, char *argv[]) #endif #ifdef GC_WANT_R fprintf(stderr, "--no-r to disable R startup\n"); -#endif -#ifdef Q_OS_WIN -#if QT_VERSION < 0x060000 - fprintf(stderr, "--no-angle to disable ANGLE rendering\n"); -#endif #endif fprintf (stderr, "\nSpecify the folder and/or athlete to open on startup\n"); fprintf(stderr, "If no parameters are passed it will reopen the last athlete.\n\n"); @@ -360,12 +350,6 @@ main(int argc, char *argv[]) #else fprintf(stderr, "CloudDB support not compiled in, exiting.\n"); exit(1); -#endif -#ifdef Q_OS_WIN -#if QT_VERSION < 0x060000 - } else if (arg == "--no-angle") { - angle = false; -#endif #endif } else { @@ -422,26 +406,14 @@ main(int argc, char *argv[]) // what to do. We may add our own error handler later. gsl_set_error_handler_off(); -#ifdef Q_OS_WIN -#if QT_VERSION < 0x060000 - if (angle) { - // windows we use ANGLE for opengl on top of DirectX/Direct3D - // it avoids issues with bad graphics drivers - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - } -#endif -#endif - // create the application -- only ever ONE regardless of restarts application = new QApplication(argc, argv); #ifdef Q_OS_WIN -#if QT_VERSION > 0x060500 if (application->style()->name() == "windows11") { application->setStyle(QStyleFactory::create("Windows")); qDebug()<<"Replacing windows11 by Windows style to avoid a Qt bug"; } -#endif #endif //XXXIdleEventFilter idleFilter; diff --git a/src/FileIO/BinRideFile.cpp b/src/FileIO/BinRideFile.cpp index 480b92941..64b0029cb 100644 --- a/src/FileIO/BinRideFile.cpp +++ b/src/FileIO/BinRideFile.cpp @@ -290,7 +290,7 @@ struct BinFileReaderState QString deviceInfo = ""; QDateTime t; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { if (!global_format_identifiers.contains(field.id)) { unknown_format_identifiers.insert(field.id); } else { @@ -408,7 +408,7 @@ struct BinFileReaderState double temperature = RideFile::NA; double lrbalance = RideFile::NA; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { if (!global_format_identifiers.contains(field.id)) { unknown_format_identifiers.insert(field.id); } else { @@ -498,7 +498,7 @@ struct BinFileReaderState int temperature_count = 0; double temperature = 0.0; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { if (!global_format_identifiers.contains(field.id)) { unknown_format_identifiers.insert(field.id); } else { @@ -528,7 +528,7 @@ struct BinFileReaderState int i = 0; double secs = 0; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { if (!global_format_identifiers.contains(field.id)) { unknown_format_identifiers.insert(field.id); } else { @@ -555,7 +555,7 @@ struct BinFileReaderState void decodeDataError(const BinDefinition &def, const std::vector values) { int i = 0; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { if (!global_format_identifiers.contains(field.id)) { unknown_format_identifiers.insert(field.id); } else { @@ -592,15 +592,12 @@ struct BinFileReaderState void decodeHistoryData(const BinDefinition &def, const std::vector /*values*/) { //int i = 0; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { if (!global_format_identifiers.contains(field.id)) { unknown_format_identifiers.insert(field.id); } else { //int value = values[i++]; - switch (field.id) { - default: - unexpected_format_identifiers_for_record_types[def.format_identifier].insert(field.id); - } + unexpected_format_identifiers_for_record_types[def.format_identifier].insert(field.id); } } } @@ -670,7 +667,7 @@ struct BinFileReaderState const BinDefinition &def = local_format_identifiers[format_identifier]; //printf("- fields type : %d\n", def.format_identifier); std::vector values; - foreach(const BinField &field, def.fields) { + for(const BinField &field : def.fields) { //printf("- field : %d \n", field.id); int v; switch (field.size) { diff --git a/src/FileIO/FitRideFile.cpp b/src/FileIO/FitRideFile.cpp index 30a6c79d6..37af2eebb 100644 --- a/src/FileIO/FitRideFile.cpp +++ b/src/FileIO/FitRideFile.cpp @@ -223,7 +223,7 @@ static void loadMetadata() if (!root.contains("PRODUCTS")) goto badconfig; QJsonArray PRODUCTS = root["PRODUCTS"].toArray(); - foreach(const QJsonValue val, PRODUCTS) { + for(const QJsonValue &val : PRODUCTS) { // convert so we can inspect QJsonObject obj = val.toObject(); @@ -240,7 +240,7 @@ static void loadMetadata() if (!root.contains("MANUFACTURERS")) goto badconfig; QJsonArray MANUFACTURERS = root["MANUFACTURERS"].toArray(); - foreach(const QJsonValue val, MANUFACTURERS) { + for(const QJsonValue &val : MANUFACTURERS) { // convert so we can inspect QJsonObject obj = val.toObject(); @@ -256,7 +256,7 @@ static void loadMetadata() if (!root.contains("FIELDS")) goto badconfig; QJsonArray FIELDS = root["FIELDS"].toArray(); - foreach(const QJsonValue val, FIELDS) { + for(const QJsonValue &val : FIELDS) { // Message:FieldNum lists // @@ -310,7 +310,7 @@ static void loadMetadata() if (!root.contains("MESSAGES")) goto badconfig; QJsonArray MESSAGES = root["MESSAGES"].toArray(); - foreach(const QJsonValue val, MESSAGES) { + for(const QJsonValue &val : MESSAGES) { // convert so we can inspect QJsonObject obj = val.toObject(); @@ -1914,7 +1914,7 @@ struct FitFileParser // before being added to the XDATA XDataPoint *add= new XDataPoint(); - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { QString name; double value=0; @@ -2021,7 +2021,7 @@ genericnext: const std::vector& values) { int i = 0; int manu = -1, prod = -1; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -2052,7 +2052,7 @@ genericnext: const std::vector& values) { int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; @@ -2123,7 +2123,7 @@ genericnext: QString prevSport = rideFile->getTag("Sport", ""); double pool_length = 0.0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -2286,7 +2286,7 @@ genericnext: QString deviceInfo; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { FitValue value = values[i++]; //qDebug() << field.num << field.type << value.v; @@ -2361,7 +2361,7 @@ genericnext: const int delta = qbase_time.toSecsSinceEpoch(); int event = -1, event_type = -1, local_timestamp = -1, timestamp = -1; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if (value == NA_VALUE) @@ -2438,7 +2438,7 @@ genericnext: qint16 data16 = -1; qint32 data32 = -1; int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -2606,7 +2606,7 @@ genericnext: if (n>0) hrv_time = hrvXdata->datapoints[n-1]->secs; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { FitValue value = values[i++]; if ( value.type == ListValue && field.num == 0){ for (int j=0; j valueList = values[i++].list; @@ -3354,7 +3354,7 @@ genericnext: double length_duration = 0.0; int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -3443,7 +3443,7 @@ genericnext: double windHeading = 0.0, windSpeed = 0.0, temp = 0.0, humidity = 0.0; int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -3506,7 +3506,7 @@ genericnext: int a = 0; int j = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { FitValue value = values[a++]; if( value.type == SingleValue && value.v == NA_VALUE ) @@ -3610,7 +3610,7 @@ genericnext: const std::vector& values) { Q_UNUSED(time_offset); int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -3646,7 +3646,7 @@ genericnext: QString segment_name; bool fail = false; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { const FitValue& value = values[i++]; if( value.type != StringValue && value.v == NA_VALUE ) @@ -3791,7 +3791,7 @@ genericnext: const std::vector& values) { Q_UNUSED(time_offset); int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { fit_value_t value = values[i++].v; if( value == NA_VALUE ) @@ -3821,7 +3821,7 @@ genericnext: // 4 application_version uint32 int i = 0; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { FitValue value = values[i++]; if (FIT_DEBUG && FIT_DEBUG_LEVEL>2) @@ -3917,7 +3917,7 @@ genericnext: fieldDef.native = -1; int native_mesg_num = RECORD_MSG_NUM; // just in case it is missing, for backward compatibility - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { FitValue value = values[i++]; switch (field.num) { @@ -4260,7 +4260,7 @@ genericnext: // now we just work through the definition and extract the field values // from the file directly std::vector values; - foreach(const FitField &field, def.fields) { + for(const FitField &field : def.fields) { // we store the value into a struct that has members // for all the fit base types- so floats are in 'f' and diff --git a/src/FileIO/FitlogRideFile.cpp b/src/FileIO/FitlogRideFile.cpp index 0718d9caa..9602a85f2 100644 --- a/src/FileIO/FitlogRideFile.cpp +++ b/src/FileIO/FitlogRideFile.cpp @@ -239,9 +239,6 @@ FitlogFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &f if (!file.open(QIODevice::WriteOnly)) return(false); file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif out.setGenerateByteOrderMark(true); out << xml; out.flush(); diff --git a/src/FileIO/FixDeriveDistance.cpp b/src/FileIO/FixDeriveDistance.cpp index e1ed3a3e3..60417a31f 100644 --- a/src/FileIO/FixDeriveDistance.cpp +++ b/src/FileIO/FixDeriveDistance.cpp @@ -242,7 +242,7 @@ FixDeriveDistance::postProcess(RideFile *ride, DataProcessorConfig *config=0, QS QString log = ride->getTag("Change History", ""); log += tr("Derive Distance from GPS on "); log += QDateTime::currentDateTime().toString(); - if (ride->command->changeLog().count()>0) + if (ride->command->changeLog().length()>0) log += ":\n" + ride->command->changeLog(); ride->setTag("Change History", log); } diff --git a/src/FileIO/FixDeriveHeadwind.cpp b/src/FileIO/FixDeriveHeadwind.cpp index 4e39d58de..00a981185 100644 --- a/src/FileIO/FixDeriveHeadwind.cpp +++ b/src/FileIO/FixDeriveHeadwind.cpp @@ -167,7 +167,7 @@ FixDeriveHeadwind::postProcess(RideFile *ride, DataProcessorConfig *config=0, QS QString log = ride->getTag("Change History", ""); log += tr("Derive Headwind from weather on "); log += QDateTime::currentDateTime().toString(); - if (ride->command->changeLog().count()>0) + if (ride->command->changeLog().length()>0) log += ":\n" + ride->command->changeLog(); ride->setTag("Change History", log); diff --git a/src/FileIO/GcRideFile.cpp b/src/FileIO/GcRideFile.cpp index 117394415..944fb50b6 100644 --- a/src/FileIO/GcRideFile.cpp +++ b/src/FileIO/GcRideFile.cpp @@ -275,9 +275,6 @@ GcFileReader::writeRideFile(Context *,const RideFile *ride, QFile &file) const return false; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif out.setGenerateByteOrderMark(true); out << xml; out.flush(); diff --git a/src/FileIO/GpxRideFile.cpp b/src/FileIO/GpxRideFile.cpp index bcabb5df0..849794a41 100644 --- a/src/FileIO/GpxRideFile.cpp +++ b/src/FileIO/GpxRideFile.cpp @@ -178,9 +178,6 @@ GpxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file if (!file.open(QIODevice::WriteOnly)) return(false); file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif //out.setGenerateByteOrderMark(true); out << xml; out.flush(); diff --git a/src/FileIO/JouleDevice.cpp b/src/FileIO/JouleDevice.cpp index e12e64988..210f27ebe 100644 --- a/src/FileIO/JouleDevice.cpp +++ b/src/FileIO/JouleDevice.cpp @@ -553,12 +553,12 @@ bool JoulePacket::write(CommPortPtr dev, QString &err) { QByteArray bytes = dataArrayForUnit(); - const char *msg = cEscape(bytes.data(), bytes.count()).toLatin1().constData(); + const char *msg = cEscape(bytes.data(), bytes.length()).toLatin1().constData(); if (JOULE_DEBUG) printf("writing '%s' to device\n", msg); - int n = dev->write(bytes.data(), bytes.count() , err); // - if (n != bytes.count()) { + int n = dev->write(bytes.data(), bytes.length() , err); // + if (n != bytes.length()) { if (n < 0) { if (JOULE_DEBUG) printf("failed to write %s to device: %s\n", msg, err.toLatin1().constData()); err = QString(tr("failed to write to device: %1")).arg(err); diff --git a/src/FileIO/JsonRideFile.y b/src/FileIO/JsonRideFile.y index dfa948d93..4ec3198a7 100644 --- a/src/FileIO/JsonRideFile.y +++ b/src/FileIO/JsonRideFile.y @@ -403,10 +403,8 @@ JsonFileReader::openRideFile(QFile &file, QStringList &errors, QList* // read in the whole thing QTextStream in(&file); + // GC .JSON is stored in UTF-8 with BOM(Byte order mark) for identification -#if QT_VERSION < 0x060000 - in.setCodec ("UTF-8"); -#endif contents = in.readAll(); file.close(); @@ -415,11 +413,7 @@ JsonFileReader::openRideFile(QFile &file, QStringList &errors, QList* if (contents.contains(QChar::ReplacementCharacter)) { if (file.exists() && file.open(QFile::ReadOnly | QFile::Text)) { QTextStream in(&file); -#if QT_VERSION < 0x060000 - in.setCodec ("ISO 8859-1"); -#else in.setEncoding (QStringConverter::Latin1); -#endif contents = in.readAll(); file.close(); } @@ -799,10 +793,8 @@ JsonFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &fil // setup streamer QTextStream out(&file); + // unified codepage and BOM for identification on all platforms -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif out.setGenerateByteOrderMark(true); out << xml; diff --git a/src/FileIO/MacroDevice.cpp b/src/FileIO/MacroDevice.cpp index b7b4d2b8e..a6b66aa67 100644 --- a/src/FileIO/MacroDevice.cpp +++ b/src/FileIO/MacroDevice.cpp @@ -352,12 +352,12 @@ MacroPacket::data() bool MacroPacket::write(CommPortPtr dev, QString &err) { - const char *msg = cEscape(data(), payload.count()+2).toLatin1().constData(); + const char *msg = cEscape(data(), payload.size()+2).toLatin1().constData(); if (MACRO_DEBUG) printf("writing '%s' to device\n", msg); - int n = dev->write(data(), payload.count()+2, err); - if (n != payload.count()+2) { + int n = dev->write(data(), payload.size()+2, err); + if (n != payload.size()+2) { if (n < 0) { if (MACRO_DEBUG) printf("failed to write %s to device: %s\n", msg, err.toLatin1().constData()); err = QString(tr("failed to write to device: %1")).arg(err); diff --git a/src/FileIO/PolarRideFile.cpp b/src/FileIO/PolarRideFile.cpp index 9d068c7cb..236173eca 100644 --- a/src/FileIO/PolarRideFile.cpp +++ b/src/FileIO/PolarRideFile.cpp @@ -45,9 +45,6 @@ bool ScanPddFile(QFile &file, QString &hrmFile, QString &hrvFile, QString &gpxFi // from a QString QString contents; QTextStream in(&file); -#if QT_VERSION < 0x060000 - in.setCodec("UTF-8"); -#endif contents = in.readAll(); file.close(); // check if the text string contains the replacement character for UTF-8 encoding @@ -61,11 +58,7 @@ bool ScanPddFile(QFile &file, QString &hrmFile, QString &hrvFile, QString &gpxFi file.open(QFile::ReadOnly); QTextStream is(&file); if (useISO8859) -#if QT_VERSION < 0x060000 - is.setCodec ("ISO 8859-1"); -#else is.setEncoding (QStringConverter::Latin1); -#endif while (!is.atEnd()) { // the readLine() method doesn't handle old Macintosh CR line @@ -195,9 +188,6 @@ void HrmRideFile(RideFile *rideFile, RideFile*gpxresult, bool haveGPX, XDataSeri // from a QString QString contents; QTextStream in(&file); -#if QT_VERSION < 0x060000 - in.setCodec("UTF-8"); -#endif contents = in.readAll(); file.close(); // check if the text string contains the replacement character for UTF-8 encoding @@ -212,11 +202,8 @@ void HrmRideFile(RideFile *rideFile, RideFile*gpxresult, bool haveGPX, XDataSeri file.open(QFile::ReadOnly); QTextStream is(&file); if (useISO8859) -#if QT_VERSION < 0x060000 - is.setCodec ("ISO 8859-1"); -#else is.setEncoding (QStringConverter::Latin1); -#endif + QString section = NULL; if (haveGPX) diff --git a/src/FileIO/PwxRideFile.cpp b/src/FileIO/PwxRideFile.cpp index 0aa24330d..e4b7e2a2b 100644 --- a/src/FileIO/PwxRideFile.cpp +++ b/src/FileIO/PwxRideFile.cpp @@ -985,9 +985,6 @@ PwxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file if (!file.open(QIODevice::WriteOnly)) return(false); file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif out.setGenerateByteOrderMark(true); out << xml; out.flush(); diff --git a/src/FileIO/RideAutoImportConfig.cpp b/src/FileIO/RideAutoImportConfig.cpp index 5cbef2bbc..a6b26fa60 100644 --- a/src/FileIO/RideAutoImportConfig.cpp +++ b/src/FileIO/RideAutoImportConfig.cpp @@ -161,9 +161,6 @@ RideAutoImportConfigParser::serialize(QString filename, QList\n"; diff --git a/src/FileIO/RideFile.cpp b/src/FileIO/RideFile.cpp index 156df509c..178e2b4ef 100644 --- a/src/FileIO/RideFile.cpp +++ b/src/FileIO/RideFile.cpp @@ -159,11 +159,7 @@ RideFile::computeFileCRC(QString filename) rawstream->readRawData(&data[0], file.size()); file.close(); -#if QT_VERSION < 0x060000 - return qChecksum(&data[0], file.size()); -#else return qChecksum(QByteArrayView(&data[0], file.size())); -#endif } void @@ -3695,7 +3691,7 @@ QList CIQinfo::listFromJson(const QString& src) if (doc.isArray()) { QJsonArray ciqArray = doc.array(); - foreach (const QJsonValue& ciqValue, ciqArray) + for (const QJsonValue& ciqValue : ciqArray) { QJsonObject ciqObj = ciqValue.toObject(); ciqList.append(CIQinfo(ciqObj)); @@ -3716,7 +3712,7 @@ CIQinfo::CIQinfo(const QJsonObject& obj) devid = obj[QString(CIQ_ID)].toInt(); QJsonArray jsonfields = obj[QString(FIELDS_KEY)].toArray(); - foreach (const QJsonValue& field, jsonfields) + for (const QJsonValue& field : jsonfields) { QJsonObject fieldObj = field.toObject(); CIQfield ciqfield(fieldObj[CIQ_FIELD_MESSAGE].toString(), diff --git a/src/FileIO/Snippets.cpp b/src/FileIO/Snippets.cpp index 6b26b641a..72d04ef55 100644 --- a/src/FileIO/Snippets.cpp +++ b/src/FileIO/Snippets.cpp @@ -131,10 +131,8 @@ Snippets::postProcess(RideFile *ride, DataProcessorConfig *config=0, QString op= // setup streamer QTextStream out(&outfile); + // unified codepage and BOM for identification on all platforms -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif //out.setGenerateByteOrderMark(true); << make it easier to parse with no BOM out << "{\n\t\"" << op << "\": {\n"; diff --git a/src/FileIO/TcxRideFile.cpp b/src/FileIO/TcxRideFile.cpp index 711b84cdd..9c2d7d2e7 100644 --- a/src/FileIO/TcxRideFile.cpp +++ b/src/FileIO/TcxRideFile.cpp @@ -480,9 +480,6 @@ TcxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file if (!file.open(QIODevice::WriteOnly)) return(false); file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif out.setGenerateByteOrderMark(true); out << xml; out.flush(); diff --git a/src/Gui/AbstractView.cpp b/src/Gui/AbstractView.cpp index ed53239c7..c1a2e1e06 100644 --- a/src/Gui/AbstractView.cpp +++ b/src/Gui/AbstractView.cpp @@ -307,9 +307,6 @@ AbstractView::saveState() }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // is just a collection of layout (aka old HomeWindow name-layout.xml) out<<"\n"; diff --git a/src/Gui/Agenda.cpp b/src/Gui/Agenda.cpp index 3d74a6afe..a6c959144 100644 --- a/src/Gui/Agenda.cpp +++ b/src/Gui/Agenda.cpp @@ -18,9 +18,6 @@ #include "Agenda.h" -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#endif #include #include #include @@ -188,15 +185,6 @@ AgendaTree::leaveEvent } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -void -AgendaTree::enterEvent -(QEvent *event) -{ - if (! contextMenuIndex.isValid()) { - mapFromGlobal(QCursor::pos()); - } -#else void AgendaTree::enterEvent (QEnterEvent *event) @@ -204,7 +192,6 @@ AgendaTree::enterEvent if (! contextMenuIndex.isValid()) { updateHoveredIndex(event->position().toPoint()); } -#endif QTreeWidget::enterEvent(event); } diff --git a/src/Gui/Agenda.h b/src/Gui/Agenda.h index b9f23454d..04225e493 100644 --- a/src/Gui/Agenda.h +++ b/src/Gui/Agenda.h @@ -49,11 +49,7 @@ protected: void mouseMoveEvent(QMouseEvent *event) override; void wheelEvent(QWheelEvent *event) override; void leaveEvent(QEvent *event) override; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - void enterEvent(QEvent *event) override; -#else void enterEvent(QEnterEvent *event) override; -#endif void contextMenuEvent(QContextMenuEvent *event) override; void changeEvent(QEvent *event) override; bool viewportEvent(QEvent *event) override; diff --git a/src/Gui/AthletePages.cpp b/src/Gui/AthletePages.cpp index 9a8c2c54d..f1a575764 100644 --- a/src/Gui/AthletePages.cpp +++ b/src/Gui/AthletePages.cpp @@ -1219,7 +1219,7 @@ CPPage::CPPage(Context *context, Zones *zones_, SchemePage *schemePage) : pmaxDelegate.setShowSuffixOnEdit(true); pmaxDelegate.setShowSuffixOnDisplay(true); - ranges = new TreeWidget6(); + ranges = new QTreeWidget(); ranges->headerItem()->setText(CPPAGE_RANGES_COL_RNUM, "_rnum"); ranges->headerItem()->setText(CPPAGE_RANGES_COL_STARTDATE, tr("Start Date")); ranges->headerItem()->setText(CPPAGE_RANGES_COL_CP, tr("Critical Power")); @@ -1314,13 +1314,8 @@ void CPPage::initializeRanges (int selectIndex) { -#if QT_VERSION < 0x060000 - disconnect(ranges->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector&)), - this, SLOT(rangeChanged(const QModelIndex&, const QModelIndex&, const QVector&))); -#else disconnect(ranges->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QList&)), this, SLOT(rangeChanged(const QModelIndex&, const QModelIndex&, const QList&))); -#endif ranges->blockSignals(true); ranges->clear(); @@ -1391,13 +1386,8 @@ CPPage::initializeRanges newZoneRequired->setVisible(needsNewRange()); -#if QT_VERSION < 0x060000 - connect(ranges->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector&)), - this, SLOT(rangeChanged(const QModelIndex&, const QModelIndex&, const QVector&))); -#else connect(ranges->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QList&)), this, SLOT(rangeChanged(const QModelIndex&, const QModelIndex&, const QList&))); -#endif } @@ -1415,11 +1405,7 @@ CPPage::reInitializeRanges void CPPage::rangeChanged -#if QT_VERSION < 0x060000 -(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) -#else (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList &roles) -#endif { Q_UNUSED(bottomRight) @@ -3206,13 +3192,8 @@ CVPage::CVPage(PaceZones* paceZones, PaceSchemePage *schemePage) : connect(defaultButton, SIGNAL(clicked()), this, SLOT(defaultClicked())); connect(ranges, SIGNAL(itemSelectionChanged()), this, SLOT(rangeSelectionChanged())); -#if QT_VERSION < 0x060000 - connect(ranges->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector&)), - this, SLOT(rangeChanged(const QModelIndex&, const QModelIndex&, const QVector&))); -#else connect(ranges->model(), SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QList&)), this, SLOT(rangeChanged(const QModelIndex&, const QModelIndex&, const QList&))); -#endif connect(zones, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(zonesChanged())); if (ranges->invisibleRootItem()->childCount() > 0) { @@ -3370,11 +3351,7 @@ CVPage::defaultClicked() void CVPage::rangeChanged -#if QT_VERSION < 0x060000 -(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) -#else (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList &roles) -#endif { Q_UNUSED(bottomRight) diff --git a/src/Gui/AthletePages.h b/src/Gui/AthletePages.h index f30e55539..d431d6a69 100644 --- a/src/Gui/AthletePages.h +++ b/src/Gui/AthletePages.h @@ -52,7 +52,6 @@ #include "RemoteControl.h" #include "Measures.h" #include "StyledItemDelegates.h" -#include "Qt5Compatibility.h" class MeasuresPage : public QWidget { @@ -275,11 +274,7 @@ class CPPage : public QWidget void reInitializeRanges(); private slots: -#if QT_VERSION < 0x060000 - void rangeChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()); -#else void rangeChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList &roles = QList()); -#endif void review(); @@ -299,7 +294,7 @@ class CPPage : public QWidget Context *context; Zones *zones_; SchemePage *schemePage; - TreeWidget6 *ranges; + QTreeWidget *ranges; QTreeWidget *zones; QPushButton *reviewButton; QPushButton *defaultButton; @@ -483,11 +478,7 @@ class CVPage : public QWidget void addClicked(); void deleteClicked(); void defaultClicked(); -#if QT_VERSION < 0x060000 - void rangeChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()); -#else void rangeChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList &roles = QList()); -#endif void rangeSelectionChanged(); void addZoneClicked(); void deleteZoneClicked(); diff --git a/src/Gui/Calendar.cpp b/src/Gui/Calendar.cpp index 28033f33b..d0eb2bce4 100644 --- a/src/Gui/Calendar.cpp +++ b/src/Gui/Calendar.cpp @@ -32,9 +32,6 @@ #include #include #include -#if QT_VERSION < 0x060000 -#include -#endif #include "Colors.h" #include "Settings.h" @@ -97,11 +94,7 @@ CalendarOverview::fillEntries void CalendarOverview::paintCell -#if QT_VERSION < 0x060000 -(QPainter *painter, const QRect &rect, const QDate &date) const -#else (QPainter *painter, const QRect &rect, QDate date) const -#endif { QCalendarWidget::paintCell(painter, rect, date); @@ -591,11 +584,7 @@ void CalendarDayTable::dragMoveEvent (QDragMoveEvent *event) { -#if QT_VERSION < 0x060000 - QPoint pos = event->pos(); -#else QPoint pos = event->position().toPoint(); -#endif QModelIndex hoverIndex = indexAt(pos); if ( hoverIndex.isValid() && hoverIndex.column() > 0 @@ -667,11 +656,7 @@ CalendarDayTable::dropEvent if (srcIndex.isValid() && entryIdx >= 0) { CalendarDay srcDay = srcIndex.data(CalendarDetailedDayDelegate::DayRole).value(); if (entryIdx < srcDay.entries.count()) { -#if QT_VERSION < 0x060000 - QPoint pos = event->pos(); -#else QPoint pos = event->position().toPoint(); -#endif QModelIndex destIndex = indexAt(pos); QTime time = timeScaleData.timeFromYInTable(pos.y(), visualRect(destIndex)); CalendarDay destDay = destIndex.data(CalendarDetailedDayDelegate::DayRole).value(); @@ -1258,11 +1243,7 @@ void CalendarMonthTable::dragMoveEvent (QDragMoveEvent *event) { -#if QT_VERSION < 0x060000 - QModelIndex hoverIndex = indexAt(event->pos()); -#else QModelIndex hoverIndex = indexAt(event->position().toPoint()); -#endif if ( hoverIndex.isValid() && hoverIndex.column() < 7 && hoverIndex != pressedIndex) { @@ -1317,11 +1298,7 @@ CalendarMonthTable::dropEvent if (srcIndex.isValid() && entryIdx >= 0) { CalendarDay srcDay = srcIndex.data(CalendarCompactDayDelegate::DayRole).value(); if (entryIdx < srcDay.entries.count()) { -#if QT_VERSION < 0x060000 - QModelIndex destIndex = indexAt(event->pos()); -#else QModelIndex destIndex = indexAt(event->position().toPoint()); -#endif CalendarDay destDay = destIndex.data(CalendarCompactDayDelegate::DayRole).value(); emit entryMoved(srcDay.entries[entryIdx], srcDay.date, destDay.date, srcDay.entries[entryIdx].start); } @@ -1331,16 +1308,6 @@ CalendarMonthTable::dropEvent } -#if QT_VERSION < 0x060000 -QAbstractItemDelegate* -CalendarMonthTable::itemDelegateForIndex -(const QModelIndex &index) const -{ - return itemDelegateForColumn(index.column()); -} -#endif - - void CalendarMonthTable::showContextMenu (const QPoint &pos) diff --git a/src/Gui/Calendar.h b/src/Gui/Calendar.h index 3fbc918d7..2cce87740 100644 --- a/src/Gui/Calendar.h +++ b/src/Gui/Calendar.h @@ -50,11 +50,7 @@ public: void fillEntries(const QHash> &activityEntries, const QHash> &headlineEntries); protected: -#if QT_VERSION < 0x060000 - void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const override; -#else void paintCell(QPainter *painter, const QRect &rect, QDate date) const override; -#endif private: QHash> activityEntries; @@ -117,9 +113,6 @@ protected: void dragMoveEvent(QDragMoveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override; void dropEvent(QDropEvent *event) override; -#if QT_VERSION < 0x060000 - QAbstractItemDelegate *itemDelegateForIndex(const QModelIndex &index) const; -#endif private slots: void showContextMenu(const QPoint &pos); @@ -206,9 +199,6 @@ protected: void dragMoveEvent(QDragMoveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override; void dropEvent(QDropEvent *event) override; -#if QT_VERSION < 0x060000 - QAbstractItemDelegate *itemDelegateForIndex(const QModelIndex &index) const; -#endif private slots: void showContextMenu(const QPoint &pos); diff --git a/src/Gui/CalendarItemDelegates.cpp b/src/Gui/CalendarItemDelegates.cpp index 37d163563..e41a6108c 100644 --- a/src/Gui/CalendarItemDelegates.cpp +++ b/src/Gui/CalendarItemDelegates.cpp @@ -59,14 +59,7 @@ void HitTester::resize (const QModelIndex &index, qsizetype size) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - rects[index].clear(); - for (int i = 0; i < size; ++i) { - rects[index] << QRect(); - } -#else rects[index].resize(size); -#endif } @@ -1283,11 +1276,7 @@ AgendaEntryDelegate::paint secondaryMetricWeight = attributes.secondaryMetricHoverWeight; } if (primaryWeight == 0) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - primaryWeight = static_cast(line1Font.weight()); -#else primaryWeight = line1Font.weight(); -#endif } if (secondaryWeight == 0) { secondaryWeight = primaryWeight; diff --git a/src/Gui/ChartSpace.cpp b/src/Gui/ChartSpace.cpp index 634b30121..979a77191 100644 --- a/src/Gui/ChartSpace.cpp +++ b/src/Gui/ChartSpace.cpp @@ -25,10 +25,6 @@ #include #include -#if QT_VERSION < 0x060000 -#include -#endif - #include #include #include @@ -58,25 +54,6 @@ ChartSpace::ChartSpace(Context *context, OverviewScope scope, GcWindow *window) scene = new QGraphicsScene(this); view = new GGraphicsView(context, this); - // hardware acceleration is important for this widget -#if QT_VERSION < 0x060000 -#if defined(Q_OS_LINUX) - // if we have OpenGL and its 2.0 or higher, lets use it. - // this is pretty much any GPU since 2004 and keeps Qt happy. - // we only do this on Linux - //if (gl_major >= 2.0) view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers | QGL::DirectRendering))); - if (gl_major >= 2.0) view->setViewport(new QGLWidget()); -#endif -#if defined(Q_OS_WIN) - // on windows we always use OpenGL since we have forced - // ANGLE in main.cpp to implement opengl on top of directx - view->setViewport(new QGLWidget()); -#endif -#if defined (Q_OS_MACOS) - // we have no options right now, it sucks -#endif -#endif - view->viewport()->setAttribute(Qt::WA_AcceptTouchEvents, false); // stops it stealing focus on mouseover scrollbar = new QScrollBar(Qt::Vertical, this); diff --git a/src/Gui/Colors.cpp b/src/Gui/Colors.cpp index 1a41d8e86..09d21b2a2 100644 --- a/src/Gui/Colors.cpp +++ b/src/Gui/Colors.cpp @@ -87,11 +87,7 @@ unsigned long Colors::fingerprint(const Colors *set) ba.append(set->color.name().toUtf8()); set++; } -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } #ifdef Q_OS_WIN diff --git a/src/Gui/DragBar.cpp b/src/Gui/DragBar.cpp index 061edca7f..ba4df412b 100644 --- a/src/Gui/DragBar.cpp +++ b/src/Gui/DragBar.cpp @@ -27,8 +27,8 @@ DragBar::DragBar(QWidget*parent) : QTabBar(parent) void DragBar::dragEnterEvent(QDragEnterEvent*event) { - if (tabAt(event->pos()) != -1 && tabAt(event->pos()) != currentIndex()) { - setCurrentIndex(tabAt(event->pos())); + if (tabAt(event->position().toPoint()) != -1 && tabAt(event->position().toPoint()) != currentIndex()) { + setCurrentIndex(tabAt(event->position().toPoint())); } } @@ -38,8 +38,8 @@ DragBar::dragLeaveEvent(QDragLeaveEvent*) {} void DragBar::dragMoveEvent(QDragMoveEvent *event) // we don't get these without accepting dragevent { // and that would be a bad idea - if (tabAt(event->pos()) != -1 && tabAt(event->pos()) != currentIndex()) { - setCurrentIndex(tabAt(event->pos())); + if (tabAt(event->position().toPoint()) != -1 && tabAt(event->position().toPoint()) != currentIndex()) { + setCurrentIndex(tabAt(event->position().toPoint())); } } diff --git a/src/Gui/GcCrashDialog.cpp b/src/Gui/GcCrashDialog.cpp index 3dd2380d1..b4b0ce9a2 100644 --- a/src/Gui/GcCrashDialog.cpp +++ b/src/Gui/GcCrashDialog.cpp @@ -278,9 +278,7 @@ QString GcCrashDialog::versionHTML() .arg(usbxpress) .arg(libusb) .arg(vlc) -#if defined GC_VIDEO_QT5 - .arg("qt5") -#elif defined GC_VIDEO_QT6 +#if defined GC_VIDEO_QT6 .arg("qt6") #elif defined GC_VIDEO_VLC .arg("vlc") @@ -459,9 +457,6 @@ GcCrashDialog::saveAs() QFile file(fileName); file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif if (file.open(QIODevice::WriteOnly)) { // write the texts diff --git a/src/Gui/IconManager.cpp b/src/Gui/IconManager.cpp index be0b33863..48fe32958 100644 --- a/src/Gui/IconManager.cpp +++ b/src/Gui/IconManager.cpp @@ -342,9 +342,6 @@ IconManager::downloadUrl { QNetworkAccessManager manager; QNetworkRequest request(url); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); -#endif QNetworkReply *reply = manager.get(request); QTimer timeoutTimer; diff --git a/src/Gui/IntervalTreeView.cpp b/src/Gui/IntervalTreeView.cpp index f5270e925..d0ab2a1c4 100644 --- a/src/Gui/IntervalTreeView.cpp +++ b/src/Gui/IntervalTreeView.cpp @@ -73,7 +73,7 @@ IntervalTreeView::dragEnterEvent(QDragEnterEvent* event) void IntervalTreeView::dropEvent(QDropEvent* event) { - QTreeWidgetItem* target = (QTreeWidgetItem *)itemAt(event->pos()); + QTreeWidgetItem* target = (QTreeWidgetItem *)itemAt(event->position().toPoint()); QTreeWidgetItem* parent = target->parent(); QList intervals = context->rideItem()->intervals(); @@ -118,11 +118,7 @@ IntervalTreeView::mimeTypes() const QMimeData * IntervalTreeView::mimeData -#if QT_VERSION < 0x060000 -(const QList items) const -#else (const QList &items) const -#endif { QMimeData *returning = new QMimeData; diff --git a/src/Gui/IntervalTreeView.h b/src/Gui/IntervalTreeView.h index 34eae5737..3127224cd 100644 --- a/src/Gui/IntervalTreeView.h +++ b/src/Gui/IntervalTreeView.h @@ -38,11 +38,7 @@ class IntervalTreeView : public QTreeWidget // for drag/drop QStringList mimeTypes () const override; -#if QT_VERSION < 0x060000 - QMimeData *mimeData(const QList items) const override; -#else QMimeData *mimeData(const QList &items) const override; -#endif // access protected members .. why do the Trolls do this to us? QTreeWidgetItem *itemFromIndexPublic(QModelIndex index) { return itemFromIndex(index); } diff --git a/src/Gui/LTMSidebar.cpp b/src/Gui/LTMSidebar.cpp index 8615e172c..7e1f79d09 100644 --- a/src/Gui/LTMSidebar.cpp +++ b/src/Gui/LTMSidebar.cpp @@ -815,8 +815,6 @@ LTMSidebar::setAutoFilterMenu() GcSplitterItem *item = filterSplitter->removeItem(action->text()); if (item) delete item; // will be removed from splitter too - // if you crash on this line compile with QT5.3 or higher - // or at least avoid the 5.3 RC1 release (see QTBUG-38685) autoFilterMenu->addAction(action); autoFilterState << false; } diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 258deff17..c18461281 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -465,7 +465,6 @@ MainWindow::MainWindow(const QDir &home) tablayout->addWidget(viewStack); setCentralWidget(central); -#if QT_VERSION >= 0x060000 /*---------------------------------------------------------------------- * Hack to avoid a flickering MainWindow when showing a QWebEngineView in a chart, e.g. a Map: * Temporarily add a dummy QWebEngineView with some random content before the MainWindow is shown @@ -476,7 +475,6 @@ MainWindow::MainWindow(const QDir &home) mainLayout->addWidget(dummywev); mainLayout->removeWidget(dummywev); delete dummywev; -#endif /*---------------------------------------------------------------------- * Application Menus @@ -527,25 +525,25 @@ MainWindow::MainWindow(const QDir &home) // ACTIVITY MENU QMenu *rideMenu = menuBar()->addMenu(tr("A&ctivity")); - rideMenu->addAction(tr("&Download from device..."), this, SLOT(downloadRide()), QKeySequence("Ctrl+D")); - rideMenu->addAction(tr("&Import from file..."), this, SLOT (importFile()), QKeySequence("Ctrl+I")); - rideMenu->addAction(tr("&Manual entry..."), this, SLOT(manualRide()), QKeySequence("Ctrl+M")); + rideMenu->addAction(tr("&Download from device..."), QKeySequence("Ctrl+D"), this, SLOT(downloadRide())); + rideMenu->addAction(tr("&Import from file..."), QKeySequence("Ctrl+I"), this, SLOT (importFile())); + rideMenu->addAction(tr("&Manual entry..."), QKeySequence("Ctrl+M"), this, SLOT(manualRide())); QAction *actionPlan = new QAction(tr("&Plan activity...")); connect(context, &Context::start, this, [this, actionPlan]() { actionPlan->setEnabled(false); }); // The dialog can change the contexts workout connect(context, &Context::stop, this, [this, actionPlan]() { actionPlan->setEnabled(true); }); // temporarily which might cause unwanted effects connect(actionPlan, &QAction::triggered, this, [this]() { planActivity(); }); rideMenu->addAction(actionPlan); rideMenu->addSeparator (); - rideMenu->addAction(tr("&Export..."), this, SLOT(exportRide()), QKeySequence("Ctrl+E")); - rideMenu->addAction(tr("&Batch Processing..."), this, SLOT(batchProcessing()), QKeySequence("Ctrl+B")); + rideMenu->addAction(tr("&Export..."), QKeySequence("Ctrl+E"), this, SLOT(exportRide())); + rideMenu->addAction(tr("&Batch Processing..."), QKeySequence("Ctrl+B"), this, SLOT(batchProcessing())); rideMenu->addSeparator (); - rideMenu->addAction(tr("&Save activity"), this, SLOT(saveRide()), QKeySequence("Ctrl+S")); + rideMenu->addAction(tr("&Save activity"), QKeySequence("Ctrl+S"), this, SLOT(saveRide())); rideMenu->addAction(tr("D&elete activity..."), this, SLOT(deleteRide())); rideMenu->addAction(tr("Split &activity..."), this, SLOT(splitRide())); rideMenu->addAction(tr("Combine activities..."), this, SLOT(mergeRide())); rideMenu->addSeparator (); - rideMenu->addAction(tr("Find intervals..."), this, SLOT(addIntervals()), QKeySequence("")); + rideMenu->addAction(tr("Find intervals..."), QKeySequence(""), this, SLOT(addIntervals())); HelpWhatsThis *helpRideMenu = new HelpWhatsThis(rideMenu); rideMenu->setWhatsThis(helpRideMenu->getWhatsThisText(HelpWhatsThis::MenuBar_Activity)); @@ -635,21 +633,21 @@ MainWindow::MainWindow(const QDir &home) // VIEW MENU QMenu *viewMenu = menuBar()->addMenu(tr("&View")); #ifndef Q_OS_MAC - viewMenu->addAction(tr("Toggle Full Screen"), this, SLOT(toggleFullScreen()), QKeySequence("F11")); + viewMenu->addAction(tr("Toggle Full Screen"), QKeySequence("F11"), this, SLOT(toggleFullScreen())); #endif - showhideViewbar = viewMenu->addAction(tr("Show View Sidebar"), this, SLOT(showViewbar(bool)), QKeySequence("F2")); + showhideViewbar = viewMenu->addAction(tr("Show View Sidebar"), QKeySequence("F2"), this, SLOT(showViewbar(bool))); showhideViewbar->setCheckable(true); showhideViewbar->setChecked(true); - showhideSidebar = viewMenu->addAction(tr("Show Left Sidebar"), this, SLOT(showSidebar(bool)), QKeySequence("F3")); + showhideSidebar = viewMenu->addAction(tr("Show Left Sidebar"), QKeySequence("F3"), this, SLOT(showSidebar(bool))); showhideSidebar->setCheckable(true); showhideSidebar->setChecked(true); - showhideLowbar = viewMenu->addAction(tr("Show Compare Pane"), this, SLOT(showLowbar(bool)), QKeySequence("F4")); + showhideLowbar = viewMenu->addAction(tr("Show Compare Pane"), QKeySequence("F4"), this, SLOT(showLowbar(bool))); showhideLowbar->setCheckable(true); showhideLowbar->setChecked(false); - showhideToolbar = viewMenu->addAction(tr("Show Toolbar"), this, SLOT(showToolbar(bool)), QKeySequence("F5")); + showhideToolbar = viewMenu->addAction(tr("Show Toolbar"), QKeySequence("F5"), this, SLOT(showToolbar(bool))); showhideToolbar->setCheckable(true); showhideToolbar->setChecked(true); - showhideTabbar = viewMenu->addAction(tr("Show Athlete Tabs"), this, SLOT(showTabbar(bool)), QKeySequence("F6")); + showhideTabbar = viewMenu->addAction(tr("Show Athlete Tabs"), QKeySequence("F6"), this, SLOT(showTabbar(bool))); showhideTabbar->setCheckable(true); showhideTabbar->setChecked(true); @@ -2146,7 +2144,7 @@ MainWindow::setOpenTabMenu() // add create new option openTabMenu->addSeparator(); - openTabMenu->addAction(tr("&New Athlete..."), this, SLOT(newCyclistTab()), QKeySequence("Ctrl+N")); + openTabMenu->addAction(tr("&New Athlete..."), QKeySequence("Ctrl+N"), this, SLOT(newCyclistTab())); } void diff --git a/src/Gui/ManualActivityWizard.cpp b/src/Gui/ManualActivityWizard.cpp index fb0f62e42..512f78c52 100644 --- a/src/Gui/ManualActivityWizard.cpp +++ b/src/Gui/ManualActivityWizard.cpp @@ -301,11 +301,8 @@ ManualActivityPageBasics::ManualActivityPageBasics woTypeEdit->setCurrentIndex(1); if (plan) { -#if QT_VERSION >= 0x060000 connect(woTypeEdit, &QComboBox::currentIndexChanged, this, [this, sportEdit](int index) { -#else - connect(woTypeEdit, QOverload::of(&QComboBox::currentIndexChanged), this, [this, sportEdit](int index) { -#endif + sportEdit->setEnabled(index != 0); if (index == 0) { sportEdit->setText("Bike"); @@ -873,15 +870,9 @@ ManualActivityPageMetrics::ManualActivityPageMetrics connect(swimDistanceEdit, &QDoubleSpinBox::editingFinished, this, &ManualActivityPageMetrics::updateEstimates); connect(paceIntervals, &QCheckBox::toggled, this, &ManualActivityPageMetrics::updateVisibility); connect(lapsEditor, &LapsEditorWidget::editingFinished, this, &ManualActivityPageMetrics::updateEstimates); -#if QT_VERSION >= 0x060000 connect(estimateByEdit, &QComboBox::currentIndexChanged, this, &ManualActivityPageMetrics::updateVisibility); connect(estimateByEdit, &QComboBox::currentIndexChanged, this, &ManualActivityPageMetrics::updateEstimates); connect(estimationDaysEdit, &QSpinBox::valueChanged, this, &ManualActivityPageMetrics::updateEstimates); -#else - connect(estimateByEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &ManualActivityPageMetrics::updateVisibility); - connect(estimateByEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &ManualActivityPageMetrics::updateEstimates); - connect(estimationDaysEdit, QOverload::of(&QSpinBox::valueChanged), this, &ManualActivityPageMetrics::updateEstimates); -#endif registerField("averageHr", averageHrEdit); registerField("averagePower", averagePowerEdit); diff --git a/src/Gui/Pages.cpp b/src/Gui/Pages.cpp index 4266c7f38..4acdc3dad 100644 --- a/src/Gui/Pages.cpp +++ b/src/Gui/Pages.cpp @@ -134,7 +134,10 @@ GeneralPage::GeneralPage(Context *context) : context(context) garminHWMarkedit->setSuffix(" " + tr("s")); garminHWMarkedit->setValue(garminHWMark.toInt()); - connect(garminSmartRecord, &QCheckBox::stateChanged, this, [this](int state) { garminHWMarkedit->setEnabled(state); }); + connect(garminSmartRecord, + &QCheckBox::stateChanged, + this, [this](int state) { garminHWMarkedit->setEnabled(state); }); + garminSmartRecord->setCheckState(! (isGarminSmartRecording.toInt() > 0) ? Qt::Checked : Qt::Unchecked); garminSmartRecord->setCheckState(isGarminSmartRecording.toInt() > 0 ? Qt::Checked : Qt::Unchecked); @@ -193,7 +196,9 @@ GeneralPage::GeneralPage(Context *context) : context(context) //XXrBrowseButton->setFixedWidth(120); connect(rBrowseButton, SIGNAL(clicked()), this, SLOT(browseRDir())); - connect(embedR, &QCheckBox::stateChanged, this, [this](int state) { rDirectorySel->setEnabled(state); }); + connect(embedR, + &QCheckBox::stateChanged, + this, [this](int state) { rDirectorySel->setEnabled(state); }); embedR->setChecked(! appsettings->value(NULL, GC_EMBED_R, true).toBool()); embedR->setChecked(appsettings->value(NULL, GC_EMBED_R, true).toBool()); @@ -216,7 +221,9 @@ GeneralPage::GeneralPage(Context *context) : context(context) pythonDirectoryLayout->addWidget(pythonBrowseButton); connect(pythonBrowseButton, SIGNAL(clicked()), this, SLOT(browsePythonDir())); - connect(embedPython, &QCheckBox::stateChanged, this, [this](int state) { pythonDirectorySel->setEnabled(state); }); + connect(embedPython, + &QCheckBox::stateChanged, + this, [this](int state) { pythonDirectorySel->setEnabled(state); }); embedPython->setChecked(! appsettings->value(NULL, GC_EMBED_PYTHON, true).toBool()); embedPython->setChecked(appsettings->value(NULL, GC_EMBED_PYTHON, true).toBool()); @@ -2553,17 +2560,9 @@ IconsPage::eventFilterSportTreeViewport if (event->type() == QEvent::MouseButtonPress) { QMouseEvent *mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::LeftButton) { -#if QT_VERSION >= 0x060000 QTreeWidgetItem *item = sportTree->itemAt(mouseEvent->position().toPoint()); -#else - QTreeWidgetItem *item = sportTree->itemAt(mouseEvent->pos()); -#endif if (item && ! item->data(0, Qt::UserRole + 2).toString().isEmpty()) { -#if QT_VERSION >= 0x060000 sportTreeDragStartPos = mouseEvent->position().toPoint(); -#else - sportTreeDragStartPos = mouseEvent->pos(); -#endif sportTreeDragWatch = true; } else { sportTreeDragWatch = false; @@ -2574,19 +2573,11 @@ IconsPage::eventFilterSportTreeViewport QMouseEvent *mouseEvent = static_cast(event); if ( ! (mouseEvent->buttons() & Qt::LeftButton) || ! sportTreeDragWatch -#if QT_VERSION >= 0x060000 || (mouseEvent->position().toPoint() - sportTreeDragStartPos).manhattanLength() < QApplication::startDragDistance()) { -#else - || (mouseEvent->pos() - sportTreeDragStartPos).manhattanLength() < QApplication::startDragDistance()) { -#endif return true; } sportTreeDragWatch = false; -#if QT_VERSION >= 0x060000 QTreeWidgetItem *item = sportTree->itemAt(mouseEvent->position().toPoint()); -#else - QTreeWidgetItem *item = sportTree->itemAt(mouseEvent->pos()); -#endif if (! item) { return true; } @@ -2699,17 +2690,9 @@ IconsPage::eventFilterIconListViewport } else if (event->type() == QEvent::MouseButtonPress) { QMouseEvent *mouseEvent = static_cast(event); if (mouseEvent->button() == Qt::LeftButton) { -#if QT_VERSION >= 0x060000 QListWidgetItem *item = iconList->itemAt(mouseEvent->position().toPoint()); -#else - QListWidgetItem *item = iconList->itemAt(mouseEvent->pos()); -#endif if (item) { -#if QT_VERSION >= 0x060000 iconListDragStartPos = mouseEvent->position().toPoint(); -#else - iconListDragStartPos = mouseEvent->pos(); -#endif iconListDragWatch = true; } else { iconListDragWatch = false; @@ -2720,19 +2703,11 @@ IconsPage::eventFilterIconListViewport QMouseEvent *mouseEvent = static_cast(event); if ( ! (mouseEvent->buttons() & Qt::LeftButton) || ! iconListDragWatch -#if QT_VERSION >= 0x060000 || (mouseEvent->position().toPoint() - iconListDragStartPos).manhattanLength() < QApplication::startDragDistance()) { -#else - || (mouseEvent->pos() - iconListDragStartPos).manhattanLength() < QApplication::startDragDistance()) { -#endif return true; } iconListDragWatch = false; -#if QT_VERSION >= 0x060000 QListWidgetItem *item = iconList->itemAt(mouseEvent->position().toPoint()); -#else - QListWidgetItem *item = iconList->itemAt(mouseEvent->pos()); -#endif if (! item) { return true; } @@ -2800,9 +2775,6 @@ IconsPage::initSportTree } } } -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - sportTree->viewport()->update(); -#endif } diff --git a/src/Gui/Perspective.cpp b/src/Gui/Perspective.cpp index 238d9e257..8805617e6 100644 --- a/src/Gui/Perspective.cpp +++ b/src/Gui/Perspective.cpp @@ -1594,9 +1594,6 @@ Perspective::toFile(QString filename) // truncate and use 8bit encoding file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // write to output stream toXml(out); diff --git a/src/Gui/PerspectiveDialog.cpp b/src/Gui/PerspectiveDialog.cpp index 9ff5bbe98..6307d80dc 100644 --- a/src/Gui/PerspectiveDialog.cpp +++ b/src/Gui/PerspectiveDialog.cpp @@ -478,11 +478,7 @@ ChartTableWidget::mimeTypes() const QMimeData * ChartTableWidget::mimeData -#if QT_VERSION < 0x060000 -(const QList items) const -#else (const QList &items) const -#endif { QMimeData *returning = new QMimeData; diff --git a/src/Gui/PerspectiveDialog.h b/src/Gui/PerspectiveDialog.h index 3d9c13583..5e81839a4 100644 --- a/src/Gui/PerspectiveDialog.h +++ b/src/Gui/PerspectiveDialog.h @@ -57,11 +57,7 @@ class ChartTableWidget : public QTableWidget ChartTableWidget(QWidget *parent) : QTableWidget(parent) {} virtual QStringList mimeTypes() const override; -#if QT_VERSION < 0x060000 - virtual QMimeData *mimeData (const QList items) const override; -#else virtual QMimeData *mimeData (const QList &items) const override; -#endif }; class PerspectiveDialog : public QDialog diff --git a/src/Gui/Qt5Compatibility.h b/src/Gui/Qt5Compatibility.h deleted file mode 100644 index 62c95b307..000000000 --- a/src/Gui/Qt5Compatibility.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 Joachim Kohlhammer (joachim.kohlhammer@gmx.de) - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef QT5COMPATIBILITY__H -#define QT5COMPATIBILITY__H - -#include - - -// Compatibility helper for Qt5 -// exposes methods that turned public in Qt6 from protected in Qt5 -#if QT_VERSION < 0x060000 -class TreeWidget6 : public QTreeWidget -{ - Q_OBJECT - - public: - TreeWidget6(QWidget *parent = nullptr): QTreeWidget(parent) { - } - - QModelIndex indexFromItem(const QTreeWidgetItem *item, int column = 0) const { - return QTreeWidget::indexFromItem(item, column); - } - - QTreeWidgetItem* itemFromIndex(const QModelIndex &index) const { - return QTreeWidget::itemFromIndex(index); - } -}; -#else -typedef QTreeWidget TreeWidget6; -#endif - - -#endif diff --git a/src/Gui/RideNavigator.cpp b/src/Gui/RideNavigator.cpp index 6b315a21a..3064d166f 100644 --- a/src/Gui/RideNavigator.cpp +++ b/src/Gui/RideNavigator.cpp @@ -631,11 +631,11 @@ RideNavigator::setColumnWidth(int x, bool resized, int logicalIndex, int oldWidt active = true; -#if !defined (Q_OS_MAC) // on QT5 the scrollbars have no width +#if !defined (Q_OS_MAC) if (tableView->verticalScrollBar()->isVisible()) x -= tableView->verticalScrollBar()->width() + 0 ; // !! no longer account for content margins of 3,3,3,3 was + 6 -#else // we're on a mac with QT5 .. so dodgy way of spotting preferences for scrollbars... +#else // we're on a mac.. so dodgy way of spotting preferences for scrollbars... // this is a nasty hack, to see if the 'always on' preference for scrollbars is set we // look at the scrollbar width which is 15 in this case (it is 16 when they 'appear' when // needed. No doubt this will change over time and need to be fixed by referencing the @@ -1116,7 +1116,7 @@ void NavigatorCellDelegate::paint(QPainter *painter, const QStyleOptionViewItem if ((m=rideNavigator->columnMetrics.value(columnName, NULL)) != NULL) { // get double from model, special case QTime to avoid default .000 msecs - if ((QMetaType::Type)index.model()->data(index, Qt::DisplayRole).type() == QMetaType::QTime) + if (index.model()->data(index, Qt::DisplayRole).metaType().id() == QMetaType::QTime) value = index.model()->data(index, Qt::DisplayRole).toTime().toString("hh:mm:ss"); else value = index.model()->data(index, Qt::DisplayRole).toString(); @@ -1244,7 +1244,7 @@ void NavigatorCellDelegate::paint(QPainter *painter, const QStyleOptionViewItem painter->drawText(myOption.rect, Qt::AlignLeft | Qt::TextWordWrap, calendarText); painter->setPen(isColor); -#if defined (Q_OS_MAC) // on QT5 the scrollbars have no width +#if defined (Q_OS_MAC) if (!selected && !rideBG && high.x()+12 > rideNavigator->geometry().width() && !isnormal) { #else if (!selected && !rideBG && high.x()+32 > rideNavigator->geometry().width() && !isnormal) { @@ -1401,7 +1401,7 @@ bool RideNavigatorSortProxyModel::lessThan(const QModelIndex &left, QVariant leftData = sourceModel()->data(left); QVariant rightData = sourceModel()->data(right); - if (leftData.type() == QVariant::DateTime) { + if (leftData.metaType().id() == QMetaType::QDateTime) { return leftData.toDateTime() < rightData.toDateTime(); } QString leftString = leftData.toString(); diff --git a/src/Metrics/HrZones.cpp b/src/Metrics/HrZones.cpp index d9b144946..527745fa0 100644 --- a/src/Metrics/HrZones.cpp +++ b/src/Metrics/HrZones.cpp @@ -113,9 +113,6 @@ bool HrZones::read(QFile &file) return false; } QTextStream fileStream(&file); -#if QT_VERSION < 0x060000 - fileStream.setCodec("UTF-8"); -#endif QRegExp commentrx("\\s*#.*$"); QRegExp blankrx("^[ \t]*$"); @@ -732,9 +729,6 @@ void HrZones::write(QDir home) if (file.open(QFile::WriteOnly)) { QTextStream stream(&file); -#if QT_VERSION < 0x060000 - stream.setCodec("UTF-8"); -#endif stream << strzones; file.close(); } else { @@ -924,11 +918,8 @@ HrZones::getFingerprint() const } } QByteArray ba = QByteArray::number(x); -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else + return qChecksum(ba); -#endif } quint16 @@ -952,9 +943,6 @@ HrZones::getFingerprint(QDate forDate) const } } QByteArray ba = QByteArray::number(x); -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else + return qChecksum(ba); -#endif } diff --git a/src/Metrics/PaceZones.cpp b/src/Metrics/PaceZones.cpp index d95799ec7..80252d0d1 100644 --- a/src/Metrics/PaceZones.cpp +++ b/src/Metrics/PaceZones.cpp @@ -145,9 +145,6 @@ bool PaceZones::read(QFile &file) return false; } QTextStream fileStream(&file); -#if QT_VERSION < 0x060000 - fileStream.setCodec("UTF-8"); -#endif QRegExp commentrx("\\s*#.*$"); QRegExp blankrx("^[ \t]*$"); @@ -851,9 +848,6 @@ void PaceZones::write(QDir home) QFile file(home.canonicalPath() + "/" + fileName_); if (file.open(QFile::WriteOnly)) { QTextStream stream(&file); -#if QT_VERSION < 0x060000 - stream.setCodec("UTF-8"); -#endif stream << strzones; file.close(); } else { @@ -1002,11 +996,7 @@ PaceZones::getFingerprint() const } QByteArray ba = QByteArray::number(x); -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } quint16 @@ -1030,11 +1020,7 @@ PaceZones::getFingerprint(QDate forDate) const } QByteArray ba = QByteArray::number(x); -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } double diff --git a/src/Metrics/RideMetadata.cpp b/src/Metrics/RideMetadata.cpp index 0ce4a5558..d4c4b133c 100644 --- a/src/Metrics/RideMetadata.cpp +++ b/src/Metrics/RideMetadata.cpp @@ -1590,11 +1590,7 @@ FieldDefinition::fingerprint(QList list) ba.append(def.values.join("").toUtf8()); } -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } QCompleter * @@ -1661,11 +1657,7 @@ KeywordDefinition::fingerprint(QList list) ba.append(def.tokens.join("").toUtf8()); } -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } /*---------------------------------------------------------------------- @@ -1687,9 +1679,6 @@ RideMetadata::serialize(QString filename, QListkeywordDefinit }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // begin document out << "\n"; diff --git a/src/Metrics/RideMetric.cpp b/src/Metrics/RideMetric.cpp index ad3945107..c4ffe418c 100644 --- a/src/Metrics/RideMetric.cpp +++ b/src/Metrics/RideMetric.cpp @@ -188,11 +188,7 @@ RideMetric::userMetricFingerprint(QList these) foreach(UserMetricSettings x, these) fingers += x.fingerprint.toLocal8Bit(); -#if QT_VERSION < 0x060000 - return qChecksum(fingers.constData(), fingers.size()); -#else return qChecksum(fingers); -#endif } QHash diff --git a/src/Metrics/UserMetricParser.cpp b/src/Metrics/UserMetricParser.cpp index bc5a5f728..a6b7c3499 100644 --- a/src/Metrics/UserMetricParser.cpp +++ b/src/Metrics/UserMetricParser.cpp @@ -119,10 +119,6 @@ UserMetricParser::serialize(QString filename, QList metrics) void UserMetricParser::serializeToQTextStream(QTextStream& out, QList metrics) { -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif - // begin document out << QString("\n").arg(USER_METRICS_VERSION_NUMBER); diff --git a/src/Metrics/UserMetricSettings.h b/src/Metrics/UserMetricSettings.h index f2dcbfacd..ca79941c9 100644 --- a/src/Metrics/UserMetricSettings.h +++ b/src/Metrics/UserMetricSettings.h @@ -61,11 +61,7 @@ class UserMetricSettings { QString::number(this->conversionSum) + this->program).toUtf8(); -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } QString symbol, diff --git a/src/Metrics/Zones.cpp b/src/Metrics/Zones.cpp index 677cccffe..7ed5d5220 100644 --- a/src/Metrics/Zones.cpp +++ b/src/Metrics/Zones.cpp @@ -105,9 +105,6 @@ bool Zones::read(QFile &file) return false; } QTextStream fileStream(&file); -#if QT_VERSION < 0x060000 - fileStream.setCodec("UTF-8"); -#endif QRegExp commentrx("\\s*#.*$"); QRegExp blankrx("^[ \t]*$"); @@ -909,9 +906,6 @@ void Zones::write(QDir home) if (file.open(QFile::WriteOnly)) { QTextStream stream(&file); -#if QT_VERSION < 0x060000 - stream.setCodec("UTF-8"); -#endif stream << strzones; file.close(); } else { @@ -1071,11 +1065,7 @@ Zones::getFingerprint() const QByteArray ba = QByteArray::number(x); // we spot other things separately -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } // get fingerprint just for the range that applies on this date @@ -1111,11 +1101,7 @@ Zones::getFingerprint(QDate forDate) const QByteArray ba = QByteArray::number(x); // limits to only zones now as we sport weight separately -#if QT_VERSION < 0x060000 - return qChecksum(ba, ba.length()); -#else return qChecksum(ba); -#endif } QString diff --git a/src/R/RLibrary.h b/src/R/RLibrary.h index f7bc8a179..cf096f938 100644 --- a/src/R/RLibrary.h +++ b/src/R/RLibrary.h @@ -23,7 +23,6 @@ #pragma GCC diagnostic ignored "-Wparentheses" #endif -// QFunctionPointer typedef introduced in QT5 #include #include #include diff --git a/src/Train/BT40Controller.cpp b/src/Train/BT40Controller.cpp index f4367e070..7fbe5d0e7 100644 --- a/src/Train/BT40Controller.cpp +++ b/src/Train/BT40Controller.cpp @@ -49,11 +49,7 @@ BT40Controller::BT40Controller(TrainSidebar *parent, DeviceConfiguration *dc) : connect(discoveryAgent, SIGNAL(deviceDiscovered(const QBluetoothDeviceInfo&)), this, SLOT(addDevice(const QBluetoothDeviceInfo&))); -#if QT_VERSION < 0x060000 - connect(discoveryAgent, SIGNAL(error(QBluetoothDeviceDiscoveryAgent::Error)), -#else connect(discoveryAgent, SIGNAL(errorOccurred(QBluetoothDeviceDiscoveryAgent::Error)), -#endif this, SLOT(deviceScanError(QBluetoothDeviceDiscoveryAgent::Error))); connect(discoveryAgent, SIGNAL(finished()), this, SLOT(scanFinished())); } diff --git a/src/Train/BT40Device.cpp b/src/Train/BT40Device.cpp index d3f76b777..837ca5f52 100644 --- a/src/Train/BT40Device.cpp +++ b/src/Train/BT40Device.cpp @@ -58,11 +58,7 @@ BT40Device::BT40Device(QObject *parent, QBluetoothDeviceInfo devinfo) : parent(p { m_control = QLowEnergyController::createCentral(m_currentDevice, this); connect(m_control, SIGNAL(connected()), this, SLOT(deviceConnected()), Qt::QueuedConnection); -#if QT_VERSION < 0x060000 - connect(m_control, SIGNAL(error(QLowEnergyController::Error)), this, SLOT(controllerError(QLowEnergyController::Error))); -#else connect(m_control, SIGNAL(errorOccurred(QLowEnergyController::Error)), this, SLOT(controllerError(QLowEnergyController::Error))); -#endif connect(m_control, SIGNAL(disconnected()), this, SLOT(deviceDisconnected()), Qt::QueuedConnection); connect(m_control, SIGNAL(serviceDiscovered(QBluetoothUuid)), this, SLOT(serviceDiscovered(QBluetoothUuid)), Qt::QueuedConnection); connect(m_control, SIGNAL(discoveryFinished()), this, SLOT(serviceScanDone()), Qt::QueuedConnection); diff --git a/src/Train/ErgFile.cpp b/src/Train/ErgFile.cpp index da470a60f..fa7951c7e 100644 --- a/src/Train/ErgFile.cpp +++ b/src/Train/ErgFile.cpp @@ -1322,9 +1322,6 @@ ErgFile::save(QStringList &errors) // setup output stream to file QTextStream out(&f); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // write the header // @@ -1436,9 +1433,6 @@ ErgFile::save(QStringList &errors) // setup output stream to file QTextStream out(&f); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif // write the header // @@ -1543,9 +1537,6 @@ ErgFile::save(QStringList &errors) // setup output stream to file QTextStream out(&f); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif out << "\n"; diff --git a/src/Train/FilterEditor.cpp b/src/Train/FilterEditor.cpp index fce89e6cf..1e712806e 100644 --- a/src/Train/FilterEditor.cpp +++ b/src/Train/FilterEditor.cpp @@ -210,7 +210,7 @@ FilterEditor::updateCompleterModel } } QStringList completerCmds; - for (const auto &origCmd : qAsConst(_origCmds)) { + for (const auto &origCmd : std::as_const(_origCmds)) { if (! cmds.contains(origCmd, Qt::CaseInsensitive)) { completerCmds << origCmd; } diff --git a/src/Train/KurtInRide.cpp b/src/Train/KurtInRide.cpp index 02673b917..33bce5a5f 100644 --- a/src/Train/KurtInRide.cpp +++ b/src/Train/KurtInRide.cpp @@ -160,6 +160,7 @@ void inride_BTDeviceInfoToSystemID(const QBluetoothDeviceInfo &devinfo, uint8_t quint128 be_uuid128 = uuid.toUInt128(); +// GC minimum Qt required for v3.8 is Qt6.5.3 #if QT_VERSION < 0x060600 addr64 = *(uint64_t*)be_uuid128.data; #else diff --git a/src/Train/LibraryParser.cpp b/src/Train/LibraryParser.cpp index c97c0f1d2..15192fb88 100644 --- a/src/Train/LibraryParser.cpp +++ b/src/Train/LibraryParser.cpp @@ -83,10 +83,6 @@ LibraryParser::serialize(QDir home) }; file.resize(0); QTextStream out(&file); -#if QT_VERSION < 0x060000 - out.setCodec("UTF-8"); -#endif - // write out to file foreach (Library *l, ::libraries) { diff --git a/src/Train/ModelFilter.cpp b/src/Train/ModelFilter.cpp index 753a84f6a..480080c2e 100644 --- a/src/Train/ModelFilter.cpp +++ b/src/Train/ModelFilter.cpp @@ -86,7 +86,7 @@ bool ModelNumberRangeFilter::accept (const QVariant &data) const { - if (! data.canConvert(supportedType())) { + if (! data.canConvert(QMetaType(supportedType()))) { return false; } bool ok = false; @@ -148,7 +148,7 @@ bool ModelFloatRangeFilter::accept (const QVariant &data) const { - if (! data.canConvert(supportedType())) { + if (! data.canConvert(QMetaType(supportedType()))) { return false; } bool ok = false; @@ -210,12 +210,12 @@ bool ModelStringContainsFilter::accept (const QVariant &data) const { - if (! data.canConvert(supportedType())) { + if (! data.canConvert(QMetaType(supportedType()))) { return false; } bool contains = _all; QString dataValue = data.toString(); - for (const auto &item : qAsConst(_values)) { + for (const auto &item : std::as_const(_values)) { if (_all) { contains &= dataValue.contains(item, Qt::CaseInsensitive); } else if (dataValue.contains(item, Qt::CaseInsensitive)) { diff --git a/src/Train/RatingWidget.cpp b/src/Train/RatingWidget.cpp index ec5ecd17d..075a45775 100644 --- a/src/Train/RatingWidget.cpp +++ b/src/Train/RatingWidget.cpp @@ -81,7 +81,7 @@ RatingWidget::mouseMoveEvent s.append(QChar(STAR_FILLED)); QRect starRect = fontMetrics.boundingRect(s); int ratingWidth = starRect.width() + leftOffset; - if (event->localPos().x() < ratingWidth) { + if (event->position().x() < ratingWidth) { mouseOverRating = i; break; } diff --git a/src/Train/TrainSidebar.cpp b/src/Train/TrainSidebar.cpp index 45795f77f..268ed2dcf 100644 --- a/src/Train/TrainSidebar.cpp +++ b/src/Train/TrainSidebar.cpp @@ -39,12 +39,7 @@ #include #include #include - -#if QT_VERSION >= 0x060000 #include -#else -#include -#endif // Three current realtime device types supported are: #include "RealtimeController.h" @@ -2101,13 +2096,9 @@ void TrainSidebar::guiUpdate() // refreshes the telemetry if (fPlayAudio) { lapAudioThisLap = false; -#if QT_VERSION >= 0x060000 static QSoundEffect effect; effect.setSource(QUrl::fromLocalFile(":audio/lap.wav")); effect.play(); -#else - QSound::play(":audio/lap.wav"); -#endif } } diff --git a/src/Train/TrainerDayAPIDialog.cpp b/src/Train/TrainerDayAPIDialog.cpp index 61b197013..01c820065 100644 --- a/src/Train/TrainerDayAPIDialog.cpp +++ b/src/Train/TrainerDayAPIDialog.cpp @@ -519,35 +519,35 @@ TrainerDayAPIDialog::setBoxState QGroupBox *box = groupBoxes[idx]; switch (state) { case TrainerDayAPIDialogState::importNew: - groupBoxes[idx]->setChecked(false); - groupBoxes[idx]->setCheckable(allowReimport->isChecked()); - groupBoxes[idx]->setTitle(workoutTitle + " - " + tr("successfully imported")); - groupBoxes[idx]->setProperty("imported", 1); + box->setChecked(false); + box->setCheckable(allowReimport->isChecked()); + box->setTitle(workoutTitle + " - " + tr("successfully imported")); + box->setProperty("imported", 1); break; case TrainerDayAPIDialogState::importOld: - groupBoxes[idx]->setChecked(false); - groupBoxes[idx]->setCheckable(allowReimport->isChecked()); - groupBoxes[idx]->setTitle(workoutTitle + " - " + tr("already imported")); - groupBoxes[idx]->setProperty("imported", 1); + box->setChecked(false); + box->setCheckable(allowReimport->isChecked()); + box->setTitle(workoutTitle + " - " + tr("already imported")); + box->setProperty("imported", 1); break; case TrainerDayAPIDialogState::importFailed: - groupBoxes[idx]->setChecked(true); - groupBoxes[idx]->setCheckable(true); - groupBoxes[idx]->setTitle(workoutTitle + " - " + tr("import failed")); - groupBoxes[idx]->setProperty("imported", 0); + box->setChecked(true); + box->setCheckable(true); + box->setTitle(workoutTitle + " - " + tr("import failed")); + box->setProperty("imported", 0); break; case TrainerDayAPIDialogState::unimportedFile: - groupBoxes[idx]->setChecked(false); - groupBoxes[idx]->setCheckable(allowReimport->isChecked()); - groupBoxes[idx]->setTitle(workoutTitle + " - " + tr("available in filesystem but not imported")); - groupBoxes[idx]->setProperty("imported", 0); + box->setChecked(false); + box->setCheckable(allowReimport->isChecked()); + box->setTitle(workoutTitle + " - " + tr("available in filesystem but not imported")); + box->setProperty("imported", 0); break; case TrainerDayAPIDialogState::readyForImport: default: - groupBoxes[idx]->setChecked(true); - groupBoxes[idx]->setCheckable(true); - groupBoxes[idx]->setTitle(workoutTitle); - groupBoxes[idx]->setProperty("imported", 0); + box->setChecked(true); + box->setCheckable(true); + box->setTitle(workoutTitle); + box->setProperty("imported", 0); break; } } diff --git a/src/Train/VideoWindow.cpp b/src/Train/VideoWindow.cpp index a03bfa118..793ae5eb9 100644 --- a/src/Train/VideoWindow.cpp +++ b/src/Train/VideoWindow.cpp @@ -28,7 +28,7 @@ #include "VideoLayoutParser.h" #include "HelpWhatsThis.h" -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) #include #endif @@ -111,7 +111,7 @@ VideoWindow::VideoWindow(Context *context) : } #endif -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) // USE QT VIDEO PLAYER wd = new QVideoWidget(this); wd->show(); @@ -209,7 +209,7 @@ VideoWindow::~VideoWindow() delete container; #endif -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) // QT MEDIA delete mp; delete wd; @@ -232,10 +232,6 @@ bool VideoWindow::hasActiveVideo() const break; // needed for compiler warning } #endif -#ifdef GC_VIDEO_QT5 - if (mp->state() != QMediaPlayer::StoppedState) - return true; -#endif #ifdef GC_VIDEO_QT6 if (mp->playbackState() != QMediaPlayer::StoppedState) return true; @@ -376,9 +372,6 @@ void VideoWindow::startPlayback() m_MediaChanged = false; #endif -#ifdef GC_VIDEO_QT5 - mp->play(); -#endif #ifdef GC_VIDEO_QT6 // open the media object float rate = 1.0f; @@ -439,11 +432,10 @@ void VideoWindow::startPlayback() } } #endif -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) double videoSyncFrameRate = currentVideoSyncFile->videoFrameRate(); if (videoSyncFrameRate > 0.) { bool ok=false; -#ifdef GC_VIDEO_QT6 auto md = mp->metaData(); auto rate = md.value(QMediaMetaData::VideoFrameRate); @@ -451,7 +443,6 @@ void VideoWindow::startPlayback() if (mediaFrameRate > 0.) { videoSyncTimeAdjustFactor = videoSyncFrameRate / mediaFrameRate; } -#endif if (!ok) //fallback to duration { // QT5 doesn't expose media frame rate so make due with duration. @@ -512,7 +503,7 @@ void VideoWindow::stopPlayback() vlcDispatch.AsyncCall([capture_mp]{ libvlc_media_player_stop(capture_mp); }); #endif -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) mp->stop(); #endif } @@ -533,7 +524,7 @@ void VideoWindow::pausePlayback() vlcDispatch.AsyncCall([capture_mp]{libvlc_media_player_set_pause(capture_mp, true); }); #endif -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) mp->pause(); #endif } @@ -556,7 +547,7 @@ void VideoWindow::resumePlayback() } #endif -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) mp->play(); #endif @@ -877,11 +868,6 @@ void VideoWindow::telemetryUpdate(RealtimeData rtd) } #endif -#ifdef GC_VIDEO_QT5 -//TODO -// // seek to ms position in current file -// mp->setPosition(ms); -#endif } void VideoWindow::seekPlayback(long ms) @@ -910,7 +896,7 @@ void VideoWindow::seekPlayback(long ms) libvlc_media_player_t* capture_mp = this->mp; vlcDispatch.AsyncCall([capture_mp, ms]{ libvlc_media_player_set_time(capture_mp, (libvlc_time_t)ms); }); #else -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) mp->setPosition(ms); #else Q_UNUSED(ms) @@ -967,11 +953,6 @@ void VideoWindow::mediaSelected(QString filename) } #endif -#ifdef GC_VIDEO_QT5 - // QT MEDIA - mc = QMediaContent(QUrl::fromLocalFile(filename)); - mp->setMedia(mc); -#endif #ifdef GC_VIDEO_QT6 // QT MEDIA if (filename != "") diff --git a/src/Train/VideoWindow.h b/src/Train/VideoWindow.h index 6b2838d74..5b7f1e1cc 100644 --- a/src/Train/VideoWindow.h +++ b/src/Train/VideoWindow.h @@ -28,7 +28,6 @@ // Options are, GC_VIDEO_xxxx where xxxx is one of: // GC_VIDEO_VLC // GC_VIDEO_NONE -// GC_VIDEO_QT5 // GC_VIDEO_QT6 // // If the user hasn't set one of the above then we determine @@ -40,18 +39,18 @@ #ifdef Q_OS_MAC // if we aint chosen one or the other then use none -#if !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_QT6 && !defined GC_VIDEO_VLC +#if !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT6 && !defined GC_VIDEO_VLC #define GC_VIDEO_NONE #endif -// but qt5 and vlc are not experimental options ! +// but vlc is an experimental option ! #if defined GC_VIDEO_VLC #warning "VLC is supported experimentally on Mac OS X builds of GoldenCheetah" #endif -// but qt5 *is* supported, but use at your own risk! -#if defined (GC_VIDEO_QT5) || defined (GC_VIDEO_QT6) -#warning "QT 5/6 video is supported experimentally in this version" +// but qt6 *is* supported, but use at your own risk! +#if defined (GC_VIDEO_QT6) +#warning "QT6 video is supported experimentally on Mac OS X builds of GoldenCheetah" #endif #endif //Q_OS_MAC @@ -63,24 +62,19 @@ #if defined Q_OS_LINUX || defined Q_OS_WIN // did the user specify location for VLC but not GC_VIDEO_XXXX -#if defined GC_HAVE_VLC && !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_QT6 +#if defined GC_HAVE_VLC && !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT6 #if !defined GC_VIDEO_VLC #define GC_VIDEO_VLC #endif #endif // if we aint chosen one then use none -#if !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT5 && !defined GC_VIDEO_QT6 && !defined GC_VIDEO_VLC +#if !defined GC_VIDEO_NONE && !defined GC_VIDEO_QT6 && !defined GC_VIDEO_VLC #define GC_VIDEO_NONE #endif #endif // Q_OS_LINUX || Q_OS_WIN -// now check for stupid settings -#if defined GC_VIDEO_QT6 && QT_VERSION < 0x060000 -#error "Qt6 Video is not supported on Qt5" -#endif - //---------------------------------------------------------------------- // Now options are set lets pull in the headers we need then //---------------------------------------------------------------------- @@ -103,16 +97,11 @@ extern "C" { #endif // VLC -#if defined(GC_VIDEO_QT5)||defined(GC_VIDEO_QT6) // QT5/6 Video Stuff +#if defined(GC_VIDEO_QT6) // QT6 Video Stuff #include #include -#endif -#ifdef GC_VIDEO_QT6 #include #endif -#ifdef GC_VIDEO_QT5 -#include -#endif // QT stuff etc #include @@ -315,10 +304,7 @@ class VideoWindow : public GcChartWindow mutable OrderedAsync vlcDispatch; #endif -#ifdef GC_VIDEO_QT5 - QMediaContent mc; -#endif -#if defined(GC_VIDEO_QT5) || defined(GC_VIDEO_QT6) +#if defined(GC_VIDEO_QT6) // QT native QVideoWidget *wd; QMediaPlayer *mp; diff --git a/src/Train/WebPageWindow.cpp b/src/Train/WebPageWindow.cpp index cb4dc2cce..5a6b53f67 100644 --- a/src/Train/WebPageWindow.cpp +++ b/src/Train/WebPageWindow.cpp @@ -38,11 +38,7 @@ #include #include -#if QT_VERSION < 0x060000 -#include -#else #include -#endif // overlay helper #include "AbstractView.h" @@ -165,11 +161,7 @@ WebPageWindow::WebPageWindow(Context *context) : GcChartWindow(context), context configChanged(CONFIG_APPEARANCE); // intercept downloads -#if QT_VERSION < 0x060000 - connect(view->page()->profile(), SIGNAL(downloadRequested(QWebEngineDownloadItem*)), this, SLOT(downloadRequested(QWebEngineDownloadItem*))); -#else connect(view->page()->profile(), SIGNAL(downloadRequested(QWebEngineDownloadRequest*)), this, SLOT(downloadRequested(QWebEngineDownloadRequest*))); -#endif connect(view->page(), SIGNAL(linkHovered(QString)), this, SLOT(linkHovered(QString))); forceReplot(); @@ -252,11 +244,7 @@ WebPageWindow::event(QEvent *event) } void -#if QT_VERSION < 0x060000 -WebPageWindow::downloadRequested(QWebEngineDownloadItem *item) -#else WebPageWindow::downloadRequested(QWebEngineDownloadRequest *item) -#endif { // only do it if I am visible, as shared across web page instances if (!amVisible()) return; @@ -273,12 +261,7 @@ WebPageWindow::downloadRequested(QWebEngineDownloadRequest *item) filenames << QDir(item->downloadDirectory()).absoluteFilePath(item->downloadFileName()); // set save -#if QT_VERSION < 0x060000 - connect(item, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64,qint64))); - connect(item, SIGNAL(finished()), this, SLOT(downloadFinished())); -#else connect(item, SIGNAL(isFinishedChanged()), this, SLOT(downloadFinished())); -#endif // kick off download item->accept(); // lets download it! diff --git a/src/Train/WebPageWindow.h b/src/Train/WebPageWindow.h index e0f1d0056..2d121a078 100644 --- a/src/Train/WebPageWindow.h +++ b/src/Train/WebPageWindow.h @@ -49,11 +49,7 @@ class SmallPlot; // trick the maps api into ignoring gestures by // pretending to be chrome. see: http://developer.qt.nokia.com/forums/viewthread/1643/P15 -#if QT_VERSION < 0x060000 -class QWebEngineDownloadItem; -#else class QWebEngineDownloadRequest; -#endif class WebPageWindow : public GcChartWindow { @@ -84,11 +80,7 @@ class WebPageWindow : public GcChartWindow void downloadProgress(qint64, qint64); void downloadFinished(); -#if QT_VERSION < 0x060000 - void downloadRequested(QWebEngineDownloadItem*); -#else void downloadRequested(QWebEngineDownloadRequest*); -#endif void linkHovered(QString); private: diff --git a/src/gcconfig.pri.in b/src/gcconfig.pri.in index b34a2bdfe..af0489b7e 100644 --- a/src/gcconfig.pri.in +++ b/src/gcconfig.pri.in @@ -244,7 +244,6 @@ macx { # What video playback do you want? DEFINES += GC_VIDEO_NONE # dont add any video playback support -#DEFINES += GC_VIDEO_QT5 # use QT5 qvideowidget if QT > 5.2.1 #DEFINES += GC_VIDEO_QT6 # qt6 videowidget #DEFINES += GC_VIDEO_VLC # use VideoLan library needs VLC_INSTALL defined above diff --git a/src/src.pro b/src/src.pro index 80e1a28f0..1d012a4be 100644 --- a/src/src.pro +++ b/src/src.pro @@ -5,7 +5,7 @@ # # ############################################################################### -!versionAtLeast(QT_VERSION, 5.15):error("Use at least Qt version 5.15") +!versionAtLeast(QT_VERSION, 6.5.3):error("Use at least Qt version 6.5.3") ###========================== ### IMPORT USER CONFIGURATION @@ -32,18 +32,13 @@ CONFIG(debug, debug|release) { QMAKE_CXXFLAGS += -DGC_DEBUG } ###======================================================================== -### QT5.14.2 officially supported which mandates c++11 support in toolchain +### QT6.5.3 officially supported which mandates c++17 support in toolchain ###======================================================================== # always QT += xml sql network svg widgets concurrent serialport multimedia multimediawidgets \ - webenginecore webenginewidgets webchannel positioning -greaterThan(QT_MAJOR_VERSION, 5) { - QT += webenginequick core5compat -} else { - QT += webengine -} -CONFIG += c++11 + webenginecore webenginewidgets webchannel positioning webenginequick core5compat +CONFIG += c++17 ###========================== ### PRECOMPILED HEADER @@ -155,7 +150,6 @@ macx { # on mac we use native buttons and video, but have native fullscreen support LIBS += -lobjc -framework IOKit -framework AppKit - # GC_VIDEO_QT5 will enable Qt5 video support, # GC_VIDEO_QT6 will enable Qt6 video support, # GC_VIDEO_VLC will enable VLC video support, # otherwise we have a blank videowindow, it will do nothing @@ -236,7 +230,7 @@ RESOURCES = $${PWD}/Resources/application.qrc ### OPTIONAL => Embed Python ###========================= -notsupported = "INFO: Embedded Python requires version QT >= 5.8, no support for" +notsupported = "INFO: Embedded Python requires version QT >= 6.5.3, no support for" notsupported += $${QT_VERSION} contains(DEFINES, "GC_WANT_PYTHON") { @@ -498,11 +492,11 @@ SOURCES += $$HTPATH/httpglobal.cpp \ ### OPTIONAL => CLOUD DB [Google App Engine Integration] ###===================================================== -##----------------------------------------------## -## CloudDB is only supported on QT5.5 or higher ## -##----------------------------------------------## +##------------------------------------------------## +## CloudDB is only supported on QT6.5.3 or higher ## +##------------------------------------------------## -notsupported = "INFO: CloudDB requires version QT >= 5.5, no support for" +notsupported = "INFO: CloudDB requires version QT >= 6.5.3, no support for" notsupported += $${QT_VERSION} equals(CloudDB, active) { @@ -528,13 +522,6 @@ equals(CloudDB, active) { # # ############################################################################### - - -###=========================================== -### FEATURES ENABLED WHEN HAVE QT5 [or higher] -###=========================================== - -# Features that only work with QT5 or higher SOURCES += Cloud/Dropbox.cpp HEADERS += Cloud/Dropbox.h SOURCES += Cloud/OpenData.cpp @@ -671,7 +658,7 @@ HEADERS += Gui/AboutDialog.h Gui/AddIntervalDialog.h Gui/AnalysisSidebar.h Gui/C Gui/PerspectiveDialog.h Gui/SplashScreen.h Gui/StyledItemDelegates.h Gui/MetadataDialog.h Gui/ActionButtonBox.h \ Gui/MetricOverrideDialog.h Gui/RepeatScheduleWizard.h \ Gui/Calendar.h Gui/Agenda.h Gui/CalendarData.h Gui/CalendarItemDelegates.h \ - Gui/IconManager.h Gui/Qt5Compatibility.h + Gui/IconManager.h # metrics and models HEADERS += Metrics/Banister.h Metrics/CPSolver.h Metrics/Estimator.h Metrics/ExtendedCriticalPower.h Metrics/HrZones.h Metrics/PaceZones.h \ diff --git a/unittests/Gui/calendarData/testCalendarData.cpp b/unittests/Gui/calendarData/testCalendarData.cpp index 1384621a2..30508111c 100644 --- a/unittests/Gui/calendarData/testCalendarData.cpp +++ b/unittests/Gui/calendarData/testCalendarData.cpp @@ -10,9 +10,7 @@ class TestCalendarData: public QObject private slots: void layoutCalendarEntry() { -#if QT_VERSION < 0x060000 - QSKIP("Skipping test with Qt5"); -#else + QList entries = { { "", "", "", "", "", Qt::red, "", QTime(9, 0), 3600 }, { "", "", "", "", "", Qt::red, "", QTime(9, 30), 3600 }, @@ -34,7 +32,6 @@ private slots: QCOMPARE(layout[3].columnCount, 2); QCOMPARE(layout[4].columnIndex, 1); QCOMPARE(layout[4].columnCount, 2); -#endif } }; diff --git a/util/rpi/gcconfig.pri.for_rpi b/util/rpi/gcconfig.pri.for_rpi index 27da5d2b6..a15ff915e 100644 --- a/util/rpi/gcconfig.pri.for_rpi +++ b/util/rpi/gcconfig.pri.for_rpi @@ -263,7 +263,7 @@ macx { # What video playback do you want? DEFINES += GC_VIDEO_NONE # dont add any video playback support #DEFINES += GC_VIDEO_QUICKTIME # mac only and the default -#DEFINES += GC_VIDEO_QT5 # use QT5 qvideowidget if QT > 5.2.1 +#DEFINES += GC_VIDEO_QT6 # use QT6 qvideowidget #DEFINES += GC_VIDEO_VLC # use VideoLan library needs VLC_INSTALL defined above #DEFINES += GC_VIDEO_AV # use AV Foundation on Mac now QTKit is deprecated