[vlc-commits] [Git][videolan/vlc][master] 2 commits: doc: QtPlayer: make it compile with Qt 6
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Mar 7 12:01:02 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
f4a4f9bc by Johannes Kauffmann at 2025-03-07T10:47:37+00:00
doc: QtPlayer: make it compile with Qt 6
- - - - -
07a9e3c8 by Johannes Kauffmann at 2025-03-07T10:47:37+00:00
doc: QtGL: make it compile with Qt 6
- - - - -
3 changed files:
- doc/libvlc/QtGL/QtGl.pro
- doc/libvlc/QtGL/main.cpp
- doc/libvlc/QtPlayer/player.cpp
Changes:
=====================================
doc/libvlc/QtGL/QtGl.pro
=====================================
@@ -4,6 +4,7 @@ TARGET = qtglvlc
CONFIG += c++14 link_pkgconfig force_debug_info
PKGCONFIG = libvlc
QT += widgets
+greaterThan(QT_MAJOR_VERSION, 5): QT += openglwidgets
SOURCES += main.cpp qtvlcwidget.cpp
HEADERS += qtvlcwidget.h
=====================================
doc/libvlc/QtGL/main.cpp
=====================================
@@ -1,5 +1,5 @@
#include <QApplication>
-#include <QDesktopWidget>
+#include <QScreen>
#include <QSurfaceFormat>
#include <QMainWindow>
@@ -30,8 +30,8 @@ int main(int argc, char *argv[])
mainWindow.setCentralWidget(glWidget);
mainWindow.resize(mainWindow.sizeHint());
- int desktopArea = QApplication::desktop()->width() *
- QApplication::desktop()->height();
+ QSize size = QGuiApplication::primaryScreen()->size();
+ int desktopArea = size.width() * size.height();
int widgetArea = mainWindow.width() * mainWindow.height();
if (((float)widgetArea / (float)desktopArea) < 0.75f)
mainWindow.show();
=====================================
doc/libvlc/QtPlayer/player.cpp
=====================================
@@ -105,7 +105,7 @@ void Mwindow::initUI() {
/* Put all in layouts */
QHBoxLayout *layout = new QHBoxLayout;
- layout->setMargin(0);
+ layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(playBut);
layout->addWidget(stopBut);
layout->addWidget(muteBut);
@@ -113,7 +113,7 @@ void Mwindow::initUI() {
layout->addWidget(volumeSlider);
QVBoxLayout *layout2 = new QVBoxLayout;
- layout2->setMargin(0);
+ layout2->setContentsMargins(0, 0, 0, 0);
layout2->addWidget(videoWidget);
layout2->addWidget(slider);
layout2->addLayout(layout);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eff97b6586c5099c1ca834f15b36f77490cdeeec...07a9e3c865d0c165c21099a84dde9fad0d996739
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/eff97b6586c5099c1ca834f15b36f77490cdeeec...07a9e3c865d0c165c21099a84dde9fad0d996739
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