On Tue, Jun 12, 2007 at 11:28:37PM +0200, Edwin Leuven wrote:

> >> +// FIXME: this can go when we move to Qt 4.3
> >> +#define QT_VERSION_CHECK(major, minor, patch) 
> >> ((major<<16)|(minor<<8)|(patch))
> >> +
> >> +#if QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
> > 
> > Wouldn't that give a 'redefine macro' ith 4.3?
> > 
> > Why not simply using 0x40200?
> 
> because my compiler doesn't like it?

Erm... seems that the Qt4.1 moc wants 0x040200 and don't understand
QT_VERSION_CHECK(4, 2, 0). I have to use the attached patch in order
to avoid the following compile error:

g++ -DHAVE_CONFIG_H -I. -I../../../../src/frontends/qt4 -I../../../src 
-DQT_CLEAN_NAMESPACE -DQT_GENUINE_STR -DQT_NO_STL -DQT_NO_KEYWORDS 
-DQ_CYGWIN_WIN -I../../../../src -I../../../../src/frontends 
-I../../../../images -I/usr/local/qt4-cygwin/include 
-I/usr/local/qt4-cygwin/include/QtCore -I/usr/local/qt4-cygwin/include/QtGui 
-I../../../../boost -I../../../../src/frontends/controllers -Wno-uninitialized 
-O2 -MT IconPalette.lo -MD -MP -MF .deps/IconPalette.Tpo -c 
../../../../src/frontends/qt4/IconPalette.cpp -o IconPalette.o
In file included from ../../../../src/frontends/qt4/IconPalette.cpp:269:
./IconPalette_moc.cpp:46: error: `QWidgetAction' has not been declared
./IconPalette_moc.cpp: In member function `virtual void* 
lyx::frontend::IconPalette::qt_metacast(const char*)':
./IconPalette_moc.cpp:60: error: `QWidgetAction' has not been declared
./IconPalette_moc.cpp: In member function `virtual int 
lyx::frontend::IconPalette::qt_metacall(QMetaObject::Call, int, void**)':
./IconPalette_moc.cpp:65: error: `QWidgetAction' has not been declared
./IconPalette_moc.cpp:70: error: `enabled' undeclared (first use this function)
./IconPalette_moc.cpp:70: error: (Each undeclared identifier is reported only 
once for each function it appears in.)
./IconPalette_moc.cpp:71: error: `iconSizeChanged' undeclared (first use this 
function)
./IconPalette_moc.cpp:73: error: `setIconSize' undeclared (first use this 
function)
./IconPalette_moc.cpp: At global scope:
./IconPalette_moc.cpp:82: error: no `void 
lyx::frontend::IconPalette::enabled(bool)' member function declared in class 
`lyx::frontend::IconPalette'
./IconPalette_moc.cpp:89: error: no `void 
lyx::frontend::IconPalette::iconSizeChanged(const QSize&)' member function 
declared in class `lyx::frontend::IconPalette'
make[7]: *** [IconPalette.lo] Error 1

-- 
Enrico
Index: src/frontends/qt4/IconPalette.h
===================================================================
--- src/frontends/qt4/IconPalette.h     (revision 18815)
+++ src/frontends/qt4/IconPalette.h     (working copy)
@@ -20,7 +20,7 @@
 // FIXME: this can go when we move to Qt 4.3
 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
 
-#if QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
+#if QT_VERSION >= 0x040200
 #include <QWidgetAction>
 #endif
 
@@ -30,7 +30,7 @@ namespace frontend {
 /**
  * For holding an arbitrary set of icons.
  */
-#if QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
+#if QT_VERSION >= 0x040200
 
 class IconPalette : public QWidgetAction {
        Q_OBJECT

Reply via email to