[qet] [723] Correction du bug #24 : Qt 4.5 apportant la fonctionnalite " onglets deplacables", il est necessaire de differencier les methodes appelees entre Qt 4. 4 et Qt 4.5.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 723
Author:   xavier
Date:     2009-07-30 22:20:17 +0200 (Thu, 30 Jul 2009)

Log Message:
-----------
Correction du bug #24 : Qt 4.5 apportant la fonctionnalite "onglets deplacables", il est necessaire de differencier les methodes appelees entre Qt 4.4 et Qt 4.5.

Modified Paths:
--------------
    trunk/sources/projectview.cpp
    trunk/sources/qettabbar.cpp
    trunk/sources/qettabbar.h
    trunk/sources/qettabwidget.cpp
    trunk/sources/qettabwidget.h


Modified: trunk/sources/projectview.cpp
===================================================================
--- trunk/sources/projectview.cpp	2009-07-13 00:59:46 UTC (rev 722)
+++ trunk/sources/projectview.cpp	2009-07-30 20:20:17 UTC (rev 723)
@@ -50,7 +50,7 @@
 	fallback_widget_layout_ -> addWidget(label_widget);
 	
 	tabs_ = new QETTabWidget();
-	tabs_ -> setTabsMovable(true);
+	tabs_ -> setMovable(true);
 	connect(tabs_, SIGNAL(currentChanged(int)),   this, SLOT(tabChanged(int)));
 	connect(tabs_, SIGNAL(tabDoubleClicked(int)), this, SLOT(tabDoubleClicked(int)));
 	connect(tabs_, SIGNAL(firstTabInserted()),    this, SLOT(firstTabInserted()));

Modified: trunk/sources/qettabbar.cpp
===================================================================
--- trunk/sources/qettabbar.cpp	2009-07-13 00:59:46 UTC (rev 722)
+++ trunk/sources/qettabbar.cpp	2009-07-30 20:20:17 UTC (rev 723)
@@ -25,6 +25,7 @@
 QETTabBar::QETTabBar(QWidget *parent) :
 	QTabBar(parent),
 	no_more_tabs_(true),
+	movable_tabs_(false),
 	moved_tab_(-1)
 {
 }
@@ -68,15 +69,23 @@
 /**
 	@param movable true pour que les onglets soient deplacables, false sinon
 */
-void QETTabBar::setTabsMovable(bool movable) {
+void QETTabBar::setMovable(bool movable) {
+#if QT_VERSION < 0x040500
 	movable_tabs_ = movable;
+#else
+	QTabBar::setMovable(movable);
+#endif
 }
 
 /**
 	@return true si les onglets sont deplacables, false sinon
 */
-bool QETTabBar::tabsMovable() const {
+bool QETTabBar::isMovable() const {
+#if QT_VERSION < 0x040500
 	return(movable_tabs_);
+#else
+	return(QTabBar::isMovable());
+#endif
 }
 
 /**

Modified: trunk/sources/qettabbar.h
===================================================================
--- trunk/sources/qettabbar.h	2009-07-13 00:59:46 UTC (rev 722)
+++ trunk/sources/qettabbar.h	2009-07-30 20:20:17 UTC (rev 723)
@@ -1,5 +1,4 @@
-/*
-	Copyright 2006-2009 Xavier Guerrin
+/*	Copyright 2006-2009 Xavier Guerrin
 	This file is part of QElectroTech.
 	
 	QElectroTech is free software: you can redistribute it and/or modify
@@ -41,8 +40,8 @@
 	public:
 	void activateNextTab();
 	void activatePreviousTab();
-	void setTabsMovable(bool);
-	bool tabsMovable() const;
+	void setMovable(bool);
+	bool isMovable() const;
 	bool isVertical() const;
 	bool isHorizontal() const;
 	
@@ -58,7 +57,9 @@
 	signals:
 	void lastTabRemoved();
 	void firstTabInserted();
+#if QT_VERSION < 0x040500
 	void tabMoved(int, int);
+#endif
 	void tabDoubleClicked(int);
 	
 	private:

Modified: trunk/sources/qettabwidget.cpp
===================================================================
--- trunk/sources/qettabwidget.cpp	2009-07-13 00:59:46 UTC (rev 722)
+++ trunk/sources/qettabwidget.cpp	2009-07-30 20:20:17 UTC (rev 723)
@@ -47,15 +47,23 @@
 /**
 	@param movable true pour que les onglets soient deplacables, false sinon
 */
-void QETTabWidget::setTabsMovable(bool movable) {
+void QETTabWidget::setMovable(bool movable) {
+#if QT_VERSION < 0x040500
 	tab_bar_ -> setTabsMovable(movable);
+#else
+	QTabWidget::setMovable(movable);
+#endif
 }
 
 /**
 	@return true si les onglets sont deplacables, false sinon
 */
-bool QETTabWidget::tabsMovable() {
+bool QETTabWidget::isMovable() const {
+#if QT_VERSION < 0x040500
 	return(tab_bar_ -> tabsMovable());
+#else
+	return(QTabWidget::isMovable());
+#endif
 }
 
 /**

Modified: trunk/sources/qettabwidget.h
===================================================================
--- trunk/sources/qettabwidget.h	2009-07-13 00:59:46 UTC (rev 722)
+++ trunk/sources/qettabwidget.h	2009-07-30 20:20:17 UTC (rev 723)
@@ -38,8 +38,8 @@
 	
 	// methodes
 	public:
-	void setTabsMovable(bool);
-	bool tabsMovable();
+	void setMovable(bool);
+	bool isMovable() const;
 	
 	protected:
 	void wheelEvent(QWheelEvent *);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/