On Tue, Jun 07, 2011 at 11:52:02AM +0200, Jean-Marc Lasgouttes wrote:
> Le 07/06/2011 09:01, Enrico Forestieri a écrit :
> >The moc doesn't have a definition of QT_VERSION, so the check
> >"#if QT_VERSION>= 0x040600" fails and you always get the "#else"
> >clause.
> 
> Here is my next try. Something similar will have to be done for
> cmake and scons.

I think this is not going to work. From what I see looking at qt4.m4,
QT4_VERSION contains the string version, i.e., 4.7.3 and not 0x040703.
So, either we extract the definition of QT_VERSION (rather than
QT_VERSION_STR) from qglobal.h or manipulate QT4_VERSION in order
to produce the right format.


> Index: src/frontends/qt4/Makefile.am
> ===================================================================
> --- src/frontends/qt4/Makefile.am     (révision 38972)
> +++ src/frontends/qt4/Makefile.am     (copie de travail)
> @@ -18,7 +18,7 @@
>  
>  # The moc_%.cpp pattern must match the filter in ../../../po/Rules-lyx
>  moc_%.cpp: %.h
> -     $(AM_V_GEN)$(MOC4) -o $@ $<
> +     $(AM_V_GEN)$(MOC4) -DQT_VERSION=$(QT4_VERSION) -o $@ $<
>  
>  Resources.qrc: Makefile
>       $(AM_V_GEN)echo "<!DOCTYPE RCC><RCC version='1.0'><qresource>" > $@ ; \
> Index: src/frontends/qt4/FancyLineEdit.h
> ===================================================================
> --- src/frontends/qt4/FancyLineEdit.h (révision 38972)
> +++ src/frontends/qt4/FancyLineEdit.h (copie de travail)
> @@ -22,6 +22,7 @@
>  
>  class FancyLineEditPrivate;
>  
> +#if QT_VERSION >= 0x040600
>  class IconButton: public QAbstractButton
>  {
>       Q_OBJECT
> @@ -44,8 +45,8 @@
>      bool m_autoHide;
>      QPixmap m_pixmap;
>  };
> +#endif
>  
> -
>  /* A line edit with an embedded pixmap on one side that is connected to
>   * a menu. Additionally, it can display a grayed hintText (like "Type Here 
> to")
>   * when not focused and empty. When connecting to the changed signals and


-- 
Enrico

Reply via email to