summaryrefslogtreecommitdiffstats
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/basetracktablemodel.cpp6
-rw-r--r--src/library/dao/trackdao.cpp4
-rw-r--r--src/library/dlgcoverartfullsize.cpp14
-rw-r--r--src/library/export/trackexportdlg.cpp8
-rw-r--r--src/library/stardelegate.cpp2
-rw-r--r--src/library/stareditor.cpp7
6 files changed, 32 insertions, 9 deletions
diff --git a/src/library/basetracktablemodel.cpp b/src/library/basetracktablemodel.cpp
index e9ac6597b1..1262856389 100644
--- a/src/library/basetracktablemodel.cpp
+++ b/src/library/basetracktablemodel.cpp
@@ -420,7 +420,7 @@ QVariant BaseTrackTableModel::data(
DEBUG_ASSERT(bgColor.isValid());
DEBUG_ASSERT(m_backgroundColorOpacity >= 0.0);
DEBUG_ASSERT(m_backgroundColorOpacity <= 1.0);
- bgColor.setAlphaF(m_backgroundColorOpacity);
+ bgColor.setAlphaF(static_cast<float>(m_backgroundColorOpacity));
return QBrush(bgColor);
}
@@ -646,7 +646,11 @@ QVariant BaseTrackTableModel::roleValue(
}
case ColumnCache::COLUMN_LIBRARYTABLE_LAST_PLAYED_AT: {
QDateTime lastPlayedAt;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ if (rawValue.metaType().id() == QMetaType::QString) {
+#else
if (rawValue.type() == QVariant::String) {
+#endif
// column value
lastPlayedAt = mixxx::sqlite::readGeneratedTimestamp(rawValue);
} else {
diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp
index f10914bfcc..179b5005ee 100644
--- a/src/library/dao/trackdao.cpp
+++ b/src/library/dao/trackdao.cpp
@@ -648,7 +648,11 @@ bool insertTrackLibrary(
pTrackLibraryInsert->bindValue(":mixxx_deleted", 0);
// We no longer store the wavesummary in the library table.
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ pTrackLibraryInsert->bindValue(":wavesummaryhex", QVariant(QMetaType(QMetaType::QByteArray)));
+#else
pTrackLibraryInsert->bindValue(":wavesummaryhex", QVariant(QVariant::ByteArray));
+#endif
VERIFY_OR_DEBUG_ASSERT(pTrackLibraryInsert->exec()) {
// We failed to insert the track. Maybe it is already in the library
diff --git a/src/library/dlgcoverartfullsize.cpp b/src/library/dlgcoverartfullsize.cpp
index 9723f3abb7..ac22b95904 100644
--- a/src/library/dlgcoverartfullsize.cpp
+++ b/src/library/dlgcoverartfullsize.cpp
@@ -223,7 +223,12 @@ void DlgCoverArtFullSize::mousePressEvent(QMouseEvent* event) {
m_clickTimer.setSingleShot(true);
m_clickTimer.start(500);
m_coverPressed = true;
- m_dragStartPosition = event->globalPos() - frameGeometry().topLeft();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QPoint eventPosition = event->globalPosition().toPoint();
+#else
+ QPoint eventPosition = event->globalPos();
+#endif
+ m_dragStartPosition = eventPosition - frameGeometry().topLeft();
}
}
@@ -247,7 +252,12 @@ void DlgCoverArtFullSize::mouseReleaseEvent(QMouseEvent* event) {
void DlgCoverArtFullSize::mouseMoveEvent(QMouseEvent* event) {
if (m_coverPressed) {
- move(event->globalPos() - m_dragStartPosition);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QPoint eventPosition = event->globalPosition().toPoint();
+#else
+ QPoint eventPosition = event->globalPos();
+#endif
+ move(eventPosition - m_dragStartPosition);
event->accept();
} else {
return;
diff --git a/src/library/export/trackexportdlg.cpp b/src/library/export/trackexportdlg.cpp
index d6c6c0335e..e364cb4597 100644
--- a/src/library/export/trackexportdlg.cpp
+++ b/src/library/export/trackexportdlg.cpp
@@ -73,10 +73,10 @@ void TrackExportDlg::slotAskOverwriteMode(
QMessageBox::Cancel | QMessageBox::No | QMessageBox::NoToAll
| QMessageBox::Yes | QMessageBox::YesToAll);
question_box.setDefaultButton(QMessageBox::No);
- question_box.setButtonText(QMessageBox::Yes, tr("&Overwrite"));
- question_box.setButtonText(QMessageBox::YesToAll, tr("Over&write All"));
- question_box.setButtonText(QMessageBox::No, tr("&Skip"));
- question_box.setButtonText(QMessageBox::NoToAll, tr("Skip &All"));
+ question_box.addButton(tr("&Overwrite"), QMessageBox::YesRole);
+ question_box.addButton(tr("Over&write All"), QMessageBox::YesRole);
+ question_box.addButton(tr("&Skip"), QMessageBox::NoRole);
+ question_box.addButton(tr("Skip &All"), QMessageBox::NoRole);
switch (question_box.exec()) {
case QMessageBox::No:
diff --git a/src/library/stardelegate.cpp b/src/library/stardelegate.cpp
index 8d000e605a..6df2122ea7 100644
--- a/src/library/stardelegate.cpp
+++ b/src/library/stardelegate.cpp
@@ -75,7 +75,7 @@ void StarDelegate::cellEntered(const QModelIndex& index) {
// This slot is called if the mouse pointer enters ANY cell on the
// QTableView but the code should only be executed on a column with a
// StarRating.
- if (index.data().canConvert(qMetaTypeId<StarRating>())) {
+ if (index.data().canConvert<StarRating>()) {
if (m_isOneCellInEditMode) {
m_pTableView->closePersistentEditor(m_currentEditedCellIndex);
}
diff --git a/src/library/stareditor.cpp b/src/library/stareditor.cpp
index 4d5dc07960..8c38f9d8d5 100644
--- a/src/library/stareditor.cpp
+++ b/src/library/stareditor.cpp
@@ -82,7 +82,12 @@ void StarEditor::paintEvent(QPaintEvent*) {
}
void StarEditor::mouseMoveEvent(QMouseEvent *event) {
- int star = starAtPosition(event->x());
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ const int eventPosition = static_cast<int>(event->position().x());
+#else
+ const int eventPosition = event->x();
+#endif
+ int star = starAtPosition(eventPosition);
if (star != m_starRating.starCount() && star != -1) {
m_starRating.setStarCount(star);