[vlc-commits] [Git][videolan/vlc][3.0.x] 30 commits: qt: use QStringLiteral with constant string concatenation

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Feb 20 14:40:35 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
0c699ef9 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QStringLiteral with constant string concatenation

Qt5 with QT_USE_QSTRINGBUILDER doesn't like the +.

- - - - -
d77b9e1d by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: keep the module name as a QString

So we don't have to release it manually.

This should be backported as Qt5 with QT_USE_QSTRINGBUILDER
doesn't like the + in onUpdate().
For some reason Qt6 is OK with that.

(cherry picked from commit e063d116ed6832b2b5c4463e980935ba09ddb082) (edited)
edited:
- the file was moved in 4.0

- - - - -
fa925464 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QString::fromWCharArray() to translate widows WCHAR strings

No need to translate to UTF-8 first (which is also not used as such later).

(cherry picked from commit 65b9fe623a57a0368ac2a620410b6f037c7a0c48) (edited)
edited:
- the file was moved in 4.0

- - - - -
692d3bb7 by Marvin Scholz at 2025-02-20T14:23:56+00:00
qt: add missing override specifier

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 52d261a014748f7aa404df0be437af31cda27bf5) (edited)
edited:
- 3.0 doesn't have setupVoutWindow() in components/voutwindow/qvoutwindowdummy.hpp

- - - - -
edd97132 by Lyndon Brown at 2025-02-20T14:23:56+00:00
qt: check cdda module exists before handling cdda specific option

Fixes #26492.

(cherry picked from commit fdf0eaa4fcbcda71017d0ef528b310774b35a2a2) (edited)
edited:
- the file was moved in 4.0
- 3.0 uses p_intf with config_GetPsz()

- - - - -
548889c1 by Johannes Kauffmann at 2025-02-20T14:23:56+00:00
qt: purge remaining use of Q_DECL_OVERRIDE

(cherry picked from commit 258921fd9eb54275a0b25806c800bf039f082002) (edited)
edited:
- many files were moved in 4.0

- - - - -
adacb4ff by Fatih Uzunoglu at 2025-02-20T14:23:56+00:00
qt: proper format handling for indeterministic integer type

(cherry picked from commit 283b2b483802a6369347477f51c68068268cce20) (edited)
edited:
- the file was moved in 4.0

- - - - -
c7808325 by Fatih Uzunoglu at 2025-02-20T14:23:56+00:00
qt: use QT_USE_QSTRINGBUILDER

(cherry picked from commit 0450706563e262c5728ff159241ec276fc359969) (edited)
edited:
- 3.0 doesn't have meson
- the CPP flags are different on 3.0

- - - - -
fffeec5c by Fatih Uzunoglu at 2025-02-20T14:23:56+00:00
qt: define QT_NO_CAST_FROM_BYTEARRAY

It is dangerous to have implicit casting between
QByteArray and pointer types.

(cherry picked from commit 18f4f954ae044089df4b95d37eb874e9a8629417) (edited)
edited:
- 3.0 doesn't have meson
- the CPP flags are different on 3.0
- 3.0 uses p_intf with config_PutPsz()
- some files modified in 4.0 don't exist on 3.0

- - - - -
2c43e321 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: remove deprecated timespec

Will be gone in 6.10. The replacement Timezone was added in 6.7.
And we don't need to set it unless the display format uses a timezone [^1] + [^2].

This avoids this kind of warnings:
```
./gui/qt/ui/open.h:205:27: warning: 'setTimeSpec' is deprecated: Use setTimeZone() instead [-Wdeprecated-declarations]
  205 |         stopTimeTimeEdit->setTimeSpec(Qt::LocalTime);
      |                           ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtWidgets/qdatetimeedit.h:134:5: note: 'setTimeSpec' has been explicitly marked deprecated here
  134 |     QT_DEPRECATED_VERSION_X_6_10("Use setTimeZone() instead")
      |     ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtCore/qtdeprecationmarkers.h:187:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_10'
  187 | # define QT_DEPRECATED_VERSION_X_6_10(text) QT_DEPRECATED_X(text)
      |                                             ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtCore/qtdeprecationmarkers.h:29:33: note: expanded from macro 'QT_DEPRECATED_X'
   29 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtCore/qcompilerdetection.h:1000:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
 1000 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^
```

[^1]: https://doc.qt.io/qt-6/qdatetimeedit.html#timeZone-prop
[^2]: https://doc.qt.io/qt-6/qtime.html#toString

(cherry picked from commit 3c07c3369a5313b2d79e95dec20c1f6a1041ad23) (edited)
edited:
- the file was moved in 4.0

- - - - -
b392e345 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QPalette::window() instead of QPalette::background()

It's deprecated and the replacement suggested in the doc [^1].

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated for all Qt5 but was not
marked as such yet.

[^1]: https://doc.qt.io/qt-5/qpainter.html#RenderHint-enum
[^2]: https://github.com/qt/qtbase/commit/4c522e0226da1bcc67a585130e3b2a976be128fd

- - - - -
71693edd by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QTreeWidgetItem::setExpanded() instead of QTreeWidget::InfoTree->setItemExpanded()

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated for "a long time".

[^1]: https://doc.qt.io/qt-5/qtreewidget-obsolete.html#setItemExpanded
[^2]: https://github.com/qt/qtbase/commit/76bb804405f424708fffec502788995ea91206b8

- - - - -
b811be7a by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QRandomGenerator instead of qrand()

It's deprecated since Qt 5.15 [^1], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated "in the documentation for a while".

The QRandomGenerator class was added in Qt 5.10 [^3] so we can't use it
before that.

[^1]: https://doc.qt.io/qt-5/qtglobal-obsolete.html#qrand
[^2]: https://github.com/qt/qtbase/commit/b3c0e9afa0041d4d45e47880732deda1dd1013b9
[^3]: https://doc.qt.io/qt-5/qrandomgenerator.html

- - - - -
55ad77f4 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: remove Qt::WA_MacBrushedMetal

It's deprecated in Qt 5.15 [^1], since 5.14 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated for "a log time".

[^1]: https://doc.qt.io/qt-5/qt.html#WidgetAttribute-enum
[^2]: https://github.com/qt/qtbase/commit/4f6eb43898aa14fef5f3a54966b340188271d85e

- - - - -
02de7fda by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QPixmapCache::find(QPixmap*) instead of QPixmapCache::find(QPixmap&)

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qpixmapcache-obsolete.html#find
[^2]: https://github.com/qt/qtbase/commit/daee9af969a04a2919a948ba1f5d314626925a9a

- - - - -
7ae9caeb by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QAbstractItemModel::index() instead of QModelIndex::child()

It's deprecated in Qt 5.15 [^1], since 5.8 [^2], and removed in Qt 6.
We use a replacement is suggested in [^1].

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qmodelindex-obsolete.html#child
[^2]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434

- - - - -
2d21d237 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QWheelEvent::angleDelta() instead of QWheelEvent::delta()

It's deprecated in Qt 5.15 [^1], since 5.0 [^2], and removed in Qt 6.
Although the deprecation was delayed to 5.15 because of a Qt3D issue [^3], that
we don't use.
We use a replacement is suggested in [^1].

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qwheelevent-obsolete.html#delta
[^2]: https://github.com/qt/qtbase/commit/7d29807296cb7ccc7f3459e106d74f93a321c493
[^3]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434

- - - - -
39742c0b by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use Qt::MiddleButton instead of Qt::MidButton

It's deprecated in Qt 5.15 [^1], since 4.7, and removed in Qt 6.

[^1]: https://github.com/qt/qtbase/commit/6ee6c52b57a0fbe9df00b30616afd90476ebdfd6

- - - - -
3e2e63bc by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QWheelEvent::angleDelta() instead of QWheelEvent::orientation()

It's deprecated in Qt 5.15 [^1], since 5.0 [^2], and removed in Qt 6.
Although the deprecation was delayed to 5.15 because of a Qt3D issue [^3], that
we don't use.
We use a replacement is suggested in [^1].

The commit log of [^2] even mentions its deprecated "since Qt4 times".

The code is slightly similar to what is found in qtWheelEventToVLCKey().
And borrows from 7498ac55db73dec778d97de88a758707964ebdc7.

[^1]: https://doc.qt.io/qt-5/qwheelevent-obsolete.html#orientation
[^2]: https://github.com/qt/qtbase/commit/7d29807296cb7ccc7f3459e106d74f93a321c493
[^3]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434

- - - - -
ec38184b by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QMouseEvent::globalPosition() instead of QMouseEvent::globalX/Y()

globalPosition() doesn't exist in Qt5 but globalPos() is the same thing [^2].

It's deprecated in Qt 5.15 [^1], since 5.0 [^3], and removed in Qt 6.
Although the deprecation was delayed to 5.15 because of a Qt3D issue [^4], that
we don't use.
We use a replacement is suggested in [^1].

The commit log of [^3] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-6.2/qmouseevent-obsolete.html#globalX
[^2]: https://doc.qt.io/qt-5/qmouseevent.html#globalPos
[^3]: https://github.com/qt/qtbase/commit/7d29807296cb7ccc7f3459e106d74f93a321c493
[^4]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434

- - - - -
0713a59a by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: merge MainInterfaceWin32::nativeEvent() and MainInterfaceWin32::winEvent()

No need for an extra method.

- - - - -
9d22c80f by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QAbstractNativeEventFilter

Instead of deprecated nativeEvent() method.

- - - - -
2e2cf957 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: remove unused showBuffering()

Removed in 4.0 in 92539782be07770312eeb6549b50a72c86879729.

- - - - -
acad49d6 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: disable statusBar() usage if Qt is not built with it

We can't remove the unused methods because we don't have the proper
check in moc.

- - - - -
1e28616a by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QEnterEvent with enterEvent() in Qt6

- - - - -
f82e97c9 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use screens() to get the list of screen

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop

- - - - -
855a2667 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use availableGeometry() from the primaryscreen

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop

- - - - -
fc2b1f6d by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use screenAt() to find the screen at a given position

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop

- - - - -
cf4f31f5 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: get the screens geometry using screens()

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

targetScreen() is always within the boundaries of QGuiApplication::screens().length()
or -1. And that's always the value used in controller.cpp.

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop

- - - - -
7b9c6bf3 by Steve Lhomme at 2025-02-20T14:23:56+00:00
qt: use QWheelEvent::DefaultDeltasPerStep instead of hardcoded values

The constant was added in [^1] in Qt 5.5 which is the minimum
we support.

[^1]: https://github.com/qt/qtbase/commit/aac6cda8041bc039efbffef5235a6f84bcae326a

- - - - -


30 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/components/controller.cpp
- modules/gui/qt/components/controller.hpp
- modules/gui/qt/components/extended_panels.hpp
- modules/gui/qt/components/info_panels.cpp
- modules/gui/qt/components/info_panels.hpp
- modules/gui/qt/components/interface_widgets.cpp
- modules/gui/qt/components/interface_widgets.hpp
- modules/gui/qt/components/open_panels.cpp
- modules/gui/qt/components/playlist/selector.cpp
- modules/gui/qt/components/playlist/selector.hpp
- modules/gui/qt/components/playlist/standardpanel.cpp
- modules/gui/qt/components/playlist/vlc_model.cpp
- modules/gui/qt/components/preferences_widgets.cpp
- modules/gui/qt/components/preferences_widgets.hpp
- modules/gui/qt/components/simple_preferences.cpp
- modules/gui/qt/dialogs/convert.cpp
- modules/gui/qt/dialogs/extensions.hpp
- modules/gui/qt/dialogs/gototime.hpp
- modules/gui/qt/dialogs/help.cpp
- modules/gui/qt/dialogs/mediainfo.hpp
- modules/gui/qt/dialogs/open.cpp
- modules/gui/qt/dialogs/openurl.hpp
- modules/gui/qt/dialogs/plugins.hpp
- modules/gui/qt/dialogs/toolbar.cpp
- modules/gui/qt/dialogs/vlm.hpp
- modules/gui/qt/main_interface.cpp
- modules/gui/qt/main_interface.hpp
- modules/gui/qt/main_interface_win32.cpp
- modules/gui/qt/main_interface_win32.hpp


The diff was not included because it is too large.


View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a031af8522d7cc1ad03eb7985e4ca60fd031eabc...7b9c6bf309d9da4c22b3605608893a0af9b73ce2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a031af8522d7cc1ad03eb7985e4ca60fd031eabc...7b9c6bf309d9da4c22b3605608893a0af9b73ce2
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