[vlc-devel] [PATCH 05/15] qt: remove unnecessary Qt 5.6.0 checks

Fatih Uzunoglu fuzun54 at outlook.com
Thu Feb 11 21:23:33 UTC 2021


---
 modules/gui/qt/dialogs/extended/extended_panels.cpp      | 4 ----
 .../gui/qt/dialogs/preferences/simple_preferences.cpp    | 4 ----
 modules/gui/qt/qt.cpp                                    | 5 -----
 modules/gui/qt/qt.hpp                                    | 1 -
 modules/gui/qt/util/imagehelper.cpp                      | 9 +--------
 modules/gui/qt/widgets/native/interface_widgets.cpp      | 9 ---------
 6 files changed, 1 insertion(+), 31 deletions(-)

diff --git a/modules/gui/qt/dialogs/extended/extended_panels.cpp b/modules/gui/qt/dialogs/extended/extended_panels.cpp
index 099921cdee..9b0c111986 100644
--- a/modules/gui/qt/dialogs/extended/extended_panels.cpp
+++ b/modules/gui/qt/dialogs/extended/extended_panels.cpp
@@ -1135,12 +1135,8 @@ void Equalizer::build()
     for( i = 0 ; i < NB_PRESETS ; i ++ )
     {
         QGraphicsScene scene;
-#if HAS_QT56
         qreal f_ratio = QApplication::primaryScreen()->devicePixelRatio();
         QPixmap icon( 40 * f_ratio, 40 * f_ratio );
-#else
-        QPixmap icon( 40, 40 );
-#endif
         icon.fill( Qt::transparent );
         QPainter painter( &icon );
         for ( int j = 0; j < eqz_preset_10b[i].i_band; j++ )
diff --git a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
index c9b90778a6..26a9ead2a2 100644
--- a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
+++ b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
@@ -208,11 +208,7 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent ) :
     CONNECT( mapper, mapped(int), this, switchPanel(int) );
 
     QPixmap scaled;
-#if HAS_QT56
     qreal dpr = devicePixelRatioF();
-#else
-    qreal dpr = devicePixelRatio();
-#endif
 
 #define ADD_CATEGORY( button, label, ltooltip, icon, numb )                 \
     QToolButton * button = new QToolButton( this );                         \
diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index a481489ba5..6bb0eefdb7 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -90,9 +90,6 @@ extern "C" char **environ;
    Q_IMPORT_PLUGIN(QtQmlPlugin)
   #endif
 
-  #if !HAS_QT56
-   Q_IMPORT_PLUGIN(AccessibleFactory)
-  #endif
   #ifdef _WIN32
    Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin)
    Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
@@ -597,10 +594,8 @@ static void *Thread( void *obj )
 
     p_intf->p_sys->p_compositor = vlc::Compositor::createCompositor(p_intf);
 
-#if HAS_QT56
     QApplication::setAttribute( Qt::AA_EnableHighDpiScaling );
     QApplication::setAttribute( Qt::AA_UseHighDpiPixmaps );
-#endif
 
 #if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
     QApplication::setHighDpiScaleFactorRoundingPolicy( Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor );
diff --git a/modules/gui/qt/qt.hpp b/modules/gui/qt/qt.hpp
index c8a2241782..6306a0cd79 100644
--- a/modules/gui/qt/qt.hpp
+++ b/modules/gui/qt/qt.hpp
@@ -47,7 +47,6 @@
 # error Update your Qt version to at least 5.9.0
 #endif
 
-#define HAS_QT56 ( QT_VERSION >= 0x050600 )
 #define HAS_QT510 ( QT_VERSION >= 0x051000 )
 
 enum {
diff --git a/modules/gui/qt/util/imagehelper.cpp b/modules/gui/qt/util/imagehelper.cpp
index fe588e6388..144f9c3f3d 100644
--- a/modules/gui/qt/util/imagehelper.cpp
+++ b/modules/gui/qt/util/imagehelper.cpp
@@ -34,13 +34,9 @@
 
 QPixmap ImageHelper::loadSvgToPixmap( const QString &path, qint32 i_width, qint32 i_height )
 {
-#if HAS_QT56
     qreal ratio = QApplication::primaryScreen()->devicePixelRatio();
-
     QPixmap pixmap( QSize( i_width, i_height ) * ratio );
-#else
-    QPixmap pixmap( QSize( i_width, i_height ) );
-#endif
+
 
     pixmap.fill( Qt::transparent );
 
@@ -51,9 +47,6 @@ QPixmap ImageHelper::loadSvgToPixmap( const QString &path, qint32 i_width, qint3
     renderer.render( &painter );
     painter.end();
 
-#if HAS_QT56
     pixmap.setDevicePixelRatio( ratio );
-#endif
-
     return pixmap;
 }
diff --git a/modules/gui/qt/widgets/native/interface_widgets.cpp b/modules/gui/qt/widgets/native/interface_widgets.cpp
index 39d6381dd5..80f3dc8fe1 100644
--- a/modules/gui/qt/widgets/native/interface_widgets.cpp
+++ b/modules/gui/qt/widgets/native/interface_widgets.cpp
@@ -220,13 +220,8 @@ QSize VideoWidget::physicalSize() const
 
     QSize current_size = size();
 
-#   if HAS_QT56
     /* Android-like scaling */
     current_size *= devicePixelRatioF();
-#   else
-    /* OSX-like scaling */
-    current_size *= devicePixelRatio();
-#   endif
 
     return current_size;
 }
@@ -361,11 +356,7 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event )
     {
         QPointF current_pos = event->localPos();
 
-#if HAS_QT56
         current_pos *= devicePixelRatioF();
-#else
-        current_pos *= devicePixelRatio();
-#endif
         vout_window_ReportMouseMoved( p_window, current_pos.x(), current_pos.y() );
         showCursor();
         event->accept();
-- 
2.27.0



More information about the vlc-devel mailing list