From 39721ae5cce44c3ea77d96a47d60aff54a91ad5c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 20 Jul 2010 08:54:36 +0200 Subject: Add a testcase for when peeking and then reading from a QIODevice This case was broken and then fixed again recently, this testcase should ensure that it does not break again in the future. Reviewed-by: Andreas Kling --- tests/auto/qiodevice/tst_qiodevice.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp index 356e2f8..7048754 100644 --- a/tests/auto/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/qiodevice/tst_qiodevice.cpp @@ -72,6 +72,7 @@ private slots: void read_QByteArray(); void unget(); void peek(); + void peekAndRead(); void getch(); void putch(); @@ -354,6 +355,31 @@ void tst_QIODevice::peek() QFile::remove("peektestfile"); } +void tst_QIODevice::peekAndRead() +{ + QByteArray originalData; + for (int i=0;i<1000;i++) + originalData += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + QBuffer buffer; + QFile::remove("peektestfile"); + QFile file("peektestfile"); + + for (int i = 0; i < 2; ++i) { + QByteArray readData; + QIODevice *device = i ? (QIODevice *)&file : (QIODevice *)&buffer; + device->open(QBuffer::ReadWrite); + device->write(originalData); + device->seek(0); + while (!device->atEnd()) { + char peekIn[26]; + device->peek(peekIn, 26); + readData += device->read(26); + } + QCOMPARE(readData, originalData); + } + QFile::remove("peektestfile"); +} + void tst_QIODevice::getch() { #ifdef QT3_SUPPORT -- cgit v0.12 From b0998a44a5dc384a6cf65c1d5910cb3dd40620cf Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Tue, 20 Jul 2010 10:33:36 +0200 Subject: Qt does not build with qt_namespace on macos The problem was that the QT_BEGIN_NAMESPACE was in the wrong place. I moved it 10 lines before and the problem is gone. Task-number: QTBUG-12262 Reviewed-by: Prasanth --- src/network/ssl/qsslsocket_openssl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index c297eea..b4d030c 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -59,6 +59,8 @@ #include #include // for loading the security lib for the CA store +QT_BEGIN_NAMESPACE + #if defined(Q_OS_MAC) #define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0; @@ -72,8 +74,6 @@ #include #endif -QT_BEGIN_NAMESPACE - bool QSslSocketPrivate::s_libraryLoaded = false; bool QSslSocketPrivate::s_loadedCiphersAndCerts = false; -- cgit v0.12 From 8517f787b798d9e300438404aab359de2acc0978 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 20 Jul 2010 11:23:25 +0200 Subject: Fix a Headerview layout bug When the sections were moved calling logicalIndex on what was already a logical index messed up the hidden sections. Task-number: QTBUG-12268 Reviewed-by: Gabriel --- src/gui/itemviews/qheaderview.cpp | 2 +- tests/auto/qheaderview/tst_qheaderview.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index cd9ee15..67854a3 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1871,7 +1871,7 @@ void QHeaderViewPrivate::_q_layoutChanged() for (int i = 0; i < oldSectionHidden.count(); ++i) { if (oldSectionHidden.testBit(i)) - q->setSectionHidden(logicalIndex(i), false); + q->setSectionHidden(i, false); } // the number of sections changed; we need to reread the state of the model diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index f6cd4e3..da0a0bb 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -193,6 +193,7 @@ private slots: void QTBUG6058_reset(); void QTBUG7833_sectionClicked(); void QTBUG8650_crashOnInsertSections(); + void QTBUG12268_hiddenMovedSectionSorting(); protected: QHeaderView *view; @@ -2071,5 +2072,25 @@ void tst_QHeaderView::QTBUG8650_crashOnInsertSections() model.insertColumn(0, items); } +void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting() +{ + QTableView view; + QStandardItemModel *model = new QStandardItemModel(4,3, &view); + for (int i = 0; i< model->rowCount(); ++i) + for (int j = 0; j< model->columnCount(); ++j) + model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j)); + view.setModel(model); + view.horizontalHeader()->setMovable(true); + view.setSortingEnabled(true); + view.sortByColumn(1, Qt::AscendingOrder); + view.horizontalHeader()->moveSection(0,2); + view.setColumnHidden(1, true); + view.show(); + QTest::qWaitForWindowShown(&view); + QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1); + QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton); + QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1); +} + QTEST_MAIN(tst_QHeaderView) #include "tst_qheaderview.moc" -- cgit v0.12 From ebcb490b3e179157a886474c86597984b346abe3 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 20 Jul 2010 13:32:40 +0200 Subject: My 4.7.0 changes My 4.7.0 changes --- dist/changes-4.7.0 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index c19bf15..5f585c1 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -32,7 +32,10 @@ New features - QNetworkSession, QNetworkConfiguration, QNetworkConfigurationManager * New bearer management classes added. - + + - QStaticText class was added to support high-performance output of + seldomly altered text. + Third party components ---------------------- @@ -74,14 +77,14 @@ QtCore QtGui ----- - + - QAbstractItemView * Fixed a bug that would cause keyboard searches not to behave properly when used within 400 milliseconds of midnight. - QComboBox * [QTBUG-8796] Made ForegroundRole work for all styles. - + - QPrinter * Obsoleted the slightly confusing setNumCopies() and numCopies() functions, and replaced them with setCopyCount(), copyCount() and @@ -156,10 +159,28 @@ QtGui - QSplitter * [QTBUG-9335] Improve support for 1-pixel splitters by using a larger drag area. - + + - QTextDocumentWriter + * Fixed tab-stops and table padding in ODF export. + + - QTextLayout + * [QTBUG-11427] Fix possible crash in QTextLayout for glyphless + items. + * [QTBUG-8864] Fix regression in right alignment of text with + negative right bearing. + - QTransform * [QTBUG-8557] Fixed bug in QTransform::type() potentially occuring after using operator/ or operator* or their overloads. + +QtOpenGL +-------- + - Improve performance of text by adding special cased fragment shader. + + - Made width and height of glyph cache power-of-two for performance + improvements on some hardware. + + - [QTBUG-9706] Improved appearance of text antialiasing. QtNetwork --------- @@ -234,7 +255,19 @@ Qt for Linux/X11 - QGtkStyle * Fixed rtl issues with sliders (QTBUG-8986) * Fixed missing pressed appearance on scroll bar handles. (QTBUG-10396) - + + - QFontDatabase + * [QTBUG-4428] Fixed regression when using bitmap fonts on some + Linux systems. + + - QFontEngine + * [QTBUG-9442] Avoid possible square root of negative number in + FreeType font engine. + + - QFontMetrics + * [QTBUG-10448] Fix crash when using fonts in non-gui QApplication. + + Qt for Windows -------------- - Popup windows now implicitly activate when shown. (QTBUG-7386) @@ -252,6 +285,20 @@ Qt for Mac OS X * Removed frame around statusbar items. (QTBUG-3574) * More native appearance of item view headers and frames. (QTBUG-10047) + - QFontEngine + * Enable fractional metrics for the font engine on Mac in all + stages of text layout. + * [QTBUG-5529] Enable design metrics for correct character spacing + in ATSUI font engine. (Mac/Carbon) + +- QTextDocument + * [QTBUG-8791] Fix misalignment of fixed width fonts between + format changes on Cocoa. + + - QTextLayout + * [QTBUG-9879] Fix off-by-one in vertical position for elided and + non-elided text. + Qt for Embedded Linux --------------------- -- cgit v0.12