From f79228b71b05d28b83014f262bc47e3fe9557a14 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 11 Aug 2009 12:42:43 +0300 Subject: RVCT didn't like a test bool variable exported directly from QtGui, causing applications to panic with KERN-EXEC 3. Fixed by providing accessor for the bool in question instead of exporting it directly. Note: Unknown why exactly this panic occurs, as exporting bools works just fine when tested with small test executable + dll. Something in QtGui causes this to fail; I suspect it might be the massive code segment size and relocation of the data segment that is contributing to this problem. RevBy: Jason Barron --- src/gui/text/qfontdatabase.cpp | 9 +++++++-- tests/auto/qtextedit/tst_qtextedit.cpp | 6 +++--- tests/auto/qtextlayout/tst_qtextlayout.cpp | 6 ++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index d33cdf0..cba41da 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -85,7 +85,12 @@ QT_BEGIN_NAMESPACE extern int qt_defaultDpiY(); // in qfont.cpp -Q_GUI_EXPORT bool qt_enable_test_font = false; +bool qt_enable_test_font = false; + +Q_AUTOTEST_EXPORT void qt_setQtEnableTestFont(bool value) +{ + qt_enable_test_font = value; +} static int getFontWeight(const QString &weightString) { @@ -2588,7 +2593,7 @@ QStringList QFontDatabase::applicationFontFamilies(int id) \sa removeApplicationFont(), addApplicationFont(), addApplicationFontFromData() */ -/*! +/*! \fn bool QFontDatabase::supportsThreadedFontRendering() \since 4.4 diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 392af5e..100eecd 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -1917,7 +1917,7 @@ void tst_QTextEdit::setText() } QT_BEGIN_NAMESPACE -extern Q_GUI_EXPORT bool qt_enable_test_font; +extern void qt_setQtEnableTestFont(bool value); QT_END_NAMESPACE void tst_QTextEdit::fullWidthSelection_data() @@ -1964,7 +1964,7 @@ void tst_QTextEdit::fullWidthSelection() cursor.setBlockFormat(bf1); // use the test font so we always know where stuff will end up. - qt_enable_test_font = true; + qt_setQtEnableTestFont(true); QFont testFont; testFont.setFamily("__Qt__Box__Engine__"); testFont.setPixelSize(12); @@ -2012,7 +2012,7 @@ void tst_QTextEdit::fullWidthSelection2() QTextCursor cursor = widget.textCursor(); // use the test font so we always know where stuff will end up. - qt_enable_test_font = true; + qt_setQtEnableTestFont(true); QFont testFont; testFont.setFamily("__Qt__Box__Engine__"); testFont.setPixelSize(12); diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index e948cf2..d76f387 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -57,8 +57,6 @@ #define TESTFONT_SIZE 12 - - //TESTED_CLASS= //TESTED_FILES= @@ -164,12 +162,12 @@ void tst_QTextLayout::getSetCheck() } QT_BEGIN_NAMESPACE -extern Q_GUI_EXPORT bool qt_enable_test_font; +extern void qt_setQtEnableTestFont(bool value); QT_END_NAMESPACE tst_QTextLayout::tst_QTextLayout() { - qt_enable_test_font = true; + qt_setQtEnableTestFont(true); } tst_QTextLayout::~tst_QTextLayout() -- cgit v0.12