[vlc-devel] commit: Introduce setLayoutMargins for layout margins difference between Qt4. 2 and Qt4.3 (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sun Jun 15 00:44:57 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Jun 14 15:25:24 2008 -0700| [e43f1917217e06cceb4ecac4fc4ecf86f6c8a90c]
Introduce setLayoutMargins for layout margins difference between Qt4.2 and Qt4.3
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e43f1917217e06cceb4ecac4fc4ecf86f6c8a90c
---
modules/gui/qt4/components/interface_widgets.cpp | 12 ++----------
modules/gui/qt4/components/simple_preferences.cpp | 5 +++--
modules/gui/qt4/dialogs/preferences.cpp | 6 +-----
modules/gui/qt4/qt4.hpp | 12 +++++++++---
4 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 6c2abac..a1eba64 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -388,11 +388,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
controlLayout = new QGridLayout( );
controlLayout->setSpacing( 0 );
-#if QT43
- controlLayout->setContentsMargins( 9, 6, 9, 6 );
-#else
- controlLayout->setMargin( 6 );
-#endif
+ controlLayout->setLayoutMargins( 9, 6, 9, 6, 6 );
if( !b_fsCreation )
setLayout( controlLayout );
@@ -827,11 +823,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
QGridLayout *fsLayout = new QGridLayout( this );
controlLayout->setSpacing( 0 );
- #if QT43
- controlLayout->setContentsMargins( 5, 1, 5, 1 );
- #else
- controlLayout->setMargin( 5 );
- #endif
+ controlLayout->setLayoutMargins( 5, 1, 5, 1, 5 );
fsLayout->addWidget( slowerButton, 0, 0 );
slider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum);
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 25536b4..761daef 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -1,7 +1,7 @@
/*****************************************************************************
* simple_preferences.cpp : "Simple preferences"
****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub at videolan.org>
@@ -22,6 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@@ -297,7 +298,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONNECT( ui.outputModule, currentIndexChanged( int ),
this, updateAudioOptions( int ) );
- // File exists everywhere
+ /* File output exists on all platforms */
CONFIG_GENERIC_FILE( "audiofile-file" , File , ui.fileLabel,
ui.fileName, ui.fileBrowseButton );
diff --git a/modules/gui/qt4/dialogs/preferences.cpp b/modules/gui/qt4/dialogs/preferences.cpp
index 85ccc55..09a873f 100644
--- a/modules/gui/qt4/dialogs/preferences.cpp
+++ b/modules/gui/qt4/dialogs/preferences.cpp
@@ -103,11 +103,7 @@ PrefsDialog::PrefsDialog( QWidget *parent, intf_thread_t *_p_intf )
/* Margins */
tree_panel_l->setMargin( 1 );
-#if HAS_QT43
- main_panel_l->setContentsMargins( 6, 0, 0, 3 );
-#else
- main_panel_l->setMargin( 3 );
-#endif
+ main_panel_l->setLayoutMargins( 6, 0, 0, 3, 3 );
for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 181d285..47e69fb 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -100,10 +100,16 @@ struct intf_sys_t
#define TOGGLEV( x ) { if( x->isVisible() ) x->hide(); \
else x->show(); }
+#if QT43
+ #define setLayoutMargins( a, b, c, d, e) setContentsMargins( a, b, c, d )
+#else
+ #define setLayoutMargins( a, b, c, d, e) setMargin( e )
+#endif
+
enum {
-DialogEventType = 0,
-IMEventType = 100,
-PLEventType = 200
+ DialogEventType = 0,
+ IMEventType = 100,
+ PLEventType = 200
};
static int DialogEvent_Type = QEvent::User + DialogEventType + 1;
More information about the vlc-devel
mailing list