Hi

Matthias Stiller wrote:
On Tuesday 03 August 2004 10:29, Carsten Neumann (D. Stricker) wrote:
 after looking at that code of mine, I agree, can't imagine another

reason to write a whole class if not to work around a Qt-bug ;). Anyway,
in recent version that workaround now seems to break :((
Now the interesting question is what code to use ? Do we have a
recommended version ?


Another possible solution would be to work around it with a qtversion ifdef. I am pretty confident that qt already has something like this. It is not the best solution, but things like this happen from time to time.

IMHO, that's the best,
there is a #define QT_VERSION 0x030302 in $(QTDIR)/include/qglobal.h
that can be used like this #if (QT_VERSION >= 0x030302) for example.

I've attached my previous diff with this kind of code.

I've parsed the changelog from the trolltech site but wasn't able to track when the workaround wasn't needed anymore... So I used 3.3.2 as a minimum value for this patch

HTH
Mathieu
? .OSGQFieldContainerView_qt.cpp.swp
cvs diff: Diffing .
Index: OSGQFieldContainerView_qt.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/WindowSystem/QT/OSGQFieldContainerView_qt.cpp,v
retrieving revision 1.1
diff -u -r1.1 OSGQFieldContainerView_qt.cpp
--- OSGQFieldContainerView_qt.cpp	20 Jun 2003 16:56:15 -0000	1.1
+++ OSGQFieldContainerView_qt.cpp	3 Aug 2004 12:52:49 -0000
@@ -230,8 +230,10 @@
             QSFieldView *pSFView = new QSFieldView(pFC, i+1, uiAspect, this);
 
             _pTable->setCellWidget(i, ValueColumn, pSFView      );
+#if (QT_VERSION < 0x030302)
             _pTable->setItem      (i, ValueColumn, 
                                    new QWidgetTableItem(_pTable));
+#endif
             
             connect(pSFView, 
                     SIGNAL(clicked        (FieldContainerPtr, UInt32, 
@@ -253,9 +255,10 @@
             QMFieldView *pMFView = new QMFieldView(pFC, i+1, uiAspect, this);
             
             _pTable->setCellWidget(i, ValueColumn, pMFView      );
+#if (QT_VERSION < 0x030302)
             _pTable->setItem      (i, ValueColumn,
                                    new QWidgetTableItem(_pTable));
-
+#endif
              connect(pMFView, 
                      SIGNAL(clicked        (FieldContainerPtr, UInt32, 
                                             UInt32,            ButtonState)),

Reply via email to