Here a patch which fixes a crash on startup
(new since 4.1.3, msvc/debug) and removes
the obsolete Qt3 functions/symbols.
And the has Lords answered Lgb's (?) prayers!
-// Dear Lord, deliver us from Evil, aka the Qt headers
-// Qt defines a macro 'signals' that clashes with a boost namespace.
-// All is well if the namespace is visible first.
-#include <boost/signal.hpp> // FIXME: Is this needed? (Lgb)
His answer:
qt4/src/corelib/kernel/qobjectdefs.h:
# if defined(QT_NO_KEYWORDS)
# define QT_NO_EMIT
# else
# define slots
# define signals protected
# endif
# define Q_SLOTS
# define Q_SIGNALS protected
Peter
Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C (revision 14023)
+++ frontends/qt4/lyx_gui.C (working copy)
@@ -9,6 +9,8 @@
* Full author contact details are available in file CREDITS.
*/
+#undef QT3_SUPPORT
+
#include <config.h>
#include "lyx_gui.h"
@@ -33,13 +35,6 @@
#include "support/package.h"
#include "debug.h"
-// Dear Lord, deliver us from Evil, aka the Qt headers
-// Qt defines a macro 'signals' that clashes with a boost namespace.
-// All is well if the namespace is visible first.
-#include <boost/signal.hpp> // FIXME: Is this needed? (Lgb)
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-
#include "QtView.h"
#include "lcolorcache.h"
#include "qfont_loader.h"
@@ -55,6 +50,8 @@
#include <QEventLoop>
#include <QTranslator>
#include <QTextCodec>
+#include <QLocale>
+#include <QLibraryInfo>
using lyx::support::ltrim;
using lyx::support::package;
@@ -188,19 +185,23 @@
// install translation file for Qt built-in dialogs
// These are only installed since Qt 3.2.x
- static QTranslator qt_trans(0);
- if (qt_trans.load(QString("qt_") + QTextCodec::locale(),
- qInstallPathTranslations())) {
+ static QTranslator qt_trans;
+ QString language_name = QString("qt_") + QLocale::system().name();
+ language_name.truncate(5);
+ if (qt_trans.load(language_name,
+ QLibraryInfo::location(QLibraryInfo::TranslationsPath))
+ )
+ {
qApp->installTranslator(&qt_trans);
// even if the language calls for RtL, don't do that
- qApp->setReverseLayout(false);
+ qApp->setLayoutDirection(Qt::LeftToRight);
lyxerr[Debug::GUI]
<< "Successfully installed Qt translations for locale "
- << QTextCodec::locale() << std::endl;
+ << language_name.toStdString().c_str() << std::endl;
} else
lyxerr[Debug::GUI]
<< "Could not find Qt translations for locale "
- << QTextCodec::locale() << std::endl;
+ << language_name.toStdString().c_str() << std::endl;
/*#ifdef Q_WS_MACX
// These translations are meant to break Qt/Mac menu merging
@@ -282,9 +283,7 @@
// During screen update/ redraw, this method is disabled to
// prevent keyboard events being handed to the LyX core, where
// they could cause re-entrant calls to screen update.
-#if QT_VERSION >= 0x030100
- qApp->processEvents(QEventLoop::ExcludeUserInput);
-#endif
+ qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
}