From c29440131a7ee86cdf26260b672f0734ad059611 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 8 Jun 2011 19:45:52 +0000 Subject: [PATCH] Compile fix for Qt 4.5 and earlier. The other build systems should update the moc invocation to add the proper define for QT_VERSION. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38995 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/FancyLineEdit.h | 3 ++- src/frontends/qt4/Makefile.am | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/FancyLineEdit.h b/src/frontends/qt4/FancyLineEdit.h index ec472eed8c..89ef45b4ab 100644 --- a/src/frontends/qt4/FancyLineEdit.h +++ b/src/frontends/qt4/FancyLineEdit.h @@ -22,6 +22,7 @@ namespace frontend { class FancyLineEditPrivate; +#if QT_VERSION >= 0x040600 class IconButton: public QAbstractButton { Q_OBJECT @@ -44,7 +45,7 @@ private: 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") diff --git a/src/frontends/qt4/Makefile.am b/src/frontends/qt4/Makefile.am index e112916270..4923ba3d85 100644 --- a/src/frontends/qt4/Makefile.am +++ b/src/frontends/qt4/Makefile.am @@ -16,9 +16,12 @@ ui_%.h: ui/%.ui MOCEDFILES = $(MOCHEADER:%.h=moc_%.cpp) +QT_VERSION = $(shell IFS=.; set -- `echo $(QT4_VERSION)`; \ + echo 0x0`echo "obase=16; $$1*65536+$$2*256+$$3" | bc`) + # 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=$(QT_VERSION) -o $@ $< Resources.qrc: Makefile $(AM_V_GEN)echo "" > $@ ; \ -- 2.39.5