From 161f51a1167ea95414b88195f61753047ca4a708 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 28 Jan 2009 10:36:53 -0800 Subject: Fix some keyboard issues Without this patch Alt-modifiers doesn't work. The extra mappings are needed for certain keys to work right on atleast one known DirectFB implementation/hardware combination. Reviewed-by: Donald --- .../gfxdrivers/directfb/qdirectfbkeyboard.cpp | 130 ++++++++++++++++++--- 1 file changed, 112 insertions(+), 18 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp index cd19f69..368b9f9 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp @@ -173,6 +173,22 @@ void QDirectFBKeyboardHandlerPrivate::readKeyboardData() Qt::KeyboardModifiers modifiers = Qt::NoModifier; + // Not implemented: + // if (input.modifiers & DIMM_SUPER) + // if (input.modifiers & DIMM_HYPER) + + if (!(input.flags & DIEF_KEYSYMBOL) || + !(input.flags & DIEF_KEYID) || + !(input.type & (DIET_KEYPRESS|DIET_KEYRELEASE))) + { + static bool first = true; + if (first) { + qWarning("QDirectFBKeyboardHandler - Getting unexpected non-keyboard related events"); + first = false; + } + break; + } + if (input.flags & DIEF_MODIFIERS) { if (input.modifiers & DIMM_SHIFT) modifiers |= Qt::ShiftModifier; @@ -185,31 +201,15 @@ void QDirectFBKeyboardHandlerPrivate::readKeyboardData() if (input.modifiers & DIMM_META) modifiers |= Qt::MetaModifier; } - // Not implemented: - // if (input.modifiers & DIMM_SUPER) - // if (input.modifiers & DIMM_HYPER) - if ( !(input.flags & DIEF_KEYSYMBOL) || - !(input.flags & DIEF_KEYID) || - !(input.type & (DIET_KEYPRESS | DIET_KEYRELEASE)) ) - { - static int warningCount = 0; - if (!warningCount) { - qWarning("QDirectFBKeyboardHandler - Getting unexpected non-keyboard related events"); - warningCount = 100; - } - else - warningCount--; - break; - } - bool press = input.type & DIET_KEYPRESS; + const bool press = input.type & DIET_KEYPRESS; DFBInputDeviceKeySymbol symbol = input.key_symbol; int unicode = -1; int keycode = 0; keycode = keymap()->value(symbol); - if (keycode == 0 && DFB_KEY_TYPE(symbol) == DIKT_UNICODE) + if (DFB_KEY_TYPE(symbol) == DIKT_UNICODE) unicode = symbol; if (unicode != -1 || keycode != 0) { @@ -314,6 +314,100 @@ KeyMap::KeyMap() insert(DIKS_DEAD_SEMIVOICED_SOUND , Qt::Key_Dead_Semivoiced_Sound); insert(DIKS_DEAD_TILDE , Qt::Key_Dead_Tilde); insert(DIKS_DEAD_VOICED_SOUND , Qt::Key_Dead_Voiced_Sound); + insert(DIKS_SPACE , Qt::Key_Space); + insert(DIKS_EXCLAMATION_MARK , Qt::Key_Exclam); + insert(DIKS_QUOTATION , Qt::Key_QuoteDbl); + insert(DIKS_NUMBER_SIGN , Qt::Key_NumberSign); + insert(DIKS_DOLLAR_SIGN , Qt::Key_Dollar); + insert(DIKS_PERCENT_SIGN , Qt::Key_Percent); + insert(DIKS_AMPERSAND , Qt::Key_Ampersand); + insert(DIKS_APOSTROPHE , Qt::Key_Apostrophe); + insert(DIKS_PARENTHESIS_LEFT , Qt::Key_ParenLeft); + insert(DIKS_PARENTHESIS_RIGHT , Qt::Key_ParenRight); + insert(DIKS_ASTERISK , Qt::Key_Asterisk); + insert(DIKS_PLUS_SIGN , Qt::Key_Plus); + insert(DIKS_COMMA , Qt::Key_Comma); + insert(DIKS_MINUS_SIGN , Qt::Key_Minus); + insert(DIKS_PERIOD , Qt::Key_Period); + insert(DIKS_SLASH , Qt::Key_Slash); + insert(DIKS_0 , Qt::Key_0); + insert(DIKS_1 , Qt::Key_1); + insert(DIKS_2 , Qt::Key_2); + insert(DIKS_3 , Qt::Key_3); + insert(DIKS_4 , Qt::Key_4); + insert(DIKS_5 , Qt::Key_5); + insert(DIKS_6 , Qt::Key_6); + insert(DIKS_7 , Qt::Key_7); + insert(DIKS_8 , Qt::Key_8); + insert(DIKS_9 , Qt::Key_9); + insert(DIKS_COLON , Qt::Key_Colon); + insert(DIKS_SEMICOLON , Qt::Key_Semicolon); + insert(DIKS_LESS_THAN_SIGN , Qt::Key_Less); + insert(DIKS_EQUALS_SIGN , Qt::Key_Equal); + insert(DIKS_GREATER_THAN_SIGN , Qt::Key_Greater); + insert(DIKS_QUESTION_MARK , Qt::Key_Question); + insert(DIKS_AT , Qt::Key_At); + insert(DIKS_CAPITAL_A , Qt::Key_A); + insert(DIKS_CAPITAL_B , Qt::Key_B); + insert(DIKS_CAPITAL_C , Qt::Key_C); + insert(DIKS_CAPITAL_D , Qt::Key_D); + insert(DIKS_CAPITAL_E , Qt::Key_E); + insert(DIKS_CAPITAL_F , Qt::Key_F); + insert(DIKS_CAPITAL_G , Qt::Key_G); + insert(DIKS_CAPITAL_H , Qt::Key_H); + insert(DIKS_CAPITAL_I , Qt::Key_I); + insert(DIKS_CAPITAL_J , Qt::Key_J); + insert(DIKS_CAPITAL_K , Qt::Key_K); + insert(DIKS_CAPITAL_L , Qt::Key_L); + insert(DIKS_CAPITAL_M , Qt::Key_M); + insert(DIKS_CAPITAL_N , Qt::Key_N); + insert(DIKS_CAPITAL_O , Qt::Key_O); + insert(DIKS_CAPITAL_P , Qt::Key_P); + insert(DIKS_CAPITAL_Q , Qt::Key_Q); + insert(DIKS_CAPITAL_R , Qt::Key_R); + insert(DIKS_CAPITAL_S , Qt::Key_S); + insert(DIKS_CAPITAL_T , Qt::Key_T); + insert(DIKS_CAPITAL_U , Qt::Key_U); + insert(DIKS_CAPITAL_V , Qt::Key_V); + insert(DIKS_CAPITAL_W , Qt::Key_W); + insert(DIKS_CAPITAL_X , Qt::Key_X); + insert(DIKS_CAPITAL_Y , Qt::Key_Y); + insert(DIKS_CAPITAL_Z , Qt::Key_Z); + insert(DIKS_SQUARE_BRACKET_LEFT , Qt::Key_BracketLeft); + insert(DIKS_BACKSLASH , Qt::Key_Backslash); + insert(DIKS_SQUARE_BRACKET_RIGHT , Qt::Key_BracketRight); + insert(DIKS_CIRCUMFLEX_ACCENT , Qt::Key_AsciiCircum); + insert(DIKS_UNDERSCORE , Qt::Key_Underscore); + insert(DIKS_SMALL_A , Qt::Key_A); + insert(DIKS_SMALL_B , Qt::Key_B); + insert(DIKS_SMALL_C , Qt::Key_C); + insert(DIKS_SMALL_D , Qt::Key_D); + insert(DIKS_SMALL_E , Qt::Key_E); + insert(DIKS_SMALL_F , Qt::Key_F); + insert(DIKS_SMALL_G , Qt::Key_G); + insert(DIKS_SMALL_H , Qt::Key_H); + insert(DIKS_SMALL_I , Qt::Key_I); + insert(DIKS_SMALL_J , Qt::Key_J); + insert(DIKS_SMALL_K , Qt::Key_K); + insert(DIKS_SMALL_L , Qt::Key_L); + insert(DIKS_SMALL_M , Qt::Key_M); + insert(DIKS_SMALL_N , Qt::Key_N); + insert(DIKS_SMALL_O , Qt::Key_O); + insert(DIKS_SMALL_P , Qt::Key_P); + insert(DIKS_SMALL_Q , Qt::Key_Q); + insert(DIKS_SMALL_R , Qt::Key_R); + insert(DIKS_SMALL_S , Qt::Key_S); + insert(DIKS_SMALL_T , Qt::Key_T); + insert(DIKS_SMALL_U , Qt::Key_U); + insert(DIKS_SMALL_V , Qt::Key_V); + insert(DIKS_SMALL_W , Qt::Key_W); + insert(DIKS_SMALL_X , Qt::Key_X); + insert(DIKS_SMALL_Y , Qt::Key_Y); + insert(DIKS_SMALL_Z , Qt::Key_Z); + insert(DIKS_CURLY_BRACKET_LEFT , Qt::Key_BraceLeft); + insert(DIKS_VERTICAL_BAR , Qt::Key_Bar); + insert(DIKS_CURLY_BRACKET_RIGHT , Qt::Key_BraceRight); + insert(DIKS_TILDE , Qt::Key_AsciiTilde); } #include "qdirectfbkeyboard.moc" -- cgit v0.12 From 0ded26da02d0786b08e2bf52a7e68abf7c4c8701 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 22 Apr 2009 08:56:00 +1000 Subject: Fixes unit tests always giving 0 exit code when Qt is configured with `-developer-build'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was an undocumented hack to make it easier for our autotest scripts to detect crashes in unit tests. Going forward, it should not be required. Reviewed-by: Shane Bradley Acked-by: Jesper Thomschütz --- src/testlib/qtestcase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index f17d95d..b5200dc 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1481,7 +1481,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) } #endif -#if defined(QTEST_NOEXITCODE) || (defined(QT_BUILD_INTERNAL) && !defined(QTEST_FORCE_EXITCODE)) +#if defined(QTEST_NOEXITCODE) return 0; #else -- cgit v0.12 From dade8b3a709d6889e049f8a20de5378e7bb28beb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 22 Apr 2009 08:27:59 +0200 Subject: Fix the code snippet for executing a test, it should be CONFIG not QT Task-number: 251848 Reviewed-by: TrustMe --- doc/src/snippets/code/doc_src_qtestlib.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/doc_src_qtestlib.qdoc b/doc/src/snippets/code/doc_src_qtestlib.qdoc index ff52b2f..494fa10 100644 --- a/doc/src/snippets/code/doc_src_qtestlib.qdoc +++ b/doc/src/snippets/code/doc_src_qtestlib.qdoc @@ -61,7 +61,7 @@ void TestQString::toUpper() //! [9] -/myTestDirectory$ qmake -project "QT += testlib" +/myTestDirectory$ qmake -project "CONFIG += testlib" /myTestDirectory$ qmake /myTestDirectory$ make //! [9] -- cgit v0.12 From e5fa2cf55c8370ca58f82ba1ef37a54649bd42c8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 22 Apr 2009 08:32:21 +0200 Subject: Fix my previous commit since I missed the q out of qtestlib Task-number: 251848 Reviewed-by: TrustMe --- doc/src/snippets/code/doc_src_qtestlib.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/doc_src_qtestlib.qdoc b/doc/src/snippets/code/doc_src_qtestlib.qdoc index 494fa10..a0e4944 100644 --- a/doc/src/snippets/code/doc_src_qtestlib.qdoc +++ b/doc/src/snippets/code/doc_src_qtestlib.qdoc @@ -61,7 +61,7 @@ void TestQString::toUpper() //! [9] -/myTestDirectory$ qmake -project "CONFIG += testlib" +/myTestDirectory$ qmake -project "CONFIG += qtestlib" /myTestDirectory$ qmake /myTestDirectory$ make //! [9] -- cgit v0.12 From 9792ddf1e5d3f5e6713765b53ea031fa4e6eff4e Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 22 Apr 2009 09:30:00 +0200 Subject: Fix double entries in the sidebar of QFileDialog The problem is QUrl == operator is case sensitive. On Windows we don't want double entries for C:\dev or c:\dev so i convert the url in lower case and compare them (on Windows only) to avoid duplicate entries. Task-number:226483 Reviewed-by:jasplin --- src/gui/dialogs/qsidebar.cpp | 4 ++++ tests/auto/qsidebar/tst_qsidebar.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index bfdb37e..26108d7 100644 --- a/src/gui/dialogs/qsidebar.cpp +++ b/src/gui/dialogs/qsidebar.cpp @@ -248,7 +248,11 @@ void QUrlModel::addUrls(const QList &list, int row, bool move) if (!url.isValid() || url.scheme() != QLatin1String("file")) continue; for (int j = 0; move && j < rowCount(); ++j) { +#if defined(Q_OS_WIN) + if (index(j, 0).data(UrlRole).toUrl().toLocalFile().toLower() == url.toLocalFile().toLower()) { +#else if (index(j, 0).data(UrlRole) == url) { +#endif removeRow(j); if (j <= row) row--; diff --git a/tests/auto/qsidebar/tst_qsidebar.cpp b/tests/auto/qsidebar/tst_qsidebar.cpp index 7a262e6..705e222 100644 --- a/tests/auto/qsidebar/tst_qsidebar.cpp +++ b/tests/auto/qsidebar/tst_qsidebar.cpp @@ -176,6 +176,32 @@ void tst_QSidebar::addUrls() qsidebar.addUrls(urls, -1); qsidebar.addUrls(moreUrls, -1); QCOMPARE(qsidebar.urls()[0], urls[0]); + + QList doubleUrls; + //tow exact same paths, we have only one entry + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 1); + +#if defined(Q_OS_WIN) + //Windows is case insensitive so no duplicate entries in that case + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath().toUpper()); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 1); +#else + //Two different paths we should have two entries + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath().toUpper()); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 2); +#endif + + } void tst_QSidebar::goToUrl() -- cgit v0.12 From a9d0e4f830687b33c3a93cce2a3b8d77cc3546cc Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 22 Apr 2009 10:47:11 +0200 Subject: Compile fix for static builds on Windows for QtOpenGL apps. Reviewed-by: Thiago --- src/opengl/qwindowsurface_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 837ccf2..b41adf9 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE // QGLGraphicsSystem // #ifdef Q_WS_WIN -Q_GUI_EXPORT bool qt_win_owndc_required; +extern Q_GUI_EXPORT bool qt_win_owndc_required; #endif QGLGraphicsSystem::QGLGraphicsSystem() : QGraphicsSystem() -- cgit v0.12 From 5cba8ea7d6b793ba0012dfc387e6859ace7c664a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 21 Apr 2009 16:59:55 +0200 Subject: Fix more NaNs in Elastic Nodes example Don't try to draw zero-length lines. Don't draw lines if nodes are superimposed. Reviewed-by: Andreas --- examples/graphicsview/elasticnodes/edge.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/graphicsview/elasticnodes/edge.cpp b/examples/graphicsview/elasticnodes/edge.cpp index e32a35a..eb02143 100644 --- a/examples/graphicsview/elasticnodes/edge.cpp +++ b/examples/graphicsview/elasticnodes/edge.cpp @@ -96,7 +96,7 @@ void Edge::adjust() prepareGeometryChange(); - if (!qFuzzyCompare(length, qreal(0.0))) { + if (length > qreal(20.)) { QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length); sourcePoint = line.p1() + edgeOffset; destPoint = line.p2() - edgeOffset; @@ -124,12 +124,15 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) if (!source || !dest) return; - // Draw the line itself QLineF line(sourcePoint, destPoint); + if (qFuzzyCompare(line.length(), qreal(0.))) + return; + + // Draw the line itself painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter->drawLine(line); - // Draw the arrows if there's enough room + // Draw the arrows double angle = ::acos(line.dx() / line.length()); if (line.dy() >= 0) angle = TwoPi - angle; -- cgit v0.12 From e8468f21d24b85114a8841413f9328a17f7bc54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 22 Apr 2009 12:05:08 +0200 Subject: Fix crash in drawPixmap when painting on a null pixmap We need to check if the engine is null before we do the thread test. Reviewed-by: Thiago --- src/gui/painting/qpainter.cpp | 6 +++--- tests/auto/qpainter/tst_qpainter.cpp | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index ffb273e..65d87fa 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5167,6 +5167,9 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm) Q_D(QPainter); + if (!d->engine) + return; + #ifndef QT_NO_DEBUG qt_painter_thread_test(d->device->devType(), "drawPixmap()"); #endif @@ -5176,9 +5179,6 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm) return; } - if (!d->engine) - return; - qreal x = p.x(); qreal y = p.y(); diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 8b43f9b..c81bf67 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -3792,8 +3792,11 @@ void tst_QPainter::imageBlending() void tst_QPainter::paintOnNullPixmap() { + QPixmap pix(16, 16); + QPixmap textPixmap; QPainter p(&textPixmap); + p.drawPixmap(10, 10, pix); p.end(); QPixmap textPixmap2(16,16); -- cgit v0.12 From 7ba85aba8686d83dc8557a9fb6d4504fbbeec349 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 22 Apr 2009 11:58:41 +0200 Subject: Fix Transformed driver on 8-bit displays Task-number: 250971 Reviewed-by: Tom --- src/gui/embedded/qscreentransformed_qws.cpp | 4 +++- src/gui/painting/qmemrotate.cpp | 1 + src/gui/painting/qmemrotate_p.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/embedded/qscreentransformed_qws.cpp b/src/gui/embedded/qscreentransformed_qws.cpp index f988789..46ac1d1 100644 --- a/src/gui/embedded/qscreentransformed_qws.cpp +++ b/src/gui/embedded/qscreentransformed_qws.cpp @@ -410,7 +410,9 @@ void QTransformedScreen::blit(const QImage &image, const QPoint &topLeft, #endif #ifdef QT_QWS_DEPTH_8 case 8: - if (image.depth() == 16) + if (image.format() == QImage::Format_RGB444) + SET_BLIT_FUNC(quint8, qrgb444, trans, func); + else if (image.depth() == 16) SET_BLIT_FUNC(quint8, quint16, trans, func); else SET_BLIT_FUNC(quint8, quint32, trans, func); diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp index 7ad0e42..4058143 100644 --- a/src/gui/painting/qmemrotate.cpp +++ b/src/gui/painting/qmemrotate.cpp @@ -537,6 +537,7 @@ QT_IMPL_MEMROTATE(quint32, quint24) QT_IMPL_MEMROTATE(quint32, quint18) QT_IMPL_MEMROTATE(quint32, quint8) QT_IMPL_MEMROTATE(quint16, quint8) +QT_IMPL_MEMROTATE(qrgb444, quint8) QT_IMPL_MEMROTATE(quint8, quint8) #ifdef QT_QWS_DEPTH_GENERIC QT_IMPL_MEMROTATE(quint32, qrgb_generic16) diff --git a/src/gui/painting/qmemrotate_p.h b/src/gui/painting/qmemrotate_p.h index bd6006b..c1eb93e 100644 --- a/src/gui/painting/qmemrotate_p.h +++ b/src/gui/painting/qmemrotate_p.h @@ -90,6 +90,7 @@ QT_DECL_MEMROTATE(quint32, quint24); QT_DECL_MEMROTATE(quint32, quint18); QT_DECL_MEMROTATE(quint32, quint8); QT_DECL_MEMROTATE(quint16, quint8); +QT_DECL_MEMROTATE(qrgb444, quint8); QT_DECL_MEMROTATE(quint8, quint8); #ifdef QT_QWS_DEPTH_GENERIC QT_DECL_MEMROTATE(quint32, qrgb_generic16); -- cgit v0.12 From 1b1da000ba15530f2070a57ea97bb3166fb67331 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 22 Apr 2009 22:11:22 +1000 Subject: Make make_qfeatures_dot_h script generate the current copyright header. Update the script, and update the generated file. Reviewed-by: Thiago Reviewed-by: Paul Olav Tvete --- src/corelib/global/qfeatures.h | 54 +++++++++++++++++++-------------------- util/scripts/make_qfeatures_dot_h | 41 +++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 6d55f7c..2189723 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -120,6 +120,9 @@ // QMovie //#define QT_NO_MOVIE +// QNetworkInterface +//#define QT_NO_NETWORKINTERFACE + // QNetworkProxy //#define QT_NO_NETWORKPROXY @@ -198,12 +201,12 @@ // Qt Prerendered Font Format //#define QT_NO_QWS_QPF -// Raster Paint Engine callback functions -//#define QT_NO_RASTERCALLBACKS - // Qt Prerendered Font Format 2 //#define QT_NO_QWS_QPF2 +// Raster Paint Engine callback functions +//#define QT_NO_RASTERCALLBACKS + // Resize Handler //#define QT_NO_RESIZEHANDLER @@ -273,9 +276,6 @@ // HtmlParser //#define QT_NO_TEXTHTMLPARSER -// OdfWriter -//#define QT_NO_TEXTODFWRITER - // QTextStream //#define QT_NO_TEXTSTREAM @@ -316,6 +316,11 @@ #define QT_NO_BUTTONGROUP #endif +// QClipboard +#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES)) +#define QT_NO_CLIPBOARD +#endif + // Codecs #if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) #define QT_NO_CODECS @@ -376,11 +381,6 @@ #define QT_NO_PHONON_VOLUMESLIDER #endif -// QPrinter -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM)) -#define QT_NO_PRINTER -#endif - // QProcess #if !defined(QT_NO_PROCESS) && (defined(QT_NO_THREAD)) #define QT_NO_PROCESS @@ -481,11 +481,6 @@ #define QT_NO_XMLSTREAMWRITER #endif -// Odf Writer -#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) -#define QT_NO_TEXTODFWRITER -#endif - // Context menu #if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) #define QT_NO_CONTEXTMENU @@ -511,11 +506,21 @@ #define QT_NO_LIBRARY #endif +// QPrinter +#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE)) +#define QT_NO_PRINTER +#endif + // QScrollArea #if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) #define QT_NO_SCROLLAREA #endif +// OdfWriter +#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) +#define QT_NO_TEXTODFWRITER +#endif + // QToolButton #if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ICON) || defined(QT_NO_ACTION)) #define QT_NO_TOOLBUTTON @@ -636,16 +641,6 @@ #define QT_NO_WHATSTHIS #endif -// QClipboard -#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES)) -#define QT_NO_CLIPBOARD -#endif - -// Common UNIX Printing System -#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) -#define QT_NO_CUPS -#endif - // QDirModel #if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS)) #define QT_NO_DIRMODEL @@ -726,6 +721,11 @@ #define QT_NO_COMPLETER #endif +// Common UNIX Printing System +#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) +#define QT_NO_CUPS +#endif + // QDataWidgetMapper #if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) #define QT_NO_DATAWIDGETMAPPER @@ -757,7 +757,7 @@ #endif // QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_PICTURE)) +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER)) #define QT_NO_PRINTPREVIEWWIDGET #endif diff --git a/util/scripts/make_qfeatures_dot_h b/util/scripts/make_qfeatures_dot_h index c434649..5ca8c88 100755 --- a/util/scripts/make_qfeatures_dot_h +++ b/util/scripts/make_qfeatures_dot_h @@ -2,9 +2,9 @@ # # Usage: make_qfeatures_dot_h # -# Generates core/base/qfeatures.h from core/base/qfeatures.txt. +# Generates src/corelib/global/qfeatures.h from src/corelib/global/qfeatures.txt. # -# The tools/qfeatures.txt file can contain redundancies, and this program +# The qfeatures.txt file can contain redundancies, and this program # will show them. # @@ -85,11 +85,42 @@ open OUT, ">$ENV{QTDIR}/src/corelib/global/qfeatures.h" print OUT "/**************************************************************************** ** -** Copyright (C) 1992-\$THISYEAR\$ \$TROLLTECH\$. All rights reserved. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info\@nokia.com) ** -** This file is part of the \$MODULE\$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** \$TROLLTECH_DUAL_LICENSE\$ +** \$QT_BEGIN_LICENSE:LGPL\$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales\@nokia.com. +** \$QT_END_LICENSE\$ ** ****************************************************************************/ -- cgit v0.12 From fa4049c9ba8446a582a9bd003d5cdf98ae0505eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 22 Apr 2009 13:25:56 +0200 Subject: Doc fixes Reviewed-by: Thiago --- doc/src/phonon-api.qdoc | 4 ++-- src/corelib/kernel/qcoreevent.cpp | 1 + src/gui/kernel/qapplication.cpp | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 3d04c68..501b5a5 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -4457,12 +4457,12 @@ */ /*! - \fn QList Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, HideAdvancedDevicesOverride override = FromSettings) const + \fn QList Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const \internal */ /*! - \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category) const + \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const \internal */ diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 3fcfc98..11a2d3c 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -260,6 +260,7 @@ QT_BEGIN_NAMESPACE \omitvalue ApplicationActivated \omitvalue ApplicationDeactivated \omitvalue MacGLWindowChange + \omitvalue MacGLClearDrawable \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut \omitvalue CocoaRequestModal diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 09f0f91..1624b9d 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -832,12 +832,13 @@ QApplication::QApplication(Display *dpy, int &argc, char **argv, #endif // Q_WS_X11 +extern void qInitDrawhelperAsm(); /*! + \fn void QApplicationPrivate::initialize() + Initializes the QApplication object, called from the constructors. */ -extern void qInitDrawhelperAsm(); - void QApplicationPrivate::initialize() { QWidgetPrivate::mapper = new QWidgetMapper; -- cgit v0.12 From 1187d1b2063b42378d9cd1a940bcd7eecb24fb69 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 22 Apr 2009 23:32:40 +1000 Subject: Make all qdoc footers consistent with the main Qt docs. Use the same copyright message in all doc footers. As a side-effect, this change also removes most of the remaining THISYEAR placeholders, and fixes some footers that try to use 110% of the page width. Reviewed-by: Thiago --- tools/assistant/tools/assistant/doc/assistant.qdocconf | 3 +-- tools/qdoc3/test/carbide-eclipse-integration.qdocconf | 6 +++--- tools/qdoc3/test/jambi.qdocconf | 2 +- tools/qdoc3/test/qt-html-templates.qdocconf | 3 +-- tools/qdoc3/test/qt-inc.qdocconf | 2 +- tools/qdoc3/test/standalone-eclipse-integration.qdocconf | 6 +++--- util/qlalr/doc/qlalr.qdocconf | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index 0d2271d..f71bc08 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -10,8 +10,7 @@ description = "Qt Assistant" HTML.{postheader,address} = "" HTML.footer = "


\n" \ "\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © 2009 Nokia Corporation " \ - "and/or its subsidiary(-ies)Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt 4.5.1
" diff --git a/tools/qdoc3/test/carbide-eclipse-integration.qdocconf b/tools/qdoc3/test/carbide-eclipse-integration.qdocconf index 683048d..7fe489e 100644 --- a/tools/qdoc3/test/carbide-eclipse-integration.qdocconf +++ b/tools/qdoc3/test/carbide-eclipse-integration.qdocconf @@ -6,7 +6,7 @@ macro.TheEclipseIntegration = Carbide.c++ HTML.footer = "


\n" \ "\n" \ - "\n" \ - "\n" \ - "\n" \ + "\n" \ + "\n" \ + "\n" \ "
Copyright © 2009 Nokia CorporationTrademarks
Carbide.c++
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Carbide.c++
" diff --git a/tools/qdoc3/test/jambi.qdocconf b/tools/qdoc3/test/jambi.qdocconf index 3644b69..5288b22 100644 --- a/tools/qdoc3/test/jambi.qdocconf +++ b/tools/qdoc3/test/jambi.qdocconf @@ -41,7 +41,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © \$THISYEAR\$ TrolltechCopyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Jambi \\version
" diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index f09192a..dc027d0 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -25,8 +25,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © %THISYEAR% Nokia Corporation " \ - "and/or its subsidiary(-ies)Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt \\version
" diff --git a/tools/qdoc3/test/qt-inc.qdocconf b/tools/qdoc3/test/qt-inc.qdocconf index 97893dc..18d3faf 100644 --- a/tools/qdoc3/test/qt-inc.qdocconf +++ b/tools/qdoc3/test/qt-inc.qdocconf @@ -140,7 +140,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © %THISYEAR% TrolltechCopyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt \\version
" diff --git a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf index c3c4291..08b6070 100644 --- a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf +++ b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf @@ -5,7 +5,7 @@ macro.TheEclipseIntegration = The Qt Eclipse Integration HTML.footer = "


\n" \ "\n" \ - "\n" \ - "\n" \ - "\n" \ + "\n" \ + "\n" \ + "\n" \ "
Copyright © 2009 Nokia CorporationTrademarks
Qt Eclipse Integration 1.4.3
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Eclipse Integration 1.4.3
" diff --git a/util/qlalr/doc/qlalr.qdocconf b/util/qlalr/doc/qlalr.qdocconf index d97ff7d..a97ef6a 100644 --- a/util/qlalr/doc/qlalr.qdocconf +++ b/util/qlalr/doc/qlalr.qdocconf @@ -59,7 +59,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © \$THISYEAR\$ TrolltechCopyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt \\version
" -- cgit v0.12 From f8be94bf4e8fa359bfc71a10aa7dc6b12daf5dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 22 Apr 2009 15:57:06 +0200 Subject: Fix QPrinter::pageRect() for Windows printers, when fullPage() is set. When QPrinter::fullPage() was set, pageRect() returned the same as paperRect(). Under Windows, there is always a non-printable area that was not taken into account in the fullPage() case. Task-number: 248881 Reviewed-by: Kim --- src/gui/painting/qprintengine_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index c8674b7..7601beb 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -1532,7 +1532,7 @@ QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const value = rect; } else { value = QTransform(1/d->stretch_x, 0, 0, 1/d->stretch_y, 0, 0) - .mapRect(d->fullPage ? d->devPaperRect : d->devPageRect); + .mapRect(d->fullPage ? d->devPhysicalPageRect : d->devPageRect); } break; -- cgit v0.12 From 3696886a327fc4894518c5570b02d5238dcede8a Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 22 Apr 2009 15:55:28 +0200 Subject: QGtkStyle: Fix broken transparency on line edits in Clearlooks This basically uses a workaround to hint to our gtk theme that we do not want it to fill our line edit backgrouns with the background brush. This was suggested by Benjamin berg. More information can be found here: https://bugzilla.mozilla.org/show_bug.cgi?id=405421 Reviewed-by: Tor Arne --- src/gui/styles/qgtkstyle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index b7fa575..ca71da2 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -951,14 +951,15 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, "interior-focus", &interior_focus, "focus-line-width", &focus_line_width, NULL); + // See https://bugzilla.mozilla.org/show_bug.cgi?id=405421 for info about this hack + g_object_set_data(G_OBJECT(gtkEntry), "transparent-bg-hint", GINT_TO_POINTER(TRUE)); + if (!interior_focus && option->state & State_HasFocus) rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); - gtkPainter.paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, gtkEntry->style, option->state & State_HasFocus ? QLS("focus") : QString()); - if (!interior_focus && option->state & State_HasFocus) gtkPainter.paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, -- cgit v0.12 From cf9db492ac60568bd159c3749dfa11e2347b9927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 22 Apr 2009 14:49:24 +0200 Subject: Prevent QTransform::type() from returning TxScale instead of TxProject. We have code that assumes that m33 = 1 if the type is TxScale. Instead of changing all that code it's better to just return TxProject as type when m33 is different from 1. Reviewed-by: Simon Hausmann --- src/gui/painting/qtransform.cpp | 4 ++-- tests/auto/qtransform/tst_qtransform.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 39e429d..af27fd5 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1880,7 +1880,7 @@ const QMatrix &QTransform::toAffine() const QTransform::TransformationType QTransform::type() const { if (m_dirty >= m_type) { - if (m_dirty > TxShear && (!qFuzzyCompare(m_13 + 1, 1) || !qFuzzyCompare(m_23 + 1, 1))) + if (m_dirty > TxShear && (!qFuzzyCompare(m_13 + 1, 1) || !qFuzzyCompare(m_23 + 1, 1) || !qFuzzyCompare(m_33, 1))) m_type = TxProject; else if (m_dirty > TxScale && (!qFuzzyCompare(affine._m12 + 1, 1) || !qFuzzyCompare(affine._m21 + 1, 1))) { const qreal dot = affine._m11 * affine._m12 + affine._m21 * affine._m22; @@ -1888,7 +1888,7 @@ QTransform::TransformationType QTransform::type() const m_type = TxRotate; else m_type = TxShear; - } else if (m_dirty > TxTranslate && (!qFuzzyCompare(affine._m11, 1) || !qFuzzyCompare(affine._m22, 1) || !qFuzzyCompare(m_33, 1))) + } else if (m_dirty > TxTranslate && (!qFuzzyCompare(affine._m11, 1) || !qFuzzyCompare(affine._m22, 1))) m_type = TxScale; else if (m_dirty > TxNone && (!qFuzzyCompare(affine._dx + 1, 1) || !qFuzzyCompare(affine._dy + 1, 1))) m_type = TxTranslate; diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp index 8516ddb..74c405e 100644 --- a/tests/auto/qtransform/tst_qtransform.cpp +++ b/tests/auto/qtransform/tst_qtransform.cpp @@ -593,6 +593,16 @@ void tst_QTransform::types() m3.translate(5.0f, 5.0f); QCOMPARE(m3.type(), QTransform::TxScale); QCOMPARE(m3.inverted().type(), QTransform::TxScale); + + m3.setMatrix(1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 2.0f); + QCOMPARE(m3.type(), QTransform::TxProject); + + m3.setMatrix(0.0f, 2.0f, 0.0f, + 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 2.0f); + QCOMPARE(m3.type(), QTransform::TxProject); } -- cgit v0.12 From cb14e8b90c71afb851c3165fc009e4fa11dd04c9 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 09:46:29 -0700 Subject: Take out STATIC_ALLOC of primary surface creation We never resize this surface anyway so it's not necessary. Make it possible to enable with an option. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 041d522..65c027d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -833,15 +833,15 @@ bool QDirectFBScreen::connect(const QString &displaySpec) description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_WIDTH); if (::setIntOption(displayArgs, QLatin1String("height"), &description.height)) description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_HEIGHT); - description.caps = DFBSurfaceCapabilities(DSCAPS_PRIMARY - | DSCAPS_DOUBLE - | DSCAPS_STATIC_ALLOC); - if (displayArgs.contains(QLatin1String("forcepremultiplied"), - Qt::CaseInsensitive)) { - description.caps = DFBSurfaceCapabilities(description.caps - | DSCAPS_PREMULTIPLIED); + uint caps = DSCAPS_PRIMARY|DSCAPS_DOUBLE; + if (displayArgs.contains(QLatin1String("static_alloc"))) + caps |= DSCAPS_STATIC_ALLOC; + + if (displayArgs.contains(QLatin1String("forcepremultiplied"), Qt::CaseInsensitive)) { + caps |= DSCAPS_PREMULTIPLIED; } + description.caps = DFBSurfaceCapabilities(caps); // We don't track the primary surface as it's released in disconnect d_ptr->dfbSurface = createDFBSurface(&description, DontTrackSurface); if (!d_ptr->dfbSurface) { -- cgit v0.12 From 5a7f626f3c6d5d5e2ceaa2c7db9de5b51deca637 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 09:41:54 -0700 Subject: Unify IDirectFBSurface->Lock() calls Certain compilers warns on this kind of code: uchar *mem = ...; (void**)(&mem) dereferencing type punned pointer etc. Since we had this for every call to Lock I put it all into a convenience function. Also fix some issues where we memcpy'ed more bytes than necessary (when stride != w * depth() / 8) and fix issue with QDirectFBScreen::solidFill with pixelFormat == RGB32 Reviewed-by: Donald --- .../gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 19 ++----- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 19 ++++--- .../gfxdrivers/directfb/qdirectfbscreen.cpp | 64 ++++++++++++++-------- src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 2 + 4 files changed, 58 insertions(+), 46 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 2a2ef5c..924090c 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -56,23 +56,16 @@ IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const } -// Locks the dfb surface and creates a QImage (lockedImage) from the pointer -void QDirectFBPaintDevice::lockDirectFB() { - +void QDirectFBPaintDevice::lockDirectFB() +{ if (lockedImage) return; // Already locked - void *mem; - int w, h; - DFBResult result = dfbSurface->Lock(dfbSurface, DSLF_WRITE, &mem, &bpl); - if (result != DFB_OK || !mem) { - DirectFBError("QDirectFBPixmapData::buffer()", result); - return; + if (uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl)) { + const QSize s = size(); + lockedImage = new QImage(mem, s.width(), s.height(), bpl, + QDirectFBScreen::getImageFormat(dfbSurface)); } - - dfbSurface->GetSize(dfbSurface, &w, &h); - lockedImage = new QImage(static_cast(mem), w, h, bpl, - QDirectFBScreen::getImageFormat(dfbSurface)); } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 0a1696a..a6017b8 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -267,16 +267,17 @@ void QDirectFBPixmapData::fill(const QColor &color) if (forceRaster) { // in DSPF_RGB32 all dfb drawing causes the Alpha byte to be // set to 0. This causes issues for the raster engine. - char *mem; - int bpl; - const int h = QPixmapData::height(); - dfbSurface->Lock(dfbSurface, DSLF_WRITE, (void**)&mem, &bpl); - const int c = color.rgba(); - for (int i = 0; i < h; ++i) { - memset(mem, c, bpl); - mem += bpl; + uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl); + if (mem) { + const int h = QPixmapData::height(); + const int w = QPixmapData::width() * 4; // 4 bytes per 32 bit pixel + const int c = color.rgba(); + for (int i = 0; i < h; ++i) { + memset(mem, c, w); + mem += bpl; + } + dfbSurface->Unlock(dfbSurface); } - dfbSurface->Unlock(dfbSurface); } else { dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), color.alpha()); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 65c027d..490eeb0 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -159,15 +159,17 @@ IDirectFBSurface* QDirectFBScreen::createDFBSurface(const QImage &img, SurfaceCr IDirectFBSurface *surface = createDFBSurface(&desc, options); #ifdef QT_NO_DIRECTFB_PREALLOCATED if (surface) { - char *mem; int bpl; - surface->Lock(surface, DSLF_WRITE, (void**)&mem, &bpl); - const int h = img.height(); - for (int i = 0; i < h; ++i) { - memcpy(mem, img.scanLine(i), bpl); - mem += bpl; + uchar *mem = QDirectFBScreen::lockSurface(surface, DSLF_WRITE, &bpl); + if (mem) { + const int h = img.height(); + const int w = img.width() * img.depth() / 8; + for (int i = 0; i < h; ++i) { + memcpy(mem, img.scanLine(i), w); + mem += bpl; + } + surface->Unlock(surface); } - surface->Unlock(surface); } #endif #ifndef QT_NO_DIRECTFB_PALETTE @@ -317,15 +319,17 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img, imgSurface->Release(imgSurface); #else // QT_NO_DIRECTFB_PREALLOCATED Q_ASSERT(image.format() == pixmapFormat); - char *mem; int bpl; - dfbSurface->Lock(dfbSurface, DSLF_WRITE, (void**)&mem, &bpl); - const int w = image.width() * image.depth() / 8; - for (int i = 0; i < image.height(); ++i) { - memcpy(mem, image.scanLine(i), w); - mem += bpl; + uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl); + if (mem) { + const int h = image.height(); + const int w = image.width() * image.depth() / 8; + for (int i=0; iUnlock(dfbSurface); } - dfbSurface->Unlock(dfbSurface); #endif return dfbSurface; } @@ -1188,23 +1192,23 @@ void QDirectFBScreen::blit(IDirectFBSurface *src, const QPoint &topLeft, points.data(), n); } +// This function is only ever called by QScreen::drawBackground which +// is only ever called by QScreen::compose which is never called with +// DirectFB so it's really a noop. void QDirectFBScreen::solidFill(const QColor &color, const QRegion ®ion) { if (region.isEmpty()) return; if (QDirectFBScreen::getImageFormat(d_ptr->dfbSurface) == QImage::Format_RGB32) { - uchar *mem; - int bpl; - d_ptr->dfbSurface->Lock(d_ptr->dfbSurface, DSLF_WRITE, (void**)&mem, &bpl); - QImage img(mem, w, h, bpl, QImage::Format_RGB32); - QPainter p(&img); - p.setBrush(color); - p.setPen(Qt::NoPen); - const QVector rects = region.rects(); - p.drawRects(rects.constData(), rects.size()); - p.end(); + data = QDirectFBScreen::lockSurface(d_ptr->dfbSurface, DSLF_WRITE, &lstep); + if (!data) + return; + + QScreen::solidFill(color, region); d_ptr->dfbSurface->Unlock(d_ptr->dfbSurface); + data = 0; + lstep = 0; } else { d_ptr->dfbSurface->SetColor(d_ptr->dfbSurface, color.red(), color.green(), color.blue(), @@ -1241,3 +1245,15 @@ bool QDirectFBScreen::initSurfaceDescriptionPixelFormat(DFBSurfaceDescription *d } return true; } + +uchar *QDirectFBScreen::lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl) +{ + void *mem; + const DFBResult result = surface->Lock(surface, flags, static_cast(&mem), bpl); + if (result != DFB_OK) { + DirectFBError("QDirectFBPixmapData::lockSurface()", result); + } + + return reinterpret_cast(mem); +} + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index f394ac1..8dd38dc 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -127,6 +127,8 @@ public: const QImage &image); #endif + static uchar *lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl = 0); + private: void compose(const QRegion &r); void blit(IDirectFBSurface *src, const QPoint &topLeft, -- cgit v0.12 From b250e23a418f991bb979158e119bdb78cddc8228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 22 Apr 2009 19:24:10 +0200 Subject: Don't emit QApplication::focusChanged for no reason The Qt::NoFocusReason is used when Qt temporarily moves the focus to the QMenuBar while switching from one widget to another. While this did not result in a QFocusEvent, it did result in emitting the QApplication::focusChanged signal. This in turn caused a slowness in Qt Creator, since it wanted to update the current context and find filter. The fix here makes sure the focusChanged signal is not emitted when the focus reason is Qt::NoFocusReason, since these focus changes are not interesting for the application. Reviewed-by: mae --- src/gui/kernel/qapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1624b9d..d0b1790 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2100,8 +2100,8 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) if (that) QApplication::sendEvent(that->style(), &in); } + emit qApp->focusChanged(prev, focus_widget); } - emit qApp->focusChanged(prev, focus_widget); } } -- cgit v0.12 From 5c5d5cf6f70155d0920d8727696785d8348d65fb Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 22 Apr 2009 20:12:45 +0200 Subject: Show filter extensions in the GTK file dialog if no name is provided In the GTK+ file dialog filters are only represented by names such as "All files", while the actual extensions are hidden. You can create a filter without a name in Qt however so in this case we have to fall back to showing the file extensions instead. Task-number: 251928 Reviewed-by: rosch --- src/gui/styles/gtksymbols.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index acb8437..0842ec7 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -746,9 +746,9 @@ static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent, foreach (const QString &rawfilter, filters) { GtkFileFilter *gtkFilter = QGtk::gtk_file_filter_new (); QString name = rawfilter.left(rawfilter.indexOf(QLatin1Char('('))); - QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name)); - QStringList extensions = extract_filter(rawfilter); + QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name.isEmpty() ? extensions.join(QLS(", ")) : name)); + foreach (const QString &fileExtension, extensions) { QGtk::gtk_file_filter_add_pattern (gtkFilter, qPrintable(fileExtension)); } -- cgit v0.12 From 8d7729cd116d40b0ab0bc65a709fe7b70ba84e64 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 11:57:46 -0700 Subject: Kill some warnings Refactor two small things so that we don't get warnings when QT_DIRECTFB_NO_(OPAQUEDETECTION|MOUSE|KEYBOARD) is defined Reviewed-by: Shane McLaughlin --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 3 +++ src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index a6017b8..f9172cc 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -160,6 +160,9 @@ static bool checkForAlphaPixels(const QImage &img) void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) { +#ifdef QT_NO_DIRECTFB_OPAQUE_DETECTION + Q_UNUSED(flags); +#endif Q_ASSERT(img.depth() != 1); // these should be handled by QRasterPixmapData if (img.hasAlphaChannel() #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 490eeb0..b2b8e9b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -956,16 +956,15 @@ void QDirectFBScreen::disconnect() bool QDirectFBScreen::initDevice() { - QWSServer *server = QWSServer::instance(); #ifndef QT_NO_DIRECTFB_MOUSE if (qgetenv("QWS_MOUSE_PROTO").isEmpty()) { - server->setDefaultMouse("None"); + QWSServer::instance()->->setDefaultMouse("None"); d_ptr->mouse = new QDirectFBMouseHandler; } #endif #ifndef QT_NO_DIRECTFB_KEYBOARD if (qgetenv("QWS_KEYBOARD").isEmpty()) { - server->setDefaultKeyboard("None"); + QWSServer::instance()->->setDefaultKeyboard("None"); d_ptr->keyboard = new QDirectFBKeyboardHandler(QString()); } #endif -- cgit v0.12 From 08218fb6dbcc4f133c20cdc3a4e6575606924a29 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 12:31:03 -0700 Subject: Compile Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index b2b8e9b..3e54e7f 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -958,13 +958,13 @@ bool QDirectFBScreen::initDevice() { #ifndef QT_NO_DIRECTFB_MOUSE if (qgetenv("QWS_MOUSE_PROTO").isEmpty()) { - QWSServer::instance()->->setDefaultMouse("None"); + QWSServer::instance()->setDefaultMouse("None"); d_ptr->mouse = new QDirectFBMouseHandler; } #endif #ifndef QT_NO_DIRECTFB_KEYBOARD if (qgetenv("QWS_KEYBOARD").isEmpty()) { - QWSServer::instance()->->setDefaultKeyboard("None"); + QWSServer::instance()->setDefaultKeyboard("None"); d_ptr->keyboard = new QDirectFBKeyboardHandler(QString()); } #endif -- cgit v0.12 From d64d13102d3d53d0aa43597408d7abf3fecb57a3 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 15:09:59 -0700 Subject: Convert bitmaps to alpha pixmap format Ideally we'd let raster pixmap data handle this but QPixmap::fromImage creates a QPixmapData::PixmapType regardless of the bit depth of the image so we have to handle this case. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index f9172cc..ea9bb3a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -157,13 +157,13 @@ static bool checkForAlphaPixels(const QImage &img) return false; } -void QDirectFBPixmapData::fromImage(const QImage &img, +void QDirectFBPixmapData::fromImage(const QImage &i, Qt::ImageConversionFlags flags) { #ifdef QT_NO_DIRECTFB_OPAQUE_DETECTION Q_UNUSED(flags); #endif - Q_ASSERT(img.depth() != 1); // these should be handled by QRasterPixmapData + const QImage img = (i.depth() == 1 ? i.convertToFormat(screen->alphaPixmapFormat()) : i); if (img.hasAlphaChannel() #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION && (flags & Qt::NoOpaqueDetection || ::checkForAlphaPixels(img)) -- cgit v0.12 From 7fa8e95d1b87403aab14dd326520600bc028a195 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 23 Apr 2009 09:06:43 +1000 Subject: Fixes memory leak in QSvgWidget. `q' is 0 during construction of QSvgWidgetPrivate, thus each QSvgWidget instance was creating a QSvgRenderer with no parent. Acked-by: Thiago Macieira Reviewed-by: Shane Bradley --- src/svg/qsvgwidget.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/svg/qsvgwidget.cpp b/src/svg/qsvgwidget.cpp index a4200ca..ac8595f 100644 --- a/src/svg/qsvgwidget.cpp +++ b/src/svg/qsvgwidget.cpp @@ -83,18 +83,6 @@ class QSvgWidgetPrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QSvgWidget) public: - QSvgWidgetPrivate() - : QWidgetPrivate() - { - Q_Q(QSvgWidget); - renderer = new QSvgRenderer(q); - } - QSvgWidgetPrivate(const QString &file) - : QWidgetPrivate() - { - Q_Q(QSvgWidget); - renderer = new QSvgRenderer(file, q); - } QSvgRenderer *renderer; }; @@ -104,6 +92,7 @@ public: QSvgWidget::QSvgWidget(QWidget *parent) : QWidget(*new QSvgWidgetPrivate, parent, 0) { + d_func()->renderer = new QSvgRenderer(this); QObject::connect(d_func()->renderer, SIGNAL(repaintNeeded()), this, SLOT(update())); } @@ -113,8 +102,9 @@ QSvgWidget::QSvgWidget(QWidget *parent) of the specified \a file. */ QSvgWidget::QSvgWidget(const QString &file, QWidget *parent) - : QWidget(*new QSvgWidgetPrivate(file), parent, 0) + : QWidget(*new QSvgWidgetPrivate, parent, 0) { + d_func()->renderer = new QSvgRenderer(file, this); QObject::connect(d_func()->renderer, SIGNAL(repaintNeeded()), this, SLOT(update())); } -- cgit v0.12 From 99d243860548d6be8a68dfd027c51530351d12cb Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 23 Apr 2009 08:48:15 +0200 Subject: Removed dead code. Reviewed-by: TrustMe --- src/gui/kernel/qshortcutmap.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 9766a69..415d71e 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -359,8 +359,6 @@ bool QShortcutMap::tryShortcutEvent(QObject *o, QKeyEvent *e) else e->ignore(); - int identicalMatches = d->identicals.count(); - switch(result) { case QKeySequence::NoMatch: return stateWasAccepted; -- cgit v0.12 From 389c4fdebe681eb3af5a2431c390323f52a03c17 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 23 Apr 2009 09:24:23 +0200 Subject: Carbon/Cocoa: It is possible to resize a widget above its maximum size This is not strange since we never did anything to limit a resize within the max min boundries. This patch factores out the code that ensures this into a private function that is called both as a reaction to a resize event, but also if resize is done programatically. Task-number: 251893 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 88 ++++++++++++++++++++++++------------------- src/gui/kernel/qwidget_p.h | 1 + 2 files changed, 50 insertions(+), 39 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 37dc79c..a00f969 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4001,6 +4001,33 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &oldRect) } } +void QWidgetPrivate::applyMaxAndMinSizeConstraints(int &w, int &h) +{ + if (QWExtra *extra = extraData()) { + w = qMin(w, extra->maxw); + h = qMin(h, extra->maxh); + w = qMax(w, extra->minw); + h = qMax(h, extra->minh); + + // Deal with size increment + if (QTLWExtra *top = topData()) { + if(top->incw) { + w = w/top->incw; + w *= top->incw; + } + if(top->inch) { + h = h/top->inch; + h *= top->inch; + } + } + } + + if (isRealWindow()) { + w = qMax(0, w); + h = qMax(0, h); + } +} + void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) { Q_Q(QWidget); @@ -4011,7 +4038,9 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) QMacCocoaAutoReleasePool pool; bool realWindow = isRealWindow(); + if (realWindow && !(w == 0 && h == 0) && !q->testAttribute(Qt::WA_DontShowOnScreen)) { + applyMaxAndMinSizeConstraints(w, h); topData()->isSetGeometry = 1; topData()->isMove = isMove; #ifndef QT_MAC_USE_COCOA @@ -4037,10 +4066,26 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM { Q_Q(QWidget); bool realWindow = isRealWindow(); - if(QWExtra *extra = extraData()) { // any size restrictions? - if(realWindow) { + + QPoint oldp = q->pos(); + QSize olds = q->size(); + const bool isResize = (olds != QSize(w, h)); + + if (!realWindow && !isResize && QPoint(x, y) == oldp) + return; + + if (isResize) + data.window_state = data.window_state & ~Qt::WindowMaximized; + + const bool visible = q->isVisible(); + data.crect = QRect(x, y, w, h); + + if (realWindow) { + if (QWExtra *extra = extraData()) { + applyMaxAndMinSizeConstraints(w, h); qt_mac_update_sizer(q); - if(q->windowFlags() & Qt::WindowMaximizeButtonHint) { + + if (q->windowFlags() & Qt::WindowMaximizeButtonHint) { #ifndef QT_MAC_USE_COCOA OSWindowRef window = qt_mac_window_for(q); if(extra->maxw && extra->maxh && extra->maxw == extra->minw @@ -4051,43 +4096,8 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM } #endif } - } - - w = qMin(w,extra->maxw); - h = qMin(h,extra->maxh); - w = qMax(w,extra->minw); - h = qMax(h,extra->minh); - - // Deal with size increment - if(QTLWExtra *top = topData()) { - if(top->incw) { - w = w/top->incw; - w *= top->incw; - } - if(top->inch) { - h = h/top->inch; - h *= top->inch; - } - } - } - - if (realWindow) { - w = qMax(0, w); - h = qMax(0, h); - } - - QPoint oldp = q->pos(); - QSize olds = q->size(); - const bool isResize = (olds != QSize(w, h)); - if(!realWindow && !isResize && QPoint(x, y) == oldp) - return; - if(isResize && q->isMaximized()) - data.window_state = data.window_state & ~Qt::WindowMaximized; - const bool visible = q->isVisible(); - data.crect = QRect(x, y, w, h); - if(realWindow) { - if(QWExtra *extra = extraData()) { //set constraints + // Update max and min constraints: const float max_f(20000); #ifndef QT_MAC_USE_COCOA #define SF(x) ((x > max_f) ? max_f : x) diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 9e93f66..423e833 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -257,6 +257,7 @@ public: void macUpdateIsOpaque(); void setEnabled_helper_sys(bool enable); bool isRealWindow() const; + void applyMaxAndMinSizeConstraints(int &w, int &h); #endif void raise_sys(); -- cgit v0.12