Use globalPosition()

This commit is contained in:
Jonas Kvinge 2020-07-18 04:09:36 +02:00
parent e5b3df41e9
commit 4328831fcd
2 changed files with 10 additions and 2 deletions

View File

@ -102,7 +102,11 @@ void AnalyzerContainer::mouseReleaseEvent(QMouseEvent *e) {
if (engine_->type() != Engine::EngineType::GStreamer) return;
if (e->button() == Qt::RightButton) {
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
context_menu_->popup(e->globalPosition().toPoint());
#else
context_menu_->popup(e->globalPos());
#endif
}
}

View File

@ -493,7 +493,7 @@ static void SetDate(QLabel *label, uint time) {
label->setText(QObject::tr("Unknown"));
}
else {
label->setText(QDateTime::fromTime_t(time).toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)));
label->setText(QDateTime::fromSecsSinceEpoch(time).toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)));
}
}
@ -560,7 +560,7 @@ void EditTagDialog::UpdateStatisticsTab(const Song &song) {
ui_->playcount->setText(QString::number(qMax(0, song.playcount())));
ui_->skipcount->setText(QString::number(qMax(0, song.skipcount())));
ui_->lastplayed->setText(song.lastplayed() <= 0 ? tr("Never") : QDateTime::fromTime_t(song.lastplayed()).toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)));
ui_->lastplayed->setText(song.lastplayed() <= 0 ? tr("Never") : QDateTime::fromSecsSinceEpoch(song.lastplayed()).toString(QLocale::system().dateTimeFormat(QLocale::LongFormat)));
}
@ -768,7 +768,11 @@ bool EditTagDialog::eventFilter(QObject *o, QEvent *e) {
if (o == ui_->art) {
switch (e->type()) {
case QEvent::MouseButtonRelease:
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
cover_menu_->popup(static_cast<QMouseEvent*>(e)->globalPosition().toPoint());
#else
cover_menu_->popup(static_cast<QMouseEvent*>(e)->globalPos());
#endif
break;
case QEvent::DragEnter: {