[vlc-commits] [Git][videolan/vlc][master] 10 commits: qt: fix deprecated warnings in videosurface.cpp
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sun Apr 28 14:45:15 UTC 2024
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
96c6d767 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warnings in videosurface.cpp
- - - - -
e4a5bcd7 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warnings in compositor_x11_uisurface.cpp
- - - - -
706c1b03 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in controlbar_profile_model.cpp
- - - - -
7d0fba8c by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in custom_menus.cpp
- - - - -
e5e7a3e3 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in qml_menu_wrapper.cpp
- - - - -
ecad138f by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in systempalettethemeprovider.cpp
- - - - -
8a8cf4c8 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in control_list_model.cpp
- - - - -
65bffbc1 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in color_scheme_model.cpp
- - - - -
a7be331f by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in navigation_history.cpp
- - - - -
5ce659d7 by Fatih Uzunoglu at 2024-04-28T14:01:46+00:00
qt: fix deprecated warning in extended.cpp
- - - - -
10 changed files:
- modules/gui/qt/dialogs/extended/extended.cpp
- modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
- modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
- modules/gui/qt/maininterface/videosurface.cpp
- modules/gui/qt/menus/custom_menus.cpp
- modules/gui/qt/menus/qml_menu_wrapper.cpp
- modules/gui/qt/player/control_list_model.cpp
- modules/gui/qt/style/systempalettethemeprovider.cpp
- modules/gui/qt/util/color_scheme_model.cpp
- modules/gui/qt/util/navigation_history.cpp
Changes:
=====================================
modules/gui/qt/dialogs/extended/extended.cpp
=====================================
@@ -211,7 +211,7 @@ void ExtendedDialog::saveConfig()
i != hashConfig->end(); ++i )
{
QVariant &value = i.value();
- switch( static_cast<QMetaType::Type>(value.type()) )
+ switch( static_cast<QMetaType::Type>(value.typeId()) )
{
case QMetaType::QString:
config_PutPsz( qtu(i.key()), qtu(value.toString()) );
=====================================
modules/gui/qt/dialogs/toolbar/controlbar_profile_model.cpp
=====================================
@@ -521,7 +521,7 @@ bool ControlbarProfileModel::setData(const QModelIndex &index, const QVariant &v
switch (role)
{
case Qt::DisplayRole:
- if (value.canConvert(QVariant::String))
+ if (value.canConvert<QString>())
ptrProfile->setName(value.toString());
else
return false;
=====================================
modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
=====================================
@@ -288,8 +288,8 @@ bool CompositorX11UISurface::eventFilter(QObject*, QEvent *event)
case QEvent::Enter:
{
QEnterEvent *enterEvent = static_cast<QEnterEvent *>(event);
- QEnterEvent mappedEvent(enterEvent->localPos(), enterEvent->windowPos(),
- enterEvent->screenPos());
+ QEnterEvent mappedEvent(enterEvent->position(), enterEvent->scenePosition(),
+ enterEvent->globalPosition());
bool ret = QCoreApplication::sendEvent(m_uiWindow, &mappedEvent);
event->setAccepted(mappedEvent.isAccepted());
return ret;
@@ -326,8 +326,8 @@ bool CompositorX11UISurface::eventFilter(QObject*, QEvent *event)
case QEvent::MouseMove:
{
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
- QMouseEvent mappedEvent(mouseEvent->type(), mouseEvent->localPos(),
- mouseEvent->localPos(), mouseEvent->screenPos(),
+ QMouseEvent mappedEvent(mouseEvent->type(), mouseEvent->position(),
+ mouseEvent->position(), mouseEvent->globalPosition(),
mouseEvent->button(), mouseEvent->buttons(),
mouseEvent->modifiers(), mouseEvent->source());
QCoreApplication::sendEvent(m_uiWindow, &mappedEvent);
=====================================
modules/gui/qt/maininterface/videosurface.cpp
=====================================
@@ -270,7 +270,7 @@ void VideoSurface::mouseReleaseEvent(QMouseEvent* event)
void VideoSurface::mouseMoveEvent(QMouseEvent* event)
{
- QPointF current_pos = event->localPos();
+ QPointF current_pos = event->position();
QQuickWindow* window = this->window();
if (!window)
return;
@@ -281,7 +281,7 @@ void VideoSurface::mouseMoveEvent(QMouseEvent* event)
void VideoSurface::hoverMoveEvent(QHoverEvent* event)
{
- QPointF current_pos = event->posF();
+ QPointF current_pos = event->position();
if (current_pos != m_oldHoverPos)
{
QQuickWindow* window = this->window();
=====================================
modules/gui/qt/menus/custom_menus.cpp
=====================================
@@ -446,7 +446,7 @@ BooleanPropertyAction::BooleanPropertyAction(QString title, QObject *model, QStr
int propertyId = meta->indexOfProperty(qtu(propertyName));
assert(propertyId != -1);
QMetaProperty property = meta->property(propertyId);
- assert(property.type() == QVariant::Bool);
+ assert(property.typeId() == QMetaType::Bool);
const QMetaObject* selfMeta = this->metaObject();
assert(property.hasNotifySignal());
=====================================
modules/gui/qt/menus/qml_menu_wrapper.cpp
=====================================
@@ -737,7 +737,7 @@ void PlaylistMediaContextMenu::popup(const QModelIndexList & selected, QPoint po
ml->addAndPlay(ids, {":no-video"});
});
- if (options.contains("information") && options["information"].type() == QVariant::Int) {
+ if (options.contains("information") && options["information"].typeId() == QMetaType::Int) {
action = m_menu->addAction(qtr("Information"));
QSignalMapper * mapper = new QSignalMapper(m_menu.get());
=====================================
modules/gui/qt/player/control_list_model.cpp
=====================================
@@ -53,7 +53,7 @@ bool ControlListModel::setData(const QModelIndex &index, const QVariant &value,
switch (role) {
case ID_ROLE:
- if (value.canConvert(QVariant::Int))
+ if (value.canConvert<int>())
control = static_cast<ControlType>(value.toInt());
else
return false;
=====================================
modules/gui/qt/style/systempalettethemeprovider.cpp
=====================================
@@ -45,15 +45,18 @@ public:
{
vlc_assert(obj);
updatePalette();
- connect(qApp, &QGuiApplication::paletteChanged, this, &SystemePaletteObserver::paletteChanged);
}
-public slots:
- void paletteChanged()
+ bool event(QEvent *event) override
{
- updatePalette();
- if (m_obj->paletteUpdated)
- m_obj->paletteUpdated(m_obj, m_obj->paletteUpdatedData);
+ if (event->type() == QEvent::ApplicationPaletteChange)
+ {
+ updatePalette();
+ if (m_obj->paletteUpdated)
+ m_obj->paletteUpdated(m_obj, m_obj->paletteUpdatedData);
+ }
+
+ return QObject::event(event);
}
public:
=====================================
modules/gui/qt/util/color_scheme_model.cpp
=====================================
@@ -60,7 +60,7 @@ bool ColorSchemeModel::setData(const QModelIndex &index,
if (role == Qt::CheckStateRole
&& checkIndex(index, CheckIndexOption::IndexIsValid)
&& index.row() != m_currentIndex
- && value.type() == QVariant::Bool
+ && value.typeId() == QMetaType::Bool
&& value.toBool())
{
setCurrentIndex(index.row());
=====================================
modules/gui/qt/util/navigation_history.cpp
=====================================
@@ -44,17 +44,16 @@ void NavigationHistory::push(QStringList path, Qt::FocusReason focusReason)
static bool isNodeValid(const QVariant& value)
{
- if (value.canConvert(QVariant::StringList)
- || value.canConvert(QVariant::StringList)
- || value.canConvert(QVariant::String)
- || value.canConvert(QVariant::UInt)
- || value.canConvert(QVariant::Int)
- || value.canConvert(QVariant::Bool)
+ if (value.canConvert<QStringList>()
+ || value.canConvert<QString>()
+ || value.canConvert<unsigned int>()
+ || value.canConvert<int>()
+ || value.canConvert<bool>()
|| value.canConvert<MLItemId>())
{
return true;
}
- else if ( value.canConvert(QVariant::List) )
+ else if ( value.canConvert<QVariantList>() )
{
QVariantList valueList = value.toList();
for (QVariant& v : valueList)
@@ -72,7 +71,7 @@ static bool isNodeValid(const QVariant& value)
return true;
}
- else if ( value.canConvert(QVariant::Map) )
+ else if ( value.canConvert<QVariantMap>() )
{
QVariantMap valueList = value.toMap();
for (QVariant& v : valueList.values())
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7d6abadd2416bd8fcd8ccb2e74dcdef53633ec0f...5ce659d7218c419f01e30435f28645d090f70276
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7d6abadd2416bd8fcd8ccb2e74dcdef53633ec0f...5ce659d7218c419f01e30435f28645d090f70276
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list