From 4645c7861804b3e22333ba29244b6ee4a60175b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 16 Jun 2009 15:52:51 +0200 Subject: Blank out the Qt-3 area license headers in the qt3to4 resources. Avoid triggering the license checks in Qt 4. Replace characters between "/*" and "*/" with a space. Reviewed-by: Trust Me --- tools/porting/src/qt3headers0.resource | Bin 547809 -> 548362 bytes tools/porting/src/qt3headers1.resource | Bin 512251 -> 512882 bytes tools/porting/src/qt3headers2.resource | Bin 392439 -> 393093 bytes tools/porting/src/qt3headers3.resource | Bin 553089 -> 553753 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tools/porting/src/qt3headers0.resource b/tools/porting/src/qt3headers0.resource index 13be468..8e24385 100644 Binary files a/tools/porting/src/qt3headers0.resource and b/tools/porting/src/qt3headers0.resource differ diff --git a/tools/porting/src/qt3headers1.resource b/tools/porting/src/qt3headers1.resource index e06d270..8da4b9a 100644 Binary files a/tools/porting/src/qt3headers1.resource and b/tools/porting/src/qt3headers1.resource differ diff --git a/tools/porting/src/qt3headers2.resource b/tools/porting/src/qt3headers2.resource index e44c81d..62bdb8e 100644 Binary files a/tools/porting/src/qt3headers2.resource and b/tools/porting/src/qt3headers2.resource differ diff --git a/tools/porting/src/qt3headers3.resource b/tools/porting/src/qt3headers3.resource index 6d259f2..6a096e8 100644 Binary files a/tools/porting/src/qt3headers3.resource and b/tools/porting/src/qt3headers3.resource differ -- cgit v0.12 From f2f9babce5d7910f76aa47f5c446ccd0f9f23ac1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 16 Jun 2009 17:29:22 +0200 Subject: revert built-time qm generation it simply breaks too much (embedded builds in particular). will come up with something better in master. note however, that the .qm files do NOT return to the repository. the release manager needs to run "make qm" before packaging, just like Qt-from-git users who want translations do (i.e., almost nobody). Reviewed-by: Jason McDonald --- configure | 4 ---- configure.exe | Bin 856064 -> 856064 bytes projects.pro | 7 +----- tools/configure/configureapp.cpp | 1 - translations/translations.pri | 38 ++++++++++++++++++++++++++--- translations/translations.pro | 50 --------------------------------------- 6 files changed, 36 insertions(+), 64 deletions(-) delete mode 100644 translations/translations.pro diff --git a/configure b/configure index 336b7cf..e58180a 100755 --- a/configure +++ b/configure @@ -7050,9 +7050,6 @@ FNR == 1 { if ( \$3 == "moc" || \$3 ~ /^Qt/ ) { target_file = first matched_target = 1 - } else if ( \$3 == "lrelease" || \$3 == "qm_phony_target" ) { - target_file = second - matched_target = 1 } } @@ -7137,7 +7134,6 @@ for part in $CFG_BUILD_PARTS; do case "$part" in tools) PART_ROOTS="$PART_ROOTS tools" ;; libs) PART_ROOTS="$PART_ROOTS src" ;; - translations) PART_ROOTS="$PART_ROOTS tools/linguist/lrelease translations" ;; examples) PART_ROOTS="$PART_ROOTS examples demos" ;; *) ;; esac diff --git a/configure.exe b/configure.exe index c7e09fc..9da5c60 100644 Binary files a/configure.exe and b/configure.exe differ diff --git a/projects.pro b/projects.pro index fc53100..f6c596d 100644 --- a/projects.pro +++ b/projects.pro @@ -41,12 +41,7 @@ for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) { } else:isEqual(PROJECT, docs) { contains(QT_BUILD_PARTS, tools):include(doc/doc.pri) } else:isEqual(PROJECT, translations) { - contains(QT_BUILD_PARTS, tools) { - include(translations/translations.pri) # ts targets - } else { - SUBDIRS += tools/linguist/lrelease - } - SUBDIRS += translations # qm build step + contains(QT_BUILD_PARTS, tools):include(translations/translations.pri) } else:isEqual(PROJECT, qmake) { # SUBDIRS += qmake } else { diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c01ea38..b9acdb1 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3142,7 +3142,6 @@ void Configure::buildHostTools() << "src/tools/moc" << "src/tools/rcc" << "src/tools/uic" - << "tools/linguist/lrelease" << "tools/checksdk"; if (dictionary[ "CETEST" ] == "yes") diff --git a/translations/translations.pri b/translations/translations.pri index c143043..0c5c1ee 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -8,8 +8,16 @@ defineReplace(prependAll) { return ($$result) } -LUPDATE = $$QT_BUILD_TREE/bin/lupdate -locations relative -no-ui-lines -win32:LUPDATE ~= s|/|\|g +defineReplace(fixPath) { +WIN { + return ($$replace($$1, /, \)) +} ELSE { + return ($$1) +} +} + +LUPDATE = $$fixPath($$QT_BUILD_TREE/bin/lupdate) -locations relative -no-ui-lines +LRELEASE = $$fixPath($$QT_BUILD_TREE/bin/lrelease) ###### Qt Libraries @@ -33,18 +41,27 @@ ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ -ts $$prependAll($$[QT_INSTALL_TRANSLATIONS]/qt_,$$QT_TS,.ts)) ts-qt.depends = sub-tools +qm-qt.commands = $$LRELEASE $$prependAll($$[QT_INSTALL_TRANSLATIONS]/qt_,$$QT_TS,.ts) +qm-qt.depends = sub-tools + ###### Designer ts-designer.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/designer/translations/translations.pro) ts-designer.depends = sub-tools +qm-designer.commands = $$LRELEASE $$QT_SOURCE_TREE/tools/designer/translations/translations.pro +qm-designer.depends = sub-tools + ###### Linguist ts-linguist.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/linguist/linguist/linguist.pro) ts-linguist.depends = sub-tools +qm-linguist.commands = $$LRELEASE $$QT_SOURCE_TREE/tools/linguist/linguist/linguist.pro +qm-linguist.depends = sub-tools + ###### Assistant ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ @@ -55,21 +72,36 @@ ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/assistant/translations/translations_adp.pro) ts-assistant.depends = sub-tools +qm-assistant.commands = ($$LRELEASE $$QT_SOURCE_TREE/tools/assistant/translations/translations.pro \ + && $$LRELEASE \ + $$QT_SOURCE_TREE/tools/assistant/translations/qt_help.pro \ + && $$LRELEASE \ + $$QT_SOURCE_TREE/tools/assistant/translations/translations_adp.pro) +qm-assistant.depends = sub-tools + ###### Qtconfig ts-qtconfig.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/qtconfig/translations/translations.pro) ts-qtconfig.depends = sub-tools +qm-qtconfig.commands = $$LRELEASE $$QT_SOURCE_TREE/tools/qtconfig/translations/translations.pro +qm-qtconfig.depends = sub-tools + ###### Qvfp ts-qvfb.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/qvfb/translations/translations.pro) ts-qvfb.depends = sub-tools +qm-qvfb.commands = $$LRELEASE $$QT_SOURCE_TREE/tools/qvfb/translations/translations.pro +qm-qvfb.depends = sub-tools + ###### Overall Rules ts.depends = ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb +qm.depends = qm-qt qm-designer qm-linguist qm-assistant qm-qtconfig qm-qvfb QMAKE_EXTRA_TARGETS += ts-qt ts-designer ts-linguist ts-assistant ts-qtconfig ts-qvfb \ - ts + qm-qt qm-designer qm-linguist qm-assistant qm-qtconfig qm-qvfb \ + ts qm diff --git a/translations/translations.pro b/translations/translations.pro deleted file mode 100644 index 6f14108..0000000 --- a/translations/translations.pro +++ /dev/null @@ -1,50 +0,0 @@ -TRANSLATIONS = $$files(*.ts) - -LRELEASE = $$QT_BUILD_TREE/bin/lrelease -win32 { - LRELEASE ~= s|/|\|g -} else:!static { - path = $$QT_BUILD_TREE/lib - !macx:var = LD_LIBRARY_PATH - else:qt_no_framework:var = DYLD_LIBRARY_PATH - else:var = DYLD_FRAMEWORK_PATH - - LRELEASE = test -z \"\$\$$$var\" && $$var=$$path || $$var=$$path:\$\$$$var; export $$var; $$LRELEASE -} - -contains(TEMPLATE_PREFIX, vc):vcproj = 1 - -TEMPLATE = app -TARGET = qm_phony_target -CONFIG -= qt separate_debug_info -QT = -LIBS = - -updateqm.input = TRANSLATIONS -updateqm.output = ${QMAKE_FILE_BASE}.qm -isEmpty(vcproj):updateqm.variable_out = PRE_TARGETDEPS -updateqm.commands = @echo lrelease ${QMAKE_FILE_IN}; $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} -updateqm.name = LRELEASE ${QMAKE_FILE_IN} -updateqm.CONFIG += no_link -QMAKE_EXTRA_COMPILERS += updateqm - -isEmpty(vcproj) { - QMAKE_LINK = @: IGNORE THIS LINE - OBJECTS_DIR = - win32:CONFIG -= embed_manifest_exe -} else { - CONFIG += console - PHONY_DEPS = . - phony_src.input = PHONY_DEPS - phony_src.output = phony.c - phony_src.variable_out = GENERATED_SOURCES - phony_src.commands = echo int main() { return 0; } > phony.c - phony_src.name = CREATE phony.c - phony_src.CONFIG += combine - QMAKE_EXTRA_COMPILERS += phony_src -} - -translations.path = $$[QT_INSTALL_TRANSLATIONS] -translations.files = $$TRANSLATIONS -translations.files ~= s,\\.ts$,.qm,g -INSTALLS += translations -- cgit v0.12 From eb80cebd25020e26f9f4d0111f53f2246c503194 Mon Sep 17 00:00:00 2001 From: Derick Hawcroft Date: Wed, 17 Jun 2009 09:02:29 +1000 Subject: add SqlQuery unit test for task: 234422 --- tests/auto/qsqlquery/tst_qsqlquery.cpp | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index d17706b..825db6c 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -177,9 +177,10 @@ private slots: #ifdef NOT_READY_YET void task_217003_data() { generic_data(); } void task_217003(); - void task_229811(); void task_229811_data() { generic_data(); } + void task_234422_data() { generic_data(); } + void task_234422(); #endif void task_250026_data() { generic_data("QODBC"); } void task_250026(); @@ -2775,6 +2776,44 @@ void tst_QSqlQuery::task_229811() q.exec("DROP TABLE " + tableName ); } + +void tst_QSqlQuery::task_234422() +{ + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + + QSqlQuery query(db); + QStringList m_airlines; + QStringList m_countries; + + m_airlines << "Lufthansa" << "SAS" << "United" << "KLM" << "Aeroflot"; + m_countries << "DE" << "SE" << "US" << "NL" << "RU"; + + QString tableName = qTableName( "task_234422" ); + + query.exec("DROP TABLE " + tableName); + QVERIFY_SQL(query,exec("CREATE TABLE " + tableName + " (id int primary key, " + "name varchar(20), homecountry varchar(2))")); + for (int i = 0; i < m_airlines.count(); ++i) { + QVERIFY(query.exec(QString("INSERT INTO " + tableName + " values(%1, '%2', '%3')") + .arg(i).arg(m_airlines[i], m_countries[i]))); + } + + QVERIFY_SQL(query, exec("SELECT name FROM " + tableName)); + QVERIFY(query.isSelect()); + QVERIFY(query.first()); + QVERIFY(query.next()); + QCOMPARE(query.at(), 1); + + QSqlQuery query2(query); + + QVERIFY_SQL(query2,exec()); + QVERIFY(query2.first()); + QCOMPARE(query2.at(), 0); + QCOMPARE(query.at(), 1); +} + #endif QTEST_MAIN( tst_QSqlQuery ) -- cgit v0.12 From e5b32fbe0efc8b6b688374fde3fc1c01fe685d98 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 16 Jun 2009 17:45:20 +0200 Subject: Fixed a bottleneck in itemviews that would ask for an update outside of the boundaries of the viewport. Now we catch this and don't call update. This was a performance regression against 4.4. Task-number: 256183 Reviewed-by: alexis --- src/gui/itemviews/qabstractitemview.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 5673019..c3d1bf7 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2901,8 +2901,14 @@ void QAbstractItemView::scrollToBottom() void QAbstractItemView::update(const QModelIndex &index) { Q_D(QAbstractItemView); - if (index.isValid()) - d->viewport->update(visualRect(index)); + if (index.isValid()) { + const QRect rect = visualRect(index); + //this test is important for peformance reason + //For example in dataChanged we simply update all the cells without checking + //it can be a major bottleneck to update rects that aren't even part of the viewport + if (d->viewport->geometry().intersects(rect)) + d->viewport->update(rect); + } } /*! -- cgit v0.12 From a54c18e27bbb14872abd0559c268ba33b1265703 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 17 Jun 2009 10:42:26 +0200 Subject: ItemViews : Fixed a performance regression whne changing data in the model This is a part of a bigger patch from 4.6 90cdbf8bd409652fd1e28adcd7f02fc1fae2c1c0 Task-number: 256183 Reviewed-by: ogoffart --- src/gui/itemviews/qabstractitemview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index c3d1bf7..8594968 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2932,7 +2932,7 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde } if (isVisible() && !d->delayedPendingLayout) { // otherwise the items will be update later anyway - d->viewport->update(visualRect(topLeft)); + update(topLeft); } return; } -- cgit v0.12 From b56095c51087717c0797f64abf3c4200066348b8 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 17 Jun 2009 18:52:23 +1000 Subject: BT: Remove Intel CC 10 issue from known issues doc. Acked-by: Andy Shaw --- doc/src/known-issues.qdoc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/src/known-issues.qdoc b/doc/src/known-issues.qdoc index e005b14..9c90908 100644 --- a/doc/src/known-issues.qdoc +++ b/doc/src/known-issues.qdoc @@ -58,13 +58,6 @@ \section1 Issues with Third Party Software - \section2 Intel Compiler Support - - Although it is possible to build applications against Qt 4.5.x using Intel - CC 10, these applications will crash when run. We recommend that developers - who rely on this compiler wait until a fix is available before upgrading to - the Qt 4.5.x series of releases. - \section2 X11 Hardware Support \list -- cgit v0.12 From 24580f35a58390b4177aef8edef1192dc05f8ac2 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Jun 2009 11:25:30 +0200 Subject: perform all property assignments of initial state that's nested If the machine's initial state is nested, a set of states will be entered, and we need to do the property assignments of all of them. --- src/corelib/statemachine/qstatemachine.cpp | 4 ++-- tests/auto/qstatemachine/tst_qstatemachine.cpp | 30 ++++++++++++++++---------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 04cce50..758bdbe 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1171,9 +1171,9 @@ void QStateMachinePrivate::_q_start() transitions.append(initialTransition); QEvent nullEvent(QEvent::None); executeTransitionContent(&nullEvent, transitions); - enterStates(&nullEvent, transitions); + QList enteredStates = enterStates(&nullEvent, transitions); applyProperties(transitions, QList() << start, - QList() << initial); + enteredStates); delete start; #ifdef QSTATEMACHINE_DEBUG diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 9bccb97..cd0c71d 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1269,25 +1269,33 @@ void tst_QStateMachine::assignProperty() s1->addTransition(s2); machine.setInitialState(s1); machine.start(); - QCoreApplication::processEvents(); - QCOMPARE(s1->objectName(), QString::fromLatin1("s1")); + QTRY_COMPARE(s1->objectName(), QString::fromLatin1("s1")); s1->assignProperty(s1, "objectName", "foo"); machine.start(); - QCoreApplication::processEvents(); - QCOMPARE(s1->objectName(), QString::fromLatin1("foo")); + QTRY_COMPARE(s1->objectName(), QString::fromLatin1("foo")); s1->assignProperty(s1, "noSuchProperty", 123); machine.start(); - QCoreApplication::processEvents(); - QCOMPARE(s1->objectName(), QString::fromLatin1("foo")); - QCOMPARE(s1->dynamicPropertyNames().size(), 1); + QTRY_COMPARE(s1->dynamicPropertyNames().size(), 1); QCOMPARE(s1->dynamicPropertyNames().at(0), QByteArray("noSuchProperty")); + QCOMPARE(s1->objectName(), QString::fromLatin1("foo")); - QSignalSpy polishedSpy(s1, SIGNAL(polished())); - machine.start(); - QCoreApplication::processEvents(); - QCOMPARE(polishedSpy.count(), 1); + { + QSignalSpy polishedSpy(s1, SIGNAL(polished())); + machine.start(); + QTRY_COMPARE(polishedSpy.count(), 1); + } + + // nested states + { + QState *s11 = new QState(s1); + QString str = QString::fromLatin1("set by nested state"); + s11->assignProperty(s11, "objectName", str); + s1->setInitialState(s11); + machine.start(); + QTRY_COMPARE(s11->objectName(), str); + } } void tst_QStateMachine::assignPropertyWithAnimation() -- cgit v0.12 From fa8030a935acaacee570eee320e7510a4cfdc853 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Wed, 17 Jun 2009 11:36:40 +0200 Subject: Speed up QPixmap::width(), height(), isNull() and depth(). This change moves the w, h, d variables to QPixmapData and introduces is_null to keep track of nullness. This is possible only because QPixmapData is internal API; otherwise we'd have to be smarter. The optimization makes the QPixmap::width() function take 7 instructions, down from 34 before. For the calculator demo in the declarative ui branch this reduces a block of 750000 instructions (out of 30000000) to around 100000-150000 instructions. Tested on Windows, Linux, Mac. Raster, X11 and OpenGL paint engines. Have not tested the DirectFB engine. Reviewed-by: Trond --- src/gui/image/qpixmap.cpp | 2 +- src/gui/image/qpixmap.h | 6 +-- src/gui/image/qpixmap_mac.cpp | 5 +- src/gui/image/qpixmap_mac_p.h | 1 - src/gui/image/qpixmap_raster.cpp | 14 +++-- src/gui/image/qpixmap_x11.cpp | 10 +++- src/gui/image/qpixmap_x11_p.h | 2 - src/gui/image/qpixmapdata.cpp | 12 ++++- src/gui/image/qpixmapdata_p.h | 13 +++-- src/opengl/qpixmapdata_gl.cpp | 60 ++++++++++++---------- src/opengl/qpixmapdata_gl_p.h | 7 +-- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 8 +++ 12 files changed, 88 insertions(+), 52 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 6da291c..56c3a29 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -552,7 +552,7 @@ bool QPixmap::isQBitmap() const */ bool QPixmap::isNull() const { - return data->width() == 0; + return data->isNull(); } /*! diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index e4faebd..d1e2ecb 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -79,11 +79,11 @@ public: QPixmap &operator=(const QPixmap &); operator QVariant() const; - bool isNull() const; + bool isNull() const; // ### Qt 5: make inline int devType() const; - int width() const; - int height() const; + int width() const; // ### Qt 5: make inline + int height() const; // ### Qt 5: make inline QSize size() const; QRect rect() const; int depth() const; diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index ca9d497..b40694a 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -168,7 +168,7 @@ static inline QRgb qt_conv16ToRgb(ushort c) { QSet QMacPixmapData::validDataPointers; QMacPixmapData::QMacPixmapData(PixelType type) - : QPixmapData(type, MacClass), w(0), h(0), d(0), has_alpha(0), has_mask(0), + : QPixmapData(type, MacClass), has_alpha(0), has_mask(0), uninit(true), pixels(0), pixelsToFree(0), bytesPerRow(0), cg_data(0), cg_dataBeingReleased(0), cg_mask(0), #ifndef QT_MAC_NO_QUICKDRAW @@ -188,11 +188,13 @@ void QMacPixmapData::resize(int width, int height) w = width; h = height; + is_null = (w <= 0 || h <= 0); d = (pixelType() == BitmapType ? 1 : 32); bool make_null = w <= 0 || h <= 0; // create null pixmap if (make_null || d == 0) { w = 0; h = 0; + is_null = true; d = 0; if (!make_null) qWarning("Qt: QPixmap: Invalid pixmap parameters"); @@ -231,6 +233,7 @@ void QMacPixmapData::fromImage(const QImage &img, w = img.width(); h = img.height(); + is_null = (w <= 0 || h <= 0); d = (pixelType() == BitmapType ? 1 : img.depth()); QImage image = img; diff --git a/src/gui/image/qpixmap_mac_p.h b/src/gui/image/qpixmap_mac_p.h index 66797ed..a3ff0d3 100644 --- a/src/gui/image/qpixmap_mac_p.h +++ b/src/gui/image/qpixmap_mac_p.h @@ -83,7 +83,6 @@ public: QPaintEngine* paintEngine() const; private: - int w, h, d; uint has_alpha : 1, has_mask : 1, uninit : 1; diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 2c57ede..9cc896b 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -85,6 +85,10 @@ void QRasterPixmapData::resize(int width, int height) #endif image = QImage(width, height, format); + w = width; + h = height; + d = image.depth(); + is_null = (w <= 0 || h <= 0); if (pixelType() == BitmapType && !image.isNull()) { image.setNumColors(2); @@ -168,6 +172,10 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage, } } #endif + w = image.d->width; + h = image.d->height; + d = image.d->depth; + is_null = (w <= 0 || h <= 0); setSerialNumber(image.serialNumber()); } @@ -329,9 +337,9 @@ int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const // override the image dpi with the screen dpi when rendering to a pixmap switch (metric) { case QPaintDevice::PdmWidth: - return d->width; + return w; case QPaintDevice::PdmHeight: - return d->height; + return h; case QPaintDevice::PdmWidthMM: return qRound(d->width * 25.4 / qt_defaultDpiX()); case QPaintDevice::PdmHeightMM: @@ -339,7 +347,7 @@ int QRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const case QPaintDevice::PdmNumColors: return d->colortable.size(); case QPaintDevice::PdmDepth: - return d->depth; + return this->d; case QPaintDevice::PdmDpiX: // fall-through case QPaintDevice::PdmPhysicalDpiX: return qt_defaultDpiX(); diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index b7fe92a..86cf515 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -312,7 +312,7 @@ static int qt_pixmap_serial = 0; int Q_GUI_EXPORT qt_x11_preferred_pixmap_depth = 0; QX11PixmapData::QX11PixmapData(PixelType type) - : QPixmapData(type, X11Class), hd(0), w(0), h(0), d(0), + : QPixmapData(type, X11Class), hd(0), uninit(true), read_only(false), x11_mask(0), picture(0), mask_picture(0), hd2(0), share_mode(QPixmap::ImplicitlyShared), pengine(0) { @@ -324,6 +324,7 @@ void QX11PixmapData::resize(int width, int height) w = width; h = height; + is_null = (w <= 0 || h <= 0); if (defaultScreen >= 0 && defaultScreen != xinfo.screen()) { QX11InfoData* xd = xinfo.getX11Data(true); @@ -347,6 +348,7 @@ void QX11PixmapData::resize(int width, int height) if (make_null || d == 0) { w = 0; h = 0; + is_null = true; hd = 0; picture = 0; d = 0; @@ -375,6 +377,7 @@ void QX11PixmapData::fromImage(const QImage &img, w = img.width(); h = img.height(); d = img.depth(); + is_null = (w <= 0 || h <= 0); if (defaultScreen >= 0 && defaultScreen != xinfo.screen()) { QX11InfoData* xd = xinfo.getX11Data(true); @@ -395,6 +398,7 @@ void QX11PixmapData::fromImage(const QImage &img, if (uint(w) >= 32768 || uint(h) >= 32768) { w = h = 0; + is_null = true; return; } @@ -1109,6 +1113,7 @@ void QX11PixmapData::bitmapFromImage(const QImage &image) w = img.width(); h = img.height(); d = 1; + is_null = (w <= 0 || h <= 0); int bpl = (w + 7) / 8; int ibpl = img.bytesPerLine(); if (bpl != ibpl) { @@ -1876,6 +1881,7 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform, x11Data->d = d; x11Data->w = w; x11Data->h = h; + x11Data->is_null = (w <= 0 || h <= 0); x11Data->hd = (Qt::HANDLE)XCreatePixmap(X11->display, RootWindow(X11->display, xinfo.screen()), w, h, d); @@ -2132,6 +2138,7 @@ void QX11PixmapData::copy(const QPixmapData *data, const QRect &rect) d = x11Data->d; w = rect.width(); h = rect.height(); + is_null = (w <= 0 || h <= 0); hd = (Qt::HANDLE)XCreatePixmap(X11->display, RootWindow(X11->display, x11Data->xinfo.screen()), w, h, d); @@ -2250,6 +2257,7 @@ QPixmap QPixmap::fromX11Pixmap(Qt::HANDLE pixmap, QPixmap::ShareMode mode) data->uninit = false; data->w = width; data->h = height; + data->is_null = (width <= 0 || height <= 0); data->d = depth; data->hd = pixmap; diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index addcc7c..3de9a0f 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -108,8 +108,6 @@ private: Qt::HANDLE hd; - int w, h; - short d; uint uninit : 1; uint read_only : 1; diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index 094d7e4..b50d664 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -49,9 +49,17 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; QPixmapData::QPixmapData(PixelType pixelType, int objectId) - : ref(0), detach_no(0), type(pixelType), id(objectId), ser_no(0), is_cached(false) + : w(0), + h(0), + d(0), + is_null(true), + ref(0), + detach_no(0), + type(pixelType), + id(objectId), + ser_no(0), + is_cached(false) { - } QPixmapData::~QPixmapData() diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index 4c49dd2..29dafaf 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -99,13 +99,18 @@ public: virtual QImage* buffer(); - int width() const { return metric(QPaintDevice::PdmWidth); } - int height() const { return metric(QPaintDevice::PdmHeight); } - int numColors() const { return metric(QPaintDevice::PdmNumColors); } - int depth() const { return metric(QPaintDevice::PdmDepth); } + inline int width() const { return w; } + inline int height() const { return h; } + inline int numColors() const { return metric(QPaintDevice::PdmNumColors); } + inline int depth() const { return d; } + inline bool isNull() const { return is_null; } protected: void setSerialNumber(int serNo); + int w; + int h; + int d; + bool is_null; private: friend class QPixmap; diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index f745aae..8a2187c 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -96,8 +96,6 @@ static int qt_gl_pixmap_serial = 0; QGLPixmapData::QGLPixmapData(PixelType type) : QPixmapData(type, OpenGLClass) - , m_width(0) - , m_height(0) , m_renderFbo(0) , m_textureId(0) , m_engine(0) @@ -123,7 +121,7 @@ QGLPixmapData::~QGLPixmapData() bool QGLPixmapData::isValid() const { - return m_width > 0 && m_height > 0; + return w > 0 && h > 0; } bool QGLPixmapData::isValidContext(const QGLContext *ctx) const @@ -137,7 +135,7 @@ bool QGLPixmapData::isValidContext(const QGLContext *ctx) const void QGLPixmapData::resize(int width, int height) { - if (width == m_width && height == m_height) + if (width == w && height == h) return; if (width <= 0 || height <= 0) { @@ -145,8 +143,10 @@ void QGLPixmapData::resize(int width, int height) height = 0; } - m_width = width; - m_height = height; + w = width; + h = height; + is_null = (w <= 0 || h <= 0); + d = pixelType() == QPixmapData::PixmapType ? 32 : 1; if (m_textureId) { QGLShareContextScope ctx(qt_gl_share_widget()->context()); @@ -176,7 +176,7 @@ void QGLPixmapData::ensureCreated() const glGenTextures(1, &m_textureId); glBindTexture(target, m_textureId); GLenum format = m_hasAlpha ? GL_RGBA : GL_RGB; - glTexImage2D(target, 0, format, m_width, m_height, 0, + glTexImage2D(target, 0, format, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -186,7 +186,7 @@ void QGLPixmapData::ensureCreated() const const QImage tx = ctx->d_func()->convertToGLFormat(m_source, true, format); glBindTexture(target, m_textureId); - glTexSubImage2D(target, 0, 0, 0, m_width, m_height, format, + glTexSubImage2D(target, 0, 0, 0, w, h, format, GL_UNSIGNED_BYTE, tx.bits()); if (useFramebufferObjects()) @@ -202,7 +202,7 @@ QGLFramebufferObject *QGLPixmapData::fbo() const void QGLPixmapData::fromImage(const QImage &image, Qt::ImageConversionFlags) { - if (image.size() == QSize(m_width, m_height)) + if (image.size() == QSize(w, h)) setSerialNumber(++qt_gl_pixmap_serial); resize(image.width(), image.height()); @@ -218,6 +218,10 @@ void QGLPixmapData::fromImage(const QImage &image, m_hasFillColor = false; m_hasAlpha = image.hasAlphaChannel(); + w = image.width(); + h = image.height(); + is_null = (w <= 0 || h <= 0); + d = pixelType() == QPixmapData::PixmapType ? 32 : 1; if (m_textureId) { QGLShareContextScope ctx(qt_gl_share_widget()->context()); @@ -272,7 +276,7 @@ QImage QGLPixmapData::fillImage(const QColor &color) const { QImage img; if (pixelType() == BitmapType) { - img = QImage(m_width, m_height, QImage::Format_MonoLSB); + img = QImage(w, h, QImage::Format_MonoLSB); img.setNumColors(2); img.setColor(0, QColor(Qt::color0).rgba()); img.setColor(1, QColor(Qt::color1).rgba()); @@ -283,7 +287,7 @@ QImage QGLPixmapData::fillImage(const QColor &color) const else img.fill(1); } else { - img = QImage(m_width, m_height, + img = QImage(w, h, m_hasAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); @@ -310,7 +314,7 @@ QImage QGLPixmapData::toImage() const QGLShareContextScope ctx(qt_gl_share_widget()->context()); extern QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha); glBindTexture(GL_TEXTURE_2D, m_textureId); - return qt_gl_read_texture(QSize(m_width, m_height), true, true); + return qt_gl_read_texture(QSize(w, h), true, true); } struct TextureBuffer @@ -342,9 +346,9 @@ void QGLPixmapData::copyBackFromRenderFbo(bool keepCurrentFboBound) const GL_TEXTURE_2D, m_textureId, 0); const int x0 = 0; - const int x1 = m_width; + const int x1 = w; const int y0 = 0; - const int y1 = m_height; + const int y1 = h; glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, m_renderFbo->handle()); @@ -424,15 +428,15 @@ QPaintEngine* QGLPixmapData::paintEngine() const textureBufferStack << createTextureBuffer(size()); } else { QSize sz = textureBufferStack.at(currentTextureBuffer).fbo->size(); - if (sz.width() < m_width || sz.height() < m_height) { - if (sz.width() < m_width) - sz.setWidth(qMax(m_width, qRound(sz.width() * 1.5))); - if (sz.height() < m_height) - sz.setHeight(qMax(m_height, qRound(sz.height() * 1.5))); + if (sz.width() < w || sz.height() < h) { + if (sz.width() < w) + sz.setWidth(qMax(w, qRound(sz.width() * 1.5))); + if (sz.height() < h) + sz.setHeight(qMax(h, qRound(sz.height() * 1.5))); // wasting too much space? - if (sz.width() * sz.height() > m_width * m_height * 2.5) - sz = QSize(m_width, m_height); + if (sz.width() * sz.height() > w * h * 2.5) + sz = QSize(w, h); delete textureBufferStack.at(currentTextureBuffer).fbo; textureBufferStack[currentTextureBuffer] = @@ -470,7 +474,7 @@ GLuint QGLPixmapData::bind(bool copyBack) const } else { if (m_hasFillColor) { m_dirty = true; - m_source = QImage(m_width, m_height, QImage::Format_ARGB32_Premultiplied); + m_source = QImage(w, h, QImage::Format_ARGB32_Premultiplied); m_source.fill(PREMUL(m_fillColor.rgba())); m_hasFillColor = false; } @@ -493,22 +497,22 @@ extern int qt_defaultDpiY(); int QGLPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const { - if (m_width == 0) + if (w == 0) return 0; switch (metric) { case QPaintDevice::PdmWidth: - return m_width; + return w; case QPaintDevice::PdmHeight: - return m_height; + return h; case QPaintDevice::PdmNumColors: return 0; case QPaintDevice::PdmDepth: - return pixelType() == QPixmapData::PixmapType ? 32 : 1; + return d; case QPaintDevice::PdmWidthMM: - return qRound(m_width * 25.4 / qt_defaultDpiX()); + return qRound(w * 25.4 / qt_defaultDpiX()); case QPaintDevice::PdmHeightMM: - return qRound(m_height * 25.4 / qt_defaultDpiY()); + return qRound(h * 25.4 / qt_defaultDpiY()); case QPaintDevice::PdmDpiX: case QPaintDevice::PdmPhysicalDpiX: return qt_defaultDpiX(); diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index 605b25b..a6aa22d 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -94,9 +94,7 @@ public: bool needsFill() const { return m_hasFillColor; } QColor fillColor() const { return m_fillColor; } - QSize size() const { return QSize(m_width, m_height); } - int width() const { return m_width; } - int height() const { return m_height; } + QSize size() const { return QSize(w, h); } QGLFramebufferObject *fbo() const; @@ -117,9 +115,6 @@ private: QImage fillImage(const QColor &color) const; - int m_width; - int m_height; - mutable QGLFramebufferObject *m_renderFbo; mutable GLuint m_textureId; mutable QPaintEngine *m_engine; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index c2048d8..c239248 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -82,6 +82,10 @@ void QDirectFBPixmapData::resize(int width, int height) return; } + w = width; + h = height; + is_null = (w <= 0 || h <= 0); + d = metric(QPaintDevice::PdmDepth); setSerialNumber(++global_ser_no); } @@ -191,6 +195,10 @@ void QDirectFBPixmapData::fromImage(const QImage &i, invalidate(); return; } + w = metric(QPaintDevice::PdmWidth); + h = metric(QPaintDevice::PdmHeight); + is_null = (w <= 0 || h <= 0); + d = metric(QPaintDevice::PdmDepth); setSerialNumber(++global_ser_no); } -- cgit v0.12 From b14ae565a95e26a0ca2890c3c438207aa6a4722f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 17 Jun 2009 11:48:21 +0200 Subject: Fixed an oversight in Qt Designer that prevents one from designing empty stacked widgets. Reviewed-by: Friedemann Kleint --- tools/designer/src/lib/shared/qdesigner_stackedbox.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp b/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp index 38b1d7c..0b45b7b 100644 --- a/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp +++ b/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp @@ -315,7 +315,7 @@ QMenu *QStackedWidgetEventFilter::addContextMenuActions(QMenu *popup) QMenu *pageMenu = 0; const int count = stackedWidget()->count(); const bool hasSeveralPages = count > 1; - m_actionDeletePage->setEnabled(hasSeveralPages); + m_actionDeletePage->setEnabled(count); if (count) { const QString pageSubMenuLabel = tr("Page %1 of %2").arg(stackedWidget()->currentIndex() + 1).arg(count); pageMenu = popup->addMenu(pageSubMenuLabel); @@ -327,10 +327,13 @@ QMenu *QStackedWidgetEventFilter::addContextMenuActions(QMenu *popup) qdesigner_internal::PromotionTaskMenu::SuppressGlobalEdit, pageMenu); } + QMenu *insertPageMenu = popup->addMenu(tr("Insert Page")); + insertPageMenu->addAction(m_actionInsertPageAfter); + insertPageMenu->addAction(m_actionInsertPage); + } else { + QAction *insertPageAction = popup->addAction(tr("Insert Page")); + connect(insertPageAction, SIGNAL(triggered()), this, SLOT(addPage())); } - QMenu *insertPageMenu = popup->addMenu(tr("Insert Page")); - insertPageMenu->addAction(m_actionInsertPageAfter); - insertPageMenu->addAction(m_actionInsertPage); popup->addAction(m_actionNextPage); m_actionNextPage->setEnabled(hasSeveralPages); popup->addAction(m_actionPreviousPage); -- cgit v0.12 From c4551c5df74bcd7e6166ce502832704b9495c685 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 17 Jun 2009 11:48:22 +0200 Subject: Fixed an oversight in Qt Designer that prevents one from designing empty tab widgets. Reviewed-by: Friedemann Kleint --- tools/designer/src/lib/shared/qdesigner_tabwidget.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp b/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp index 22833b3..eb4dfa2 100644 --- a/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp +++ b/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp @@ -368,7 +368,7 @@ QMenu *QTabWidgetEventFilter::addContextMenuActions(QMenu *popup) { QMenu *pageMenu = 0; const int count = m_tabWidget->count(); - m_actionDeletePage->setEnabled(count > 1); + m_actionDeletePage->setEnabled(count); if (count) { const int currentIndex = m_tabWidget->currentIndex(); const QString pageSubMenuLabel = tr("Page %1 of %2").arg(currentIndex + 1).arg(count); @@ -381,11 +381,13 @@ QMenu *QTabWidgetEventFilter::addContextMenuActions(QMenu *popup) qdesigner_internal::PromotionTaskMenu::SuppressGlobalEdit, pageMenu); } + QMenu *insertPageMenu = popup->addMenu(tr("Insert Page")); + insertPageMenu->addAction(m_actionInsertPageAfter); + insertPageMenu->addAction(m_actionInsertPage); + } else { + QAction *insertPageAction = popup->addAction(tr("Insert Page")); + connect(insertPageAction, SIGNAL(triggered()), this, SLOT(addPage())); } - - QMenu *insertPageMenu = popup->addMenu(tr("Insert Page")); - insertPageMenu->addAction(m_actionInsertPageAfter); - insertPageMenu->addAction(m_actionInsertPage); popup->addSeparator(); return pageMenu; } -- cgit v0.12 From eda6ef48f7a1c5f93e09fd85fa54123569bb0a5f Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 17 Jun 2009 11:54:48 +0200 Subject: Phonon::VolumeSlider: Fixed the isMuteVisiblefunction The problem is that it was relying on button->isVisible whereas it should rely on isHidden. isVisible returns false initially when the whole widget is not yet shown. I also added an autotest for it. Task-number: 256331 --- src/3rdparty/phonon/phonon/volumeslider.cpp | 2 +- tests/auto/mediaobject/tst_mediaobject.cpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/phonon/volumeslider.cpp b/src/3rdparty/phonon/phonon/volumeslider.cpp index b59f689..1888cb6 100644 --- a/src/3rdparty/phonon/phonon/volumeslider.cpp +++ b/src/3rdparty/phonon/phonon/volumeslider.cpp @@ -85,7 +85,7 @@ VolumeSlider::~VolumeSlider() bool VolumeSlider::isMuteVisible() const { - return k_ptr->muteButton.isVisible(); + return !k_ptr->muteButton.isHidden(); } void VolumeSlider::setMuteVisible(bool visible) diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp index c1a69f7..f04a4d7 100644 --- a/tests/auto/mediaobject/tst_mediaobject.cpp +++ b/tests/auto/mediaobject/tst_mediaobject.cpp @@ -148,6 +148,7 @@ class tst_MediaObject : public QObject void testPlayBeforeFinish(); void testPauseOnFinish(); void testReconnectBetweenTwoMediaObjects(); + void volumeSliderMuteVisibility(); void cleanupTestCase(); private: void _startPlayback(Phonon::State currentState = Phonon::StoppedState); @@ -937,6 +938,28 @@ void tst_MediaObject::_testOneSeek(qint64 seekTo) m_success = true; } +void tst_MediaObject::volumeSliderMuteVisibility() +{ + //this test doesn't really belong to mediaobject + // ### see if we should create a realy Phonon::VolumeSlider autotest + Phonon::VolumeSlider slider; + QVERIFY(slider.isMuteVisible()); // that is the default value + slider.setMuteVisible(true); + QVERIFY(slider.isMuteVisible()); + + //let's check that changing the visibility of the slider itself + //doesn't change what the slider reports + slider.setVisible(false); + QVERIFY(slider.isMuteVisible()); + slider.setVisible(true); + + slider.setMuteVisible(false); + QVERIFY(!slider.isMuteVisible()); + slider.setMuteVisible(true); + QVERIFY(slider.isMuteVisible()); +} + + #endif //QT_NO_PHONON -- cgit v0.12 From e97b1187391e16208a2da0e4c7f9e6daa540aa93 Mon Sep 17 00:00:00 2001 From: Joel Nordell Date: Wed, 17 Jun 2009 12:48:53 +0200 Subject: add a state() function to QScriptEngineDebugger for determining whether the debu gger is suspended or not Merge-request: 555 Reviewed-by: Kent Hansen --- src/scripttools/debugging/qscriptdebugger.cpp | 6 ++++++ src/scripttools/debugging/qscriptdebugger_p.h | 2 ++ src/scripttools/debugging/qscriptenginedebugger.cpp | 21 +++++++++++++++++++++ src/scripttools/debugging/qscriptenginedebugger.h | 7 +++++++ 4 files changed, 36 insertions(+) diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp index 9cca8ad..003121f 100644 --- a/src/scripttools/debugging/qscriptdebugger.cpp +++ b/src/scripttools/debugging/qscriptdebugger.cpp @@ -1946,6 +1946,12 @@ QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject return tb; } +bool QScriptDebugger::isInteractive() const +{ + Q_D(const QScriptDebugger); + return d->interactive; +} + /*! \reimp */ diff --git a/src/scripttools/debugging/qscriptdebugger_p.h b/src/scripttools/debugging/qscriptdebugger_p.h index 9ed7e0a..ba27200 100644 --- a/src/scripttools/debugging/qscriptdebugger_p.h +++ b/src/scripttools/debugging/qscriptdebugger_p.h @@ -172,6 +172,8 @@ public: bool eventFilter(QObject *, QEvent *e); + bool isInteractive() const; + Q_SIGNALS: void stopped() const; void started() const; diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp index 948a01a..ae58c89 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.cpp +++ b/src/scripttools/debugging/qscriptenginedebugger.cpp @@ -226,6 +226,15 @@ public: \value GoToLineAction Shows the "Go to Line" dialog. */ +/*! + \enum QScriptEngineDebugger::DebuggerState + + This enum specifies the current state of the debugger. + + \value RunningState The debugger is running. (Script evaluation is allowed.) + \value SuspendedState The debugger has suspended script evaluation. +*/ + class QScriptEngineDebuggerPrivate : public QObjectPrivate { @@ -387,6 +396,18 @@ void QScriptEngineDebugger::detach() } /*! + Returns the current state of the debugger. + + \sa evaluationResumed() + \sa evaluationSuspended() +*/ +QScriptEngineDebugger::DebuggerState QScriptEngineDebugger::state() const +{ + Q_D(const QScriptEngineDebugger); + return (d->debugger && d->debugger->isInteractive() ? SuspendedState : RunningState); +} + +/*! Returns a pointer to the instance of the specified standard \a widget. The widgets available are defined by the DebuggerWidget diff --git a/src/scripttools/debugging/qscriptenginedebugger.h b/src/scripttools/debugging/qscriptenginedebugger.h index 0fd4963..b9061a2 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.h +++ b/src/scripttools/debugging/qscriptenginedebugger.h @@ -92,6 +92,11 @@ public: GoToLineAction }; + enum DebuggerState { + RunningState, + SuspendedState + }; + QScriptEngineDebugger(QObject *parent = 0); ~QScriptEngineDebugger(); @@ -108,6 +113,8 @@ public: QWidget *widget(DebuggerWidget widget) const; QAction *action(DebuggerAction action) const; + DebuggerState state() const; + Q_SIGNALS: void evaluationSuspended(); void evaluationResumed(); -- cgit v0.12 From f136f7410a30b090646a58c1791e15adfa18de85 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Jun 2009 13:17:16 +0200 Subject: fix the QScriptEngineDebugger::state() logic, add test, improve docs --- src/scripttools/debugging/qscriptenginedebugger.cpp | 7 +++++-- tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp index ae58c89..f2245cc 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.cpp +++ b/src/scripttools/debugging/qscriptenginedebugger.cpp @@ -126,7 +126,7 @@ public: mode in which it accepts input from the user. The evaluationResumed() signal is emitted when script evaluation is resumed, i.e, when execution control is given back to the script - engine. + engine. The state() function returns the debugger's current state. When calling QScriptEngine::evaluate() it is useful to pass a descriptive script name (file name) as second argument, as this is @@ -228,6 +228,7 @@ public: /*! \enum QScriptEngineDebugger::DebuggerState + \since 4.6 This enum specifies the current state of the debugger. @@ -396,6 +397,8 @@ void QScriptEngineDebugger::detach() } /*! + \since 4.6 + Returns the current state of the debugger. \sa evaluationResumed() @@ -404,7 +407,7 @@ void QScriptEngineDebugger::detach() QScriptEngineDebugger::DebuggerState QScriptEngineDebugger::state() const { Q_D(const QScriptEngineDebugger); - return (d->debugger && d->debugger->isInteractive() ? SuspendedState : RunningState); + return !d->debugger || !d->debugger->isInteractive() ? SuspendedState : RunningState; } /*! diff --git a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp index 5d9f56f..7f3f9f3 100644 --- a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp +++ b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp @@ -111,9 +111,11 @@ void tst_QScriptEngineDebugger::attachAndDetach() { { QScriptEngineDebugger debugger; + QCOMPARE(debugger.state(), QScriptEngineDebugger::SuspendedState); debugger.attachTo(0); QScriptEngine engine; debugger.attachTo(&engine); + QCOMPARE(debugger.state(), QScriptEngineDebugger::SuspendedState); } { QScriptEngineDebugger debugger; -- cgit v0.12 From 6f2f1fb334c8fbcaa2bf0607e813628b4c9549ca Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Jun 2009 13:36:47 +0200 Subject: kill some includes not needed anymore The debugger is completely abstracted from QScriptEngine, whee --- src/scripttools/debugging/qscriptdebugger.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp index 003121f..20de788 100644 --- a/src/scripttools/debugging/qscriptdebugger.cpp +++ b/src/scripttools/debugging/qscriptdebugger.cpp @@ -75,10 +75,6 @@ #include "qscriptdebuggerjob_p_p.h" #include "qscriptxmlparser_p.h" -#include "qscriptenginedebuggerfrontend_p.h" -#include "qscriptdebuggerbackend_p.h" -#include - #include "private/qobject_p.h" #include -- cgit v0.12 From aff5e7a05e598f8196da4fe39dd0d193426d36e8 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 17 Jun 2009 14:22:50 +0200 Subject: QIoDevice and QAbstractSocket: Clarify doc about waitForReadyRead() --- src/corelib/io/qiodevice.cpp | 4 ++-- src/network/socket/qabstractsocket.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index d3fa6a8..2977c7f 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1454,11 +1454,11 @@ QByteArray QIODevice::peek(qint64 maxSize) } /*! - Blocks until data is available for reading and the readyRead() + Blocks until new data is available for reading and the readyRead() signal has been emitted, or until \a msecs milliseconds have passed. If msecs is -1, this function will not time out. - Returns true if data is available for reading; otherwise returns + Returns true if new data is available for reading; otherwise returns false (if the operation timed out or if an error occurred). This function can operate without an event loop. It is diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 19bfe51..d099382 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1658,13 +1658,13 @@ bool QAbstractSocket::waitForConnected(int msecs) } /*! - This function blocks until data is available for reading and the + This function blocks until new data is available for reading and the \l{QIODevice::}{readyRead()} signal has been emitted. The function will timeout after \a msecs milliseconds; the default timeout is 30000 milliseconds. The function returns true if the readyRead() signal is emitted and - there is data available for reading; otherwise it returns false + there is new data available for reading; otherwise it returns false (if an error occurred or the operation timed out). \sa waitForBytesWritten() -- cgit v0.12 From f10441ab65d6204f23735e7cffbab5ac81663e91 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 17 Jun 2009 14:38:09 +0200 Subject: Autotest: fixed compile issues on hp compiler --- tests/auto/qanimationgroup/tst_qanimationgroup.cpp | 26 +++++++++++----------- .../tst_qparallelanimationgroup.cpp | 22 +++++++++--------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/tests/auto/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/qanimationgroup/tst_qanimationgroup.cpp index 0457f8f..0e98797 100644 --- a/tests/auto/qanimationgroup/tst_qanimationgroup.cpp +++ b/tests/auto/qanimationgroup/tst_qanimationgroup.cpp @@ -206,9 +206,9 @@ void tst_QAnimationGroup::setCurrentTime() // sequence operating on same object/property QSequentialAnimationGroup *sequence = new QSequentialAnimationGroup(); - QVariantAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value"); - QVariantAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value"); - QVariantAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value"); a2_s_o1->setLoopCount(3); sequence->addAnimation(a1_s_o1); sequence->addAnimation(a2_s_o1); @@ -216,25 +216,25 @@ void tst_QAnimationGroup::setCurrentTime() // sequence operating on different object/properties QAnimationGroup *sequence2 = new QSequentialAnimationGroup(); - QVariantAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value"); - QVariantAnimation *a1_s_o3 = new QPropertyAnimation(&s_o3, "value"); + QAbstractAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value"); + QAbstractAnimation *a1_s_o3 = new QPropertyAnimation(&s_o3, "value"); sequence2->addAnimation(a1_s_o2); sequence2->addAnimation(a1_s_o3); // parallel operating on different object/properties QAnimationGroup *parallel = new QParallelAnimationGroup(); - QVariantAnimation *a1_p_o1 = new QPropertyAnimation(&p_o1, "value"); - QVariantAnimation *a1_p_o2 = new QPropertyAnimation(&p_o2, "value"); - QVariantAnimation *a1_p_o3 = new QPropertyAnimation(&p_o3, "value"); + QAbstractAnimation *a1_p_o1 = new QPropertyAnimation(&p_o1, "value"); + QAbstractAnimation *a1_p_o2 = new QPropertyAnimation(&p_o2, "value"); + QAbstractAnimation *a1_p_o3 = new QPropertyAnimation(&p_o3, "value"); a1_p_o2->setLoopCount(3); parallel->addAnimation(a1_p_o1); parallel->addAnimation(a1_p_o2); parallel->addAnimation(a1_p_o3); - UncontrolledAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value"); + QAbstractAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value"); QCOMPARE(notTimeDriven->totalDuration(), -1); - QVariantAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value"); + QAbstractAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value"); loopsForever->setLoopCount(-1); QCOMPARE(loopsForever->totalDuration(), -1); @@ -318,7 +318,7 @@ void tst_QAnimationGroup::setParentAutoAdd() { QParallelAnimationGroup group; QVariantAnimation *animation = new QPropertyAnimation(&group); - QCOMPARE(animation->group(), &group); + QCOMPARE(animation->group(), static_cast(&group)); } void tst_QAnimationGroup::beginNestedGroup() @@ -347,8 +347,8 @@ void tst_QAnimationGroup::beginNestedGroup() void tst_QAnimationGroup::addChildTwice() { - QPropertyAnimation *subGroup; - QPropertyAnimation *subGroup2; + QAbstractAnimation *subGroup; + QAbstractAnimation *subGroup2; QAnimationGroup *parent = new QSequentialAnimationGroup(); subGroup = new QPropertyAnimation(); diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index 9f66fe0..d7d6b88 100644 --- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp @@ -253,16 +253,16 @@ void tst_QParallelAnimationGroup::setCurrentTime() void tst_QParallelAnimationGroup::clearGroup() { QParallelAnimationGroup group; + static const int animationCount = 10; - for (int i = 0; i < 10; ++i) { + for (int i = 0; i < animationCount; ++i) { new QParallelAnimationGroup(&group); } - QCOMPARE(group.animationCount(), 10); + QCOMPARE(group.animationCount(), animationCount); - int count = group.animationCount(); - QPointer *children = new QPointer[count]; - for (int i = 0; i < count; ++i) { + QPointer children[animationCount]; + for (int i = 0; i < animationCount; ++i) { QVERIFY(group.animationAt(i) != 0); children[i] = group.animationAt(i); } @@ -270,10 +270,8 @@ void tst_QParallelAnimationGroup::clearGroup() group.clearAnimations(); QCOMPARE(group.animationCount(), 0); QCOMPARE(group.currentTime(), 0); - for (int i = 0; i < count; ++i) - QCOMPARE(children[i], QPointer()); - - delete[] children; + for (int i = 0; i < animationCount; ++i) + QVERIFY(children[i].isNull()); } void tst_QParallelAnimationGroup::propagateGroupUpdateToChildren() @@ -807,15 +805,15 @@ void tst_QParallelAnimationGroup::autoAdd() QParallelAnimationGroup group; QCOMPARE(group.duration(), 0); TestAnimation2 *test = new TestAnimation2(250, &group); // 0, duration = 250; - QCOMPARE(test->group(), &group); + QCOMPARE(test->group(), static_cast(&group)); QCOMPARE(test->duration(), 250); QCOMPARE(group.duration(), 250); test = new TestAnimation2(750, &group); // 1 - QCOMPARE(test->group(), &group); + QCOMPARE(test->group(), static_cast(&group)); QCOMPARE(group.duration(), 750); test = new TestAnimation2(500, &group); // 2 - QCOMPARE(test->group(), &group); + QCOMPARE(test->group(), static_cast(&group)); QCOMPARE(group.duration(), 750); delete group.animationAt(1); // remove the one with duration = 750 -- cgit v0.12 From abc67ad77fa719db95254ac2995c0ce1a3ebaf5c Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Jun 2009 14:57:23 +0200 Subject: reset debugger's state correctly when previous engine was deleted If the engine was deleted, the agent will be 0, but we still want to fall through rather than return immediately, so that the other variables are reset correctly. --- .../debugging/qscriptdebuggerbackend.cpp | 30 +++++++++++----------- .../tst_qscriptenginedebugger.cpp | 8 ++++++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp index 9eaf571..da9d50e 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp @@ -433,21 +433,21 @@ void QScriptDebuggerBackend::attachTo(QScriptEngine *engine) void QScriptDebuggerBackend::detach() { Q_D(QScriptDebuggerBackend); - if (!d->agent) - return; - QScriptEngine *eng = d->agent->engine(); - if (eng && eng->agent() == d->agent) { - eng->setAgent(0); - QScriptValue global = eng->globalObject(); - if (global.property(QString::fromLatin1("print")).strictlyEquals(traceFunction())) - global.setProperty(QString::fromLatin1("print"), QScriptValue()); -// global.setProperty(QString::fromLatin1("qAssert"), QScriptValue()); - if (global.property(QString::fromLatin1("__FILE__")).strictlyEquals(fileNameFunction())) - global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue()); - if (global.property(QString::fromLatin1("__LINE__")).strictlyEquals(lineNumberFunction())) - global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue()); - d->agent->nullifyBackendPointer(); - d->agent = 0; // agent is owned by engine + if (d->agent) { + QScriptEngine *eng = d->agent->engine(); + if (eng && eng->agent() == d->agent) { + eng->setAgent(0); + QScriptValue global = eng->globalObject(); + if (global.property(QString::fromLatin1("print")).strictlyEquals(traceFunction())) + global.setProperty(QString::fromLatin1("print"), QScriptValue()); +// global.setProperty(QString::fromLatin1("qAssert"), QScriptValue()); + if (global.property(QString::fromLatin1("__FILE__")).strictlyEquals(fileNameFunction())) + global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue()); + if (global.property(QString::fromLatin1("__LINE__")).strictlyEquals(lineNumberFunction())) + global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue()); + d->agent->nullifyBackendPointer(); + d->agent = 0; // agent is owned by engine + } } d->pendingEvaluateLineNumber = -1; diff --git a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp index 7f3f9f3..5e5b701 100644 --- a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp +++ b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp @@ -163,6 +163,14 @@ void tst_QScriptEngineDebugger::attachAndDetach() debugger2.attachTo(&engine); } #endif + { + QScriptEngine *engine = new QScriptEngine; + QScriptEngineDebugger debugger; + debugger.attachTo(engine); + delete engine; + QScriptEngine engine2; + debugger.attachTo(&engine2); + } } void tst_QScriptEngineDebugger::action() -- cgit v0.12 From 30d6ac5feeb43b32eccc72595fe9a2c89d0f5c1e Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 17 Jun 2009 15:10:39 +0200 Subject: Autotests: fix compile issues on HPUX --- .../tst_qsequentialanimationgroup.cpp | 57 +++++++++++----------- tests/auto/qstatemachine/tst_qstatemachine.cpp | 32 ++++++------ 2 files changed, 44 insertions(+), 45 deletions(-) diff --git a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp index 522a900..97ff04b 100644 --- a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp +++ b/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp @@ -321,15 +321,15 @@ void tst_QSequentialAnimationGroup::setCurrentTimeWithUncontrolledAnimation() // sequence operating on different object/properties QAnimationGroup *sequence = new QSequentialAnimationGroup(); - QVariantAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value"); - QVariantAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value"); + QAbstractAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a1_s_o2 = new QPropertyAnimation(&s_o2, "value"); sequence->addAnimation(a1_s_o1); sequence->addAnimation(a1_s_o2); - UncontrolledAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value"); + QAbstractAnimation *notTimeDriven = new UncontrolledAnimation(&t_o1, "value"); QCOMPARE(notTimeDriven->totalDuration(), -1); - QVariantAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value"); + QAbstractAnimation *loopsForever = new QPropertyAnimation(&t_o2, "value"); loopsForever->setLoopCount(-1); QCOMPARE(loopsForever->totalDuration(), -1); @@ -818,7 +818,7 @@ void tst_QSequentialAnimationGroup::restart() QCOMPARE(seqCurrentAnimChangedSpy.count(), 6); for(int i=0; i(seqCurrentAnimChangedSpy.at(i).at(0))); + QCOMPARE(static_cast(anims[i%3]), qVariantValue(seqCurrentAnimChangedSpy.at(i).at(0))); group.start(); @@ -836,9 +836,9 @@ void tst_QSequentialAnimationGroup::looping() // sequence operating on same object/property QSequentialAnimationGroup *sequence = new QSequentialAnimationGroup(); - QVariantAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value"); - QVariantAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value"); - QVariantAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a1_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a2_s_o1 = new QPropertyAnimation(&s_o1, "value"); + QAbstractAnimation *a3_s_o1 = new QPropertyAnimation(&s_o1, "value"); QSignalSpy a1Spy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); QSignalSpy a2Spy(a2_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); @@ -951,18 +951,19 @@ void tst_QSequentialAnimationGroup::startDelay() void tst_QSequentialAnimationGroup::clearGroup() { QSequentialAnimationGroup group; + + static const int animationCount = 20; - for (int i = 0; i < 10; ++i) { + for (int i = 0; i < animationCount/2; ++i) { QSequentialAnimationGroup *subGroup = new QSequentialAnimationGroup(&group); group.addPause(100); subGroup->addPause(10); } - QCOMPARE(group.animationCount(), 20); + QCOMPARE(group.animationCount(), animationCount); - int count = group.animationCount(); - QPointer *children = new QPointer[count]; - for (int i = 0; i < count; ++i) { + QPointer children[animationCount]; + for (int i = 0; i < animationCount; ++i) { QVERIFY(group.animationAt(i) != 0); children[i] = group.animationAt(i); } @@ -970,10 +971,8 @@ void tst_QSequentialAnimationGroup::clearGroup() group.clearAnimations(); QCOMPARE(group.animationCount(), 0); QCOMPARE(group.currentTime(), 0); - for (int i = 0; i < count; ++i) - QCOMPARE(children[i], QPointer()); - - delete[] children; + for (int i = 0; i < animationCount; ++i) + QVERIFY(children[i].isNull()); } void tst_QSequentialAnimationGroup::groupWithZeroDurationAnimations() @@ -995,7 +994,7 @@ void tst_QSequentialAnimationGroup::groupWithZeroDurationAnimations() //this should just run fine and change nothing group.setCurrentTime(0); - QCOMPARE(group.currentAnimation(), a1); + QCOMPARE(group.currentAnimation(), static_cast(a1)); QVariantAnimation *a2 = new QPropertyAnimation(&o2, "myOtherProperty"); a2->setDuration(500); @@ -1457,7 +1456,7 @@ void tst_QSequentialAnimationGroup::finishWithUncontrolledAnimation() group.setCurrentTime(300); QCOMPARE(group.state(), QAnimationGroup::Stopped); QCOMPARE(notTimeDriven.currentTime(), actualDuration); - QCOMPARE(group.currentAnimation(), &anim); + QCOMPARE(group.currentAnimation(), static_cast(&anim)); //3rd case: //now let's add a perfectly defined animation at the end @@ -1474,7 +1473,7 @@ void tst_QSequentialAnimationGroup::finishWithUncontrolledAnimation() QCOMPARE(notTimeDriven.state(), QAnimationGroup::Stopped); QCOMPARE(group.state(), QAnimationGroup::Running); QCOMPARE(anim.state(), QAnimationGroup::Running); - QCOMPARE(group.currentAnimation(), &anim); + QCOMPARE(group.currentAnimation(), static_cast(&anim)); QCOMPARE(animStateChangedSpy.count(), 1); QTest::qWait(300); //wait for the end of anim @@ -1494,21 +1493,21 @@ void tst_QSequentialAnimationGroup::addRemoveAnimation() QCOMPARE(group.duration(), 0); QCOMPARE(group.currentTime(), 0); - QVariantAnimation *anim1 = new QPropertyAnimation; + QAbstractAnimation *anim1 = new QPropertyAnimation; group.addAnimation(anim1); QCOMPARE(group.duration(), 250); QCOMPARE(group.currentTime(), 0); QCOMPARE(group.currentAnimation(), anim1); //let's append an animation - QVariantAnimation *anim2 = new QPropertyAnimation; + QAbstractAnimation *anim2 = new QPropertyAnimation; group.addAnimation(anim2); QCOMPARE(group.duration(), 500); QCOMPARE(group.currentTime(), 0); QCOMPARE(group.currentAnimation(), anim1); //let's prepend an animation - QVariantAnimation *anim0 = new QPropertyAnimation; + QAbstractAnimation *anim0 = new QPropertyAnimation; group.insertAnimationAt(0, anim0); QCOMPARE(group.duration(), 750); QCOMPARE(group.currentTime(), 0); @@ -1545,7 +1544,7 @@ void tst_QSequentialAnimationGroup::currentAnimation() QPropertyAnimation anim; anim.setDuration(0); group.addAnimation(&anim); - QCOMPARE(group.currentAnimation(), &anim); + QCOMPARE(group.currentAnimation(), static_cast(&anim)); } void tst_QSequentialAnimationGroup::currentAnimationWithZeroDuration() @@ -1572,21 +1571,21 @@ void tst_QSequentialAnimationGroup::currentAnimationWithZeroDuration() group.addAnimation(&zero3); group.addAnimation(&zero4); - QCOMPARE(group.currentAnimation(), &zero1); + QCOMPARE(group.currentAnimation(), static_cast(&zero1)); group.setCurrentTime(0); - QCOMPARE(group.currentAnimation(), &anim); + QCOMPARE(group.currentAnimation(), static_cast(&anim)); group.setCurrentTime(group.duration()); - QCOMPARE(group.currentAnimation(), &zero4); + QCOMPARE(group.currentAnimation(), static_cast(&zero4)); group.setDirection(QAbstractAnimation::Backward); group.setCurrentTime(0); - QCOMPARE(group.currentAnimation(), &zero1); + QCOMPARE(group.currentAnimation(), static_cast(&zero1)); group.setCurrentTime(group.duration()); - QCOMPARE(group.currentAnimation(), &anim); + QCOMPARE(group.currentAnimation(), static_cast(&anim)); } void tst_QSequentialAnimationGroup::insertAnimation() diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index cd0c71d..6040abd 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -778,7 +778,7 @@ void tst_QStateMachine::customErrorStateIsNull() QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: Missing initial state in compound state ''"); QCoreApplication::processEvents(); - QCOMPARE(machine.errorState(), reinterpret_cast(0)); + QCOMPARE(machine.errorState(), reinterpret_cast(0)); QCOMPARE(machine.configuration().count(), 1); QVERIFY(machine.configuration().contains(oldErrorState)); } @@ -1103,29 +1103,29 @@ void tst_QStateMachine::stateEntryAndExit() TestTransition *t = new TestTransition(s2); QCOMPARE(t->machine(), (QStateMachine*)0); QCOMPARE(t->sourceState(), (QState*)0); - QCOMPARE(t->targetState(), s2); + QCOMPARE(t->targetState(), (QAbstractState*)s2); QCOMPARE(t->targetStates().size(), 1); - QCOMPARE(t->targetStates().at(0), s2); + QCOMPARE(t->targetStates().at(0), (QAbstractState*)s2); t->setTargetState(0); - QCOMPARE(t->targetState(), (QState*)0); + QCOMPARE(t->targetState(), (QAbstractState*)0); QVERIFY(t->targetStates().isEmpty()); t->setTargetState(s2); - QCOMPARE(t->targetState(), s2); + QCOMPARE(t->targetState(), (QAbstractState*)s2); QTest::ignoreMessage(QtWarningMsg, "QAbstractTransition::setTargetStates: target state(s) cannot be null"); t->setTargetStates(QList() << 0); - QCOMPARE(t->targetState(), s2); + QCOMPARE(t->targetState(), (QAbstractState*)s2); t->setTargetStates(QList() << s2); - QCOMPARE(t->targetState(), s2); + QCOMPARE(t->targetState(), (QAbstractState*)s2); QCOMPARE(t->targetStates().size(), 1); - QCOMPARE(t->targetStates().at(0), s2); + QCOMPARE(t->targetStates().at(0), (QAbstractState*)s2); QCOMPARE(s1->addTransition(t), (QAbstractTransition*)t); - QCOMPARE(t->sourceState(), s1); + QCOMPARE(t->sourceState(), (QState*)s1); QCOMPARE(t->machine(), &machine); { QAbstractTransition *trans = s2->addTransition(s3); QVERIFY(trans != 0); - QCOMPARE(trans->sourceState(), (QAbstractState*)s2); + QCOMPARE(trans->sourceState(), (QState*)s2); QCOMPARE(trans->targetState(), (QAbstractState*)s3); { char warning[256]; @@ -1134,10 +1134,10 @@ void tst_QStateMachine::stateEntryAndExit() s1->removeTransition(trans); } s2->removeTransition(trans); - QCOMPARE(trans->sourceState(), (QAbstractState*)0); + QCOMPARE(trans->sourceState(), (QState*)0); QCOMPARE(trans->targetState(), (QAbstractState*)s3); QCOMPARE(s2->addTransition(trans), trans); - QCOMPARE(trans->sourceState(), (QAbstractState*)s2); + QCOMPARE(trans->sourceState(), (QState*)s2); } QSignalSpy startedSpy(&machine, SIGNAL(started())); @@ -1724,18 +1724,18 @@ void tst_QStateMachine::signalTransitions() QStateMachine machine; QState *s0 = new QState(machine.rootState()); QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: sender cannot be null"); - QCOMPARE(s0->addTransition(0, SIGNAL(noSuchSignal()), 0), (QObject*)0); + QCOMPARE(s0->addTransition(0, SIGNAL(noSuchSignal()), 0), (QAbstractTransition*)0); SignalEmitter emitter; QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: signal cannot be null"); - QCOMPARE(s0->addTransition(&emitter, 0, 0), (QObject*)0); + QCOMPARE(s0->addTransition(&emitter, 0, 0), (QAbstractTransition*)0); QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: cannot add transition to null state"); - QCOMPARE(s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), 0), (QObject*)0); + QCOMPARE(s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), 0), (QAbstractTransition*)0); QFinalState *s1 = new QFinalState(machine.rootState()); QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: no such signal SignalEmitter::noSuchSignal()"); - QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QObject*)0); + QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QAbstractTransition*)0); QSignalTransition *trans = s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1); QVERIFY(trans != 0); -- cgit v0.12 From 5af2e06cb543bd27450c29a1fca8686413f1cceb Mon Sep 17 00:00:00 2001 From: Joel Nordell Date: Wed, 17 Jun 2009 15:26:41 +0200 Subject: fix crash when detach()ing a debugger and then evaluating script print() function Merge-request: 554 Reviewed-by: Kent Hansen --- src/scripttools/debugging/qscriptdebuggerbackend.cpp | 15 +++++++++------ src/scripttools/debugging/qscriptdebuggerbackend_p_p.h | 6 +++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp index da9d50e..c7577d6 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp @@ -412,11 +412,14 @@ void QScriptDebuggerBackend::attachTo(QScriptEngine *engine) detach(); d->agent = new QScriptDebuggerAgent(d, engine); QScriptValue global = engine->globalObject(); + d->origTraceFunction = global.property(QString::fromLatin1("print")); global.setProperty(QString::fromLatin1("print"), traceFunction()); // global.setProperty(QString::fromLatin1("qAssert"), assertFunction()); + d->origFileNameFunction = global.property(QString::fromLatin1("__FILE__")); global.setProperty(QString::fromLatin1("__FILE__"), fileNameFunction(), QScriptValue::PropertyGetter | QScriptValue::PropertySetter | QScriptValue::ReadOnly); + d->origLineNumberFunction = global.property(QString::fromLatin1("__LINE__")); global.setProperty(QString::fromLatin1("__LINE__"), lineNumberFunction(), QScriptValue::PropertyGetter | QScriptValue::PropertySetter | QScriptValue::ReadOnly); @@ -438,13 +441,13 @@ void QScriptDebuggerBackend::detach() if (eng && eng->agent() == d->agent) { eng->setAgent(0); QScriptValue global = eng->globalObject(); - if (global.property(QString::fromLatin1("print")).strictlyEquals(traceFunction())) - global.setProperty(QString::fromLatin1("print"), QScriptValue()); + global.setProperty(QString::fromLatin1("print"), d->origTraceFunction); + d->origTraceFunction = QScriptValue(); // global.setProperty(QString::fromLatin1("qAssert"), QScriptValue()); - if (global.property(QString::fromLatin1("__FILE__")).strictlyEquals(fileNameFunction())) - global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue()); - if (global.property(QString::fromLatin1("__LINE__")).strictlyEquals(lineNumberFunction())) - global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue()); + global.setProperty(QString::fromLatin1("__FILE__"), d->origFileNameFunction); + d->origFileNameFunction = QScriptValue(); + global.setProperty(QString::fromLatin1("__LINE__"), d->origLineNumberFunction); + d->origLineNumberFunction = QScriptValue(); d->agent->nullifyBackendPointer(); d->agent = 0; // agent is owned by engine } diff --git a/src/scripttools/debugging/qscriptdebuggerbackend_p_p.h b/src/scripttools/debugging/qscriptdebuggerbackend_p_p.h index de18304..a356762 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend_p_p.h +++ b/src/scripttools/debugging/qscriptdebuggerbackend_p_p.h @@ -57,6 +57,7 @@ #include #include +#include #include "qscriptdebuggerbackend_p.h" @@ -66,7 +67,6 @@ class QEvent; class QString; class QScriptContext; class QScriptEngine; -class QScriptValue; class QScriptValueIterator; class QScriptObjectSnapshot; class QScriptDebuggerAgent; @@ -126,6 +126,10 @@ public: QObject *eventReceiver; QScriptDebuggerBackend *q_ptr; + + QScriptValue origTraceFunction; + QScriptValue origFileNameFunction; + QScriptValue origLineNumberFunction; }; QT_END_NAMESPACE -- cgit v0.12 From 67d40ba7225dd38ba1e21ff6317920ce9fd5ee75 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Jun 2009 15:42:01 +0200 Subject: make sure __FILE__ and __LINE__ properties are restored correctly Task-number: 256184 --- src/scripttools/debugging/qscriptdebuggerbackend.cpp | 10 ++++++---- tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp | 6 ++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp index c7577d6..7f4211c 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp @@ -417,12 +417,10 @@ void QScriptDebuggerBackend::attachTo(QScriptEngine *engine) // global.setProperty(QString::fromLatin1("qAssert"), assertFunction()); d->origFileNameFunction = global.property(QString::fromLatin1("__FILE__")); global.setProperty(QString::fromLatin1("__FILE__"), fileNameFunction(), - QScriptValue::PropertyGetter | QScriptValue::PropertySetter - | QScriptValue::ReadOnly); + QScriptValue::PropertyGetter | QScriptValue::ReadOnly); d->origLineNumberFunction = global.property(QString::fromLatin1("__LINE__")); global.setProperty(QString::fromLatin1("__LINE__"), lineNumberFunction(), - QScriptValue::PropertyGetter | QScriptValue::PropertySetter - | QScriptValue::ReadOnly); + QScriptValue::PropertyGetter | QScriptValue::ReadOnly); engine->setAgent(d->agent); } @@ -444,8 +442,12 @@ void QScriptDebuggerBackend::detach() global.setProperty(QString::fromLatin1("print"), d->origTraceFunction); d->origTraceFunction = QScriptValue(); // global.setProperty(QString::fromLatin1("qAssert"), QScriptValue()); + global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue(), + QScriptValue::PropertyGetter); global.setProperty(QString::fromLatin1("__FILE__"), d->origFileNameFunction); d->origFileNameFunction = QScriptValue(); + global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue(), + QScriptValue::PropertyGetter); global.setProperty(QString::fromLatin1("__LINE__"), d->origLineNumberFunction); d->origLineNumberFunction = QScriptValue(); d->agent->nullifyBackendPointer(); diff --git a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp index 5e5b701..cbdaf1e 100644 --- a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp +++ b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp @@ -131,11 +131,9 @@ void tst_QScriptEngineDebugger::attachAndDetach() QVERIFY(!engine.globalObject().property("print").strictlyEquals(oldPrint)); debugger.detach(); - QEXPECT_FAIL("", "Task 256184", Continue); - QVERIFY(!engine.globalObject().property("print").isValid()); - QEXPECT_FAIL("", "Task 256184", Continue); + QVERIFY(engine.globalObject().property("print").strictlyEquals(oldPrint)); QVERIFY(!engine.globalObject().property("__FILE__").isValid()); -// QVERIFY(!engine.globalObject().property("__LINE__").isValid()); + QVERIFY(!engine.globalObject().property("__LINE__").isValid()); } { QScriptEngineDebugger debugger; -- cgit v0.12 From c9ab7a8b8504101c06456b706a84e0eb0693c77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 15:33:14 +0200 Subject: Speedup QGraphicsScenePrivate::processDirtyItemsRecursive. Don't process invisible items or items with no contents. I've also added cut-offs to QGraphicsViewPrivate::update(Region|Rect) to make sure update areas outside the viewport are discarded immediately. Reviewed-by: lars --- src/gui/graphicsview/qgraphicsitem_p.h | 15 +++++++- src/gui/graphicsview/qgraphicsscene.cpp | 63 ++++++++++++++++++++------------- src/gui/graphicsview/qgraphicsscene_p.h | 5 ++- src/gui/graphicsview/qgraphicsview.cpp | 32 ++++++++++------- src/gui/graphicsview/qgraphicsview_p.h | 4 +-- 5 files changed, 77 insertions(+), 42 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 9c1ee4f..ce74b4f 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -150,6 +150,8 @@ public: geometryChanged(0), inDestructor(0), isObject(0), + ignoreVisible(0), + ignoreOpacity(0), globalStackingOrder(-1), q_ptr(0) { @@ -327,6 +329,15 @@ public: return calcEffectiveOpacity(); } + inline qreal combineOpacityFromParent(qreal parentOpacity) const + { + if (parent && !(flags & QGraphicsItem::ItemIgnoresParentOpacity) + && !(parent->d_ptr->flags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren)) { + return parentOpacity * opacity; + } + return opacity; + } + inline bool childrenCombineOpacity() const { if (!children.size()) @@ -407,7 +418,9 @@ public: quint32 geometryChanged : 1; quint32 inDestructor : 1; quint32 isObject : 1; - quint32 unused : 14; // feel free to use + quint32 ignoreVisible : 1; + quint32 ignoreOpacity : 1; + quint32 unused : 12; // feel free to use // Optional stacking order int globalStackingOrder; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 811e0d3..dd128ad 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5056,14 +5056,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (item) { if (!item->d_ptr->visible) return; - QGraphicsItem *p = item->d_ptr->parent; - bool itemIgnoresParentOpacity = item->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity; - bool parentDoesntPropagateOpacity = (p && (p->d_ptr->flags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren)); - if (!itemIgnoresParentOpacity && !parentDoesntPropagateOpacity) { - opacity = parentOpacity * item->opacity(); - } else { - opacity = item->d_ptr->opacity; - } + opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); if (opacity == 0.0 && !(item->d_ptr->flags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren)) { invisibleButChildIgnoresParentOpacity = !item->d_ptr->childrenCombineOpacity(); if (!invisibleButChildIgnoresParentOpacity) @@ -5297,6 +5290,11 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b item->d_ptr->dirtyChildren = 1; } + if (force) + item->d_ptr->ignoreVisible = 1; + if (ignoreOpacity) + item->d_ptr->ignoreOpacity = 1; + QGraphicsItem *p = item->d_ptr->parent; while (p && !p->d_ptr->dirtyChildren) { p->d_ptr->dirtyChildren = 1; @@ -5304,7 +5302,8 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b } } -void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren) +void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren, + qreal parentOpacity) { Q_Q(QGraphicsScene); @@ -5318,20 +5317,30 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool wasDirtyParentSceneTransform = true; } - // Process item. bool wasDirtyParentViewBoundingRects = false; + qreal opacity = parentOpacity; + if (item) { + wasDirtyParentViewBoundingRects = item->d_ptr->paintedViewBoundingRectsNeedRepaint; + opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); + if ((!item->d_ptr->ignoreVisible && !item->d_ptr->visible) + || (!item->d_ptr->ignoreOpacity && opacity == 0.0) + || (item->d_ptr->flags & QGraphicsItem::ItemHasNoContents)) { + // Make sure we don't process invisible items or items with no content. + item->d_ptr->dirty = 0; + item->d_ptr->paintedViewBoundingRectsNeedRepaint = 0; + } + } + + // Process item. if (item && (item->d_ptr->dirty || item->d_ptr->paintedViewBoundingRectsNeedRepaint)) { const bool useCompatUpdate = views.isEmpty() || (connectedSignals & changedSignalMask); const bool untransformableItem = item->d_ptr->itemIsUntransformable(); - const QRectF itemBoundingRect = item->boundingRect(); + const QRectF itemBoundingRect = adjustedItemBoundingRect(item); if (item->d_ptr->geometryChanged) { // Update growingItemsBoundingRect. - if (!hasSceneRect) { - QRectF itemSceneBoundingRect = item->d_ptr->sceneTransform.mapRect(itemBoundingRect); - _q_adjustRect(&itemSceneBoundingRect); - growingItemsBoundingRect |= itemSceneBoundingRect; - } + if (!hasSceneRect) + growingItemsBoundingRect |= item->d_ptr->sceneTransform.mapRect(itemBoundingRect); item->d_ptr->geometryChanged = 0; } @@ -5360,11 +5369,12 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool break; } + QRect &paintedViewBoundingRect = item->d_ptr->paintedViewBoundingRects[viewPrivate->viewport]; if (item->d_ptr->paintedViewBoundingRectsNeedRepaint) { wasDirtyParentViewBoundingRects = true; - QRect rect = item->d_ptr->paintedViewBoundingRects.value(viewPrivate->viewport); - rect.translate(viewPrivate->dirtyScrollOffset); - viewPrivate->updateRect(rect); + paintedViewBoundingRect.translate(viewPrivate->dirtyScrollOffset); + if (!viewPrivate->updateRect(paintedViewBoundingRect)) + paintedViewBoundingRect = QRect(); } if (!item->d_ptr->dirty) @@ -5372,7 +5382,6 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool if (uninitializedDirtyRect) { dirtyRect = itemBoundingRect; - _q_adjustRect(&dirtyRect); if (!item->d_ptr->fullUpdatePending) { _q_adjustRect(&item->d_ptr->needsRepaint); dirtyRect &= item->d_ptr->needsRepaint; @@ -5390,10 +5399,14 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool else deviceTransform = item->deviceTransform(view->viewportTransform()); } - if (item->d_ptr->hasBoundingRegionGranularity) - viewPrivate->updateRegion(deviceTransform.map(QRegion(dirtyRect.toRect()))); - else - viewPrivate->updateRect(deviceTransform.mapRect(dirtyRect).toRect()); + + if (item->d_ptr->hasBoundingRegionGranularity) { + if (!viewPrivate->updateRegion(deviceTransform.map(QRegion(dirtyRect.toRect())))) + paintedViewBoundingRect = QRect(); + } else { + if (!viewPrivate->updateRect(deviceTransform.mapRect(dirtyRect).toRect())) + paintedViewBoundingRect = QRect(); + } } } } @@ -5434,7 +5447,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool child->d_ptr->paintedViewBoundingRectsNeedRepaint = 0; } - processDirtyItemsRecursive(child, dirtyAncestorContainsChildren); + processDirtyItemsRecursive(child, dirtyAncestorContainsChildren, opacity); } } else if (wasDirtyParentSceneTransform) { item->d_ptr->invalidateChildrenSceneTransform(); diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index cd463ee..a8f6699 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -266,7 +266,8 @@ public: void markDirty(QGraphicsItem *item, const QRectF &rect = QRectF(), bool invalidateChildren = false, bool maybeDirtyClipPath = false, bool force = false, bool ignoreOpacity = false, bool removingItemFromScene = false); - void processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren = false); + void processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren = false, + qreal parentOpacity = qreal(1.0)); inline void resetDirtyItem(QGraphicsItem *item) { @@ -278,6 +279,8 @@ public: item->d_ptr->needsRepaint = QRectF(); item->d_ptr->allChildrenDirty = 0; item->d_ptr->fullUpdatePending = 0; + item->d_ptr->ignoreVisible = 0; + item->d_ptr->ignoreOpacity = 0; } QStyle *style; diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index e349992..715bf37 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -825,19 +825,22 @@ void QGraphicsViewPrivate::processPendingUpdates() dirtyRegion = QRegion(); } -void QGraphicsViewPrivate::updateRegion(const QRegion &r) +bool QGraphicsViewPrivate::updateRegion(const QRegion &r) { - if (r.isEmpty() || fullUpdatePending) - return; + if (fullUpdatePending || viewportUpdateMode == QGraphicsView::NoViewportUpdate || r.isEmpty()) + return false; + + const QRect boundingRect = r.boundingRect(); + if (!boundingRect.intersects(viewport->rect())) + return false; // Update region outside viewport. - // Rect intersects viewport - update everything? switch (viewportUpdateMode) { case QGraphicsView::FullViewportUpdate: fullUpdatePending = true; viewport->update(); break; case QGraphicsView::BoundingRectViewportUpdate: - dirtyBoundingRect |= r.boundingRect(); + dirtyBoundingRect |= boundingRect; if (dirtyBoundingRect.contains(viewport->rect())) { fullUpdatePending = true; viewport->update(); @@ -855,18 +858,20 @@ void QGraphicsViewPrivate::updateRegion(const QRegion &r) } break; } - case QGraphicsView::NoViewportUpdate: - // Unreachable + default: break; } + + return true; } -void QGraphicsViewPrivate::updateRect(const QRect &r) +bool QGraphicsViewPrivate::updateRect(const QRect &r) { - if (r.isEmpty() || fullUpdatePending) - return; + if (fullUpdatePending || viewportUpdateMode == QGraphicsView::NoViewportUpdate + || !r.intersects(viewport->rect())) { + return false; + } - // Rect intersects viewport - update everything? switch (viewportUpdateMode) { case QGraphicsView::FullViewportUpdate: fullUpdatePending = true; @@ -886,10 +891,11 @@ void QGraphicsViewPrivate::updateRect(const QRect &r) else dirtyRegion += r.adjusted(-2, -2, 2, 2); break; - case QGraphicsView::NoViewportUpdate: - // Unreachable + default: break; } + + return true; } QStyleOptionGraphicsItem *QGraphicsViewPrivate::allocStyleOptionsArray(int numItems) diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h index fac7bf9..9551ff6 100644 --- a/src/gui/graphicsview/qgraphicsview_p.h +++ b/src/gui/graphicsview/qgraphicsview_p.h @@ -171,8 +171,8 @@ public: dirtyBoundingRect = QRect(); dirtyRegion = QRegion(); } - void updateRect(const QRect &rect); - void updateRegion(const QRegion ®ion); + bool updateRect(const QRect &rect); + bool updateRegion(const QRegion ®ion); bool updateSceneSlotReimplementedChecked; QRegion exposedRegion; -- cgit v0.12 From f87863b11be8b0c909e52fac1b117516cf44d8fa Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 17 Jun 2009 15:45:28 +0200 Subject: QSslCertificate: Doc fix Change doc that refered to functions that got renamed --- src/network/ssl/qsslcertificate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index d2cd0d6..9d8cfb0 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -71,9 +71,10 @@ After loading a certificate, you can find information about the certificate, its subject, and its issuer, by calling one of the many accessor functions, including version(), serialNumber(), - issuerInfo() and subjectInfo(). You can call notValidBefore() and - notValidAfter() to check when the certificate was issued, and when - it expires. The publicKey() function returns the certificate + issuerInfo() and subjectInfo(). You can call effectiveDate() and + expiryDate() to check when the certificate starts being + effective and when it expires. + The publicKey() function returns the certificate subject's public key as a QSslKey. You can call issuerInfo() or subjectInfo() to get detailed information about the certificate issuer and its subject. -- cgit v0.12 From a31a48445a8a9c0e0ef046c6eaf611906e9c77a4 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 17 Jun 2009 15:51:30 +0200 Subject: QNAM: Added comment to de-confuse myself I mixed this up several times before, so here is the comment for it. --- src/network/access/qnetworkaccesshttpbackend.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 460cbe3..8a6f27a 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -316,6 +316,7 @@ void QNetworkAccessHttpBackend::disconnectFromHttp() cache->releaseEntry(cacheKey); } + // This is abut disconnecting signals, not about disconnecting TCP connections if (httpReply) disconnect(httpReply, 0, this, 0); -- cgit v0.12 From 5c3c867989ca4c02114d25a7f91d698f6d334c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 16:25:34 +0200 Subject: Fix tst_QGraphicsItem::opacityZeroUpdates Child items must ignore visible/opacity if parent does. Broke after: c9ab7a8b8504101c06456b706a84e0eb0693c77e --- src/gui/graphicsview/qgraphicsscene.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index dd128ad..e89d80f 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5419,12 +5419,18 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren = item && item->d_ptr->fullUpdatePending && (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape); } + const bool parentIgnoresVisible = item && item->d_ptr->ignoreVisible; + const bool parentIgnoresOpacity = item && item->d_ptr->ignoreOpacity; for (int i = 0; i < children->size(); ++i) { QGraphicsItem *child = children->at(i); if (wasDirtyParentSceneTransform) child->d_ptr->dirtySceneTransform = 1; if (wasDirtyParentViewBoundingRects) child->d_ptr->paintedViewBoundingRectsNeedRepaint = 1; + if (parentIgnoresVisible) + child->d_ptr->ignoreVisible = 1; + if (parentIgnoresOpacity) + child->d_ptr->ignoreOpacity = 1; if (allChildrenDirty) { child->d_ptr->dirty = 1; -- cgit v0.12 From e3736c5031b941a665952a9696d989d79b25f32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 16 Jun 2009 09:03:15 +0200 Subject: Fixed segmentation fault caused by empty clip. Make sure not to use the broken QRect constructor, and do an early check on whether the clip rect is empty in QRasterizer::rasterizeLine(). Task-number: 254105 Reviewed-by: Trond --- src/gui/painting/qpaintengine_raster.cpp | 2 +- src/gui/painting/qrasterizer.cpp | 2 +- tests/auto/qpainter/tst_qpainter.cpp | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 743c4b8..84af880 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3956,7 +3956,7 @@ void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data) const QClipData *c = clip(); if (c) { const QRect r(QPoint(c->xmin, c->ymin), - QPoint(c->xmax, c->ymax)); + QSize(c->xmax - c->xmin, c->ymax - c->ymin)); clipRect = clipRect.intersected(r); blend = data->blend; } else { diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 629b38e..58e4b4e 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -703,7 +703,7 @@ static inline qreal qRoundF(qreal v) void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { - if (a == b || width == 0) + if (a == b || width == 0 || d->clipRect.isEmpty()) return; QPointF pa = a; diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index dcf9a04..cb532ce 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -227,6 +227,7 @@ private slots: void extendedBlendModes(); void zeroOpacity(); + void emptyClip(); private: void fillData(); @@ -4194,5 +4195,23 @@ void tst_QPainter::zeroOpacity() QCOMPARE(target.pixel(0, 0), 0xff000000); } +void tst_QPainter::emptyClip() +{ + QImage img(64, 64, QImage::Format_ARGB32_Premultiplied); + QPainter p(&img); + p.setRenderHints(QPainter::Antialiasing); + p.setClipRect(0, 32, 64, 0); + p.fillRect(0, 0, 64, 64, Qt::white); + + QPainterPath path; + path.lineTo(64, 0); + path.lineTo(64, 64); + path.lineTo(40, 64); + path.lineTo(40, 80); + path.lineTo(0, 80); + + p.fillPath(path, Qt::green); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" -- cgit v0.12 From c65262cf3e3cd9c72184582306e550f686b2f27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 17 Jun 2009 15:46:19 +0200 Subject: Fixed bugs in QPainterPath::united(). Change from a relative to an absolute fuzzy compare as was the case pre-4.4. With a relative fuzzy compare points that have an x or y coordinate of 0 will never be merged with points that are very close to 0, for example (1e-15, 0). Task-number: 251909 Reviewed-by: Trond --- src/gui/painting/qpathclipper.cpp | 69 +++++++++++++++++----------- tests/auto/qpathclipper/tst_qpathclipper.cpp | 20 ++++++++ 2 files changed, 62 insertions(+), 27 deletions(-) diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 544b838..d4c92cc 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -45,9 +45,6 @@ #include #include -#include -#include - /** The algorithm is as follows: @@ -68,6 +65,20 @@ QT_BEGIN_NAMESPACE +static inline bool fuzzyIsNull(qreal d) +{ + if (sizeof(qreal) == sizeof(double)) + return qAbs(d) <= 1e-12; + else + return qAbs(d) <= 1e-5f; +} + +static inline bool comparePoints(const QPointF &a, const QPointF &b) +{ + return fuzzyIsNull(a.x() - b.x()) + && fuzzyIsNull(a.y() - b.y()); +} + //#define QDEBUG_CLIPPER static qreal dot(const QPointF &a, const QPointF &b) { @@ -105,8 +116,10 @@ private: bool QIntersectionFinder::beziersIntersect(const QBezier &one, const QBezier &two) const { - return (one.pt1() == two.pt1() && one.pt2() == two.pt2() && one.pt3() == two.pt3() && one.pt4() == two.pt4()) - || (one.pt1() == two.pt4() && one.pt2() == two.pt3() && one.pt3() == two.pt2() && one.pt4() == two.pt1()) + return (comparePoints(one.pt1(), two.pt1()) && comparePoints(one.pt2(), two.pt2()) + && comparePoints(one.pt3(), two.pt3()) && comparePoints(one.pt4(), two.pt4())) + || (comparePoints(one.pt1(), two.pt4()) && comparePoints(one.pt2(), two.pt3()) + && comparePoints(one.pt3(), two.pt2()) && comparePoints(one.pt4(), two.pt1())) || QBezier::findIntersections(one, two, 0); } @@ -118,17 +131,17 @@ bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const const QPointF q1 = b.p1(); const QPointF q2 = b.p2(); - if (p1 == p2 || q1 == q2) + if (comparePoints(p1, p2) || comparePoints(q1, q2)) return false; - const bool p1_equals_q1 = (p1 == q1); - const bool p2_equals_q2 = (p2 == q2); + const bool p1_equals_q1 = comparePoints(p1, q1); + const bool p2_equals_q2 = comparePoints(p2, q2); if (p1_equals_q1 && p2_equals_q2) return true; - const bool p1_equals_q2 = (p1 == q2); - const bool p2_equals_q1 = (p2 == q1); + const bool p1_equals_q2 = comparePoints(p1, q2); + const bool p2_equals_q1 = comparePoints(p2, q1); if (p1_equals_q2 && p2_equals_q1) return true; @@ -184,8 +197,10 @@ bool QIntersectionFinder::linesIntersect(const QLineF &a, const QLineF &b) const void QIntersectionFinder::intersectBeziers(const QBezier &one, const QBezier &two, QVector > &t, QDataBuffer &intersections) { - if ((one.pt1() == two.pt1() && one.pt2() == two.pt2() && one.pt3() == two.pt3() && one.pt4() == two.pt4()) - || (one.pt1() == two.pt4() && one.pt2() == two.pt3() && one.pt3() == two.pt2() && one.pt4() == two.pt1())) { + if ((comparePoints(one.pt1(), two.pt1()) && comparePoints(one.pt2(), two.pt2()) + && comparePoints(one.pt3(), two.pt3()) && comparePoints(one.pt4(), two.pt4())) + || (comparePoints(one.pt1(), two.pt4()) && comparePoints(one.pt2(), two.pt3()) + && comparePoints(one.pt3(), two.pt2()) && comparePoints(one.pt4(), two.pt1()))) { return; } @@ -230,17 +245,17 @@ void QIntersectionFinder::intersectLines(const QLineF &a, const QLineF &b, QData const QPointF q1 = b.p1(); const QPointF q2 = b.p2(); - if (p1 == p2 || q1 == q2) + if (comparePoints(p1, p2) || comparePoints(q1, q2)) return; - const bool p1_equals_q1 = (p1 == q1); - const bool p2_equals_q2 = (p2 == q2); + const bool p1_equals_q1 = comparePoints(p1, q1); + const bool p2_equals_q2 = comparePoints(p2, q2); if (p1_equals_q1 && p2_equals_q2) return; - const bool p1_equals_q2 = (p1 == q2); - const bool p2_equals_q1 = (p2 == q1); + const bool p1_equals_q2 = comparePoints(p1, q2); + const bool p2_equals_q1 = comparePoints(p2, q1); if (p1_equals_q2 && p2_equals_q1) return; @@ -624,11 +639,11 @@ public: const qreal pivot = pivotComponents[depth & 1]; const qreal value = pointComponents[depth & 1]; - if (qFuzzyCompare(pivot, value)) { + if (fuzzyIsNull(pivot - value)) { const qreal pivot2 = pivotComponents[(depth + 1) & 1]; const qreal value2 = pointComponents[(depth + 1) & 1]; - if (qFuzzyCompare(pivot2, value2)) { + if (fuzzyIsNull(pivot2 - value2)) { if (node.id < 0) node.id = m_tree->nextId(); @@ -802,15 +817,15 @@ QWingedEdge::TraversalStatus QWingedEdge::next(const QWingedEdge::TraversalStatu static bool isLine(const QBezier &bezier) { - const bool equal_1_2 = bezier.pt1() == bezier.pt2(); - const bool equal_2_3 = bezier.pt2() == bezier.pt3(); - const bool equal_3_4 = bezier.pt3() == bezier.pt4(); + const bool equal_1_2 = comparePoints(bezier.pt1(), bezier.pt2()); + const bool equal_2_3 = comparePoints(bezier.pt2(), bezier.pt3()); + const bool equal_3_4 = comparePoints(bezier.pt3(), bezier.pt4()); // point? if (equal_1_2 && equal_2_3 && equal_3_4) return true; - if (bezier.pt1() == bezier.pt4()) + if (comparePoints(bezier.pt1(), bezier.pt4())) return equal_1_2 || equal_3_4; return (equal_1_2 && equal_3_4) || (equal_1_2 && equal_2_3) || (equal_2_3 && equal_3_4); @@ -844,14 +859,14 @@ void QPathSegments::addPath(const QPainterPath &path) else currentPoint = path.elementAt(i); - if (i > 0 && m_points.at(lastMoveTo) == currentPoint) + if (i > 0 && comparePoints(m_points.at(lastMoveTo), currentPoint)) current = lastMoveTo; else m_points << currentPoint; switch (path.elementAt(i).type) { case QPainterPath::MoveToElement: - if (hasMoveTo && last != lastMoveTo && m_points.at(last) != m_points.at(lastMoveTo)) + if (hasMoveTo && last != lastMoveTo && !comparePoints(m_points.at(last), m_points.at(lastMoveTo))) m_segments << Segment(m_pathId, last, lastMoveTo); hasMoveTo = true; last = lastMoveTo = current; @@ -879,7 +894,7 @@ void QPathSegments::addPath(const QPainterPath &path) } } - if (hasMoveTo && last != lastMoveTo && m_points.at(last) != m_points.at(lastMoveTo)) + if (hasMoveTo && last != lastMoveTo && !comparePoints(m_points.at(last), m_points.at(lastMoveTo))) m_segments << Segment(m_pathId, last, lastMoveTo); for (int i = firstSegment; i < m_segments.size(); ++i) { @@ -1357,7 +1372,7 @@ void QWingedEdge::addBezierEdge(const QBezier *bezier, const QPointF &a, const Q if (qFuzzyCompare(alphaA, alphaB)) return; - if (a == b) { + if (comparePoints(a, b)) { int v = insert(a); addBezierEdge(bezier, v, v, alphaA, alphaB, path); diff --git a/tests/auto/qpathclipper/tst_qpathclipper.cpp b/tests/auto/qpathclipper/tst_qpathclipper.cpp index f3077ee..6e6b632 100644 --- a/tests/auto/qpathclipper/tst_qpathclipper.cpp +++ b/tests/auto/qpathclipper/tst_qpathclipper.cpp @@ -93,6 +93,7 @@ private slots: void task204301(); void task209056(); + void task251909(); }; Q_DECLARE_METATYPE(QPainterPath) @@ -1397,6 +1398,25 @@ void tst_QPathClipper::task209056() QVERIFY(p3 != QPainterPath()); } +void tst_QPathClipper::task251909() +{ + QPainterPath p1; + p1.moveTo(0, -10); + p1.lineTo(10, -10); + p1.lineTo(10, 0); + p1.lineTo(0, 0); + + QPainterPath p2; + p2.moveTo(0, 8e-14); + p2.lineTo(10, -8e-14); + p2.lineTo(10, 10); + p2.lineTo(0, 10); + + QPainterPath result = p1.united(p2); + + QVERIFY(result.elementCount() <= 5); +} + QTEST_APPLESS_MAIN(tst_QPathClipper) -- cgit v0.12 From bcfdfb4bb223a3be146ff21f604b8e75ffa2ef13 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 17 Jun 2009 14:52:01 +0200 Subject: Update Russian translation for Qt libraries. Added QtWebkit and QXmlPatterns translations. This is an almost complete translation. Merge-request: 689 Reviewed-by: Oswald Buddenhagen --- translations/qt_ru.ts | 3436 ++++++++++++++++++++++++------------------------- 1 file changed, 1681 insertions(+), 1755 deletions(-) diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts index 28e786b..1e6a4eb 100644 --- a/translations/qt_ru.ts +++ b/translations/qt_ru.ts @@ -1,37 +1,30 @@ - + AudioOutput <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> - + <html>Звуковое устройство <b>%1</b> не работает.<br/>Будет использоваться <b>%2</b>.</html> <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> - + <html>Переключение на звуковое устройство <b>%1</b><br/>, которое доступно и имеет высший приоритет.</html> Revert back to device '%1' - + Возвращение к устройству '%1' CloseButton - + Close Tab - - - - - PPDOptionsModel - - Name - Имя + Закрыть вкладку @@ -39,32 +32,32 @@ Notifications - + Уведомления Music - + Музыка Video - + Видео Communication - + Общение Games - + Игры Accessibility - + Средства для людей с ограниченными возможностями @@ -73,13 +66,15 @@ Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. Some video features have been disabled. - + Внимание: Похоже, пакет gstreamer0.10-plugins-good не установлен. + Некоторые возможности воспроизведения видео недоступны. Warning: You do not seem to have the base GStreamer plugins installed. All audio and video support has been disabled - + Внимание: Похоже, основной модуль GStreamer не установлен. + Поддержка видео и аудио отключена @@ -90,12 +85,15 @@ Check your Gstreamer installation and make sure you have libgstreamer-plugins-base installed. - + Невозможно начать воспроизведение. + +Проверьте установку Gstreamer и убедитесь, +что пакет libgstreamer-plugins-base установлен. A required codec is missing. You need to install the following codec(s) to play this content: %0 - + Отсутствует необходимый кодек. Вам нужно установить следующие кодеки для воспроизведения данного содержимого: %0 @@ -107,27 +105,27 @@ have libgstreamer-plugins-base installed. Could not open media source. - + Не удалось открыть источник медиа-данных. Invalid source type. - + Неверный тип источника медиа-данных. Could not locate media source. - + Не удалось найти источник медиа-данных. Could not open audio device. The device is already in use. - + Не удалось открыть звуковое устройство. Устройство уже используется. Could not decode media source. - + Не удалось декодировать источник медиа-данных. @@ -136,14 +134,14 @@ have libgstreamer-plugins-base installed. Volume: %1% - + Громкость: %1% Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% - + Используйте данный ползунок для настройки громкости. Крайнее левое положение соответствует 0%, крайнее правое - %1% @@ -151,12 +149,12 @@ have libgstreamer-plugins-base installed. %1, %2 not defined - + %1, %2 не определен Ambiguous %1 not handled - + Неоднозначный %1 не обрабатывается @@ -164,52 +162,52 @@ have libgstreamer-plugins-base installed. True - True + Да False - False + Нет Insert - Вставить + Вставить Update - Обновить + Обновить Delete - Удалить + Удалить Q3FileDialog - + Copy or Move a File - Копировать или переместить файл + Копировать или переместить файл Read: %1 - Открытие: %1 + Чтение: %1 Write: %1 - Запись: %1 + Запись: %1 - + Cancel - Отмена + Отмена @@ -217,307 +215,307 @@ have libgstreamer-plugins-base installed. All Files (*) - Все файлы (*) + Все файлы (*) Name - Имя + Имя Size - Размер + Размер Type - Тип + Тип Date - Дата + Дата Attributes - Атрибуты + Атрибуты &OK - &OK + &Готово Look &in: - &Смотреть в: + &Папка: File &name: - &Имя файла: + &Имя файла: File &type: - &Тип файла: + &Тип файла: Back - Назад + Назад One directory up - Вверх на один уровень + На один уровень вверх Create New Folder - Создать новый каталог + Создать папку List View - Список + Список Detail View - Детальный вид + Подробный вид Preview File Info - Предпросмотр информации о файле + Предпросмотр информации о файле Preview File Contents - Предпросмотр содержимого файла + Предпросмотр содержимого файла Read-write - Чтение-запись + Чтение и запись Read-only - Только чтение + Только чтение Write-only - Только запись + Только запись Inaccessible - Нет доступа + Нет доступа Symlink to File - Ссылка на файл + Ссылка на файл Symlink to Directory - Ссылка на каталог + Ссылка на каталог Symlink to Special - Ссылка на спецфайл + Ссылка на спецфайл File - Файл + Файл Dir - Каталог + Каталог Special - Спецфайл + Спецфайл Open - Открыть + Открыть Save As - Сохранить как + Сохранить как &Open - &Открыть + &Открыть &Save - &Сохранить + &Сохранить &Rename - &Переименовать + &Переименовать &Delete - &Удалить + &Удалить R&eload - О&бновить + О&бновить Sort by &Name - По &имени + По &имени Sort by &Size - По &размеру + По &размеру Sort by &Date - По &дате + По &дате &Unsorted - &Не упорядочивать + &Не упорядочивать Sort - Упорядочить + Упорядочить Show &hidden files - Показать &скрытые файлы + Показать скр&ытые файлы the file - файл + файл the directory - каталог + каталог the symlink - ссылку + ссылку Delete %1 - Удалить %1 + Удалить %1 <qt>Are you sure you wish to delete %1 "%2"?</qt> - <qt>Вы действительно хотите удалить %1 "%2"?</qt> + <qt>Вы действительно хотите удалить %1 "%2"?</qt> &Yes - &Да + &Да &No - &Нет + &Нет New Folder 1 - Новый каталог 1 + Новая папка 1 New Folder - Новый каталог + Новая папка New Folder %1 - Новый каталог %1 + Новая папка %1 Find Directory - Найти каталог + Найти каталог Directories - Каталоги + Каталоги Directory: - Каталог: + Каталог: Error - Ошибка + Ошибка %1 File not found. Check path and filename. - %1 + %1 Файл не найден. Проверьте правильность пути и имени файла. All Files (*.*) - Все файлы (*.*) + Все файлы (*.*) Open - Открыть + Открыть Select a Directory - Выбрать каталог + Выбрать каталог @@ -527,21 +525,21 @@ Check path and filename. Could not read directory %1 - Невозможно просмотреть каталог + Не удалось прочитать каталог %1 Could not create directory %1 - Невозможно создать каталог + Не удалось создать каталог %1 Could not remove file or directory %1 - Невозможно удалить файл или каталог + Не удалось удалить файл или каталог %1 @@ -550,7 +548,7 @@ Check path and filename. %1 to %2 - Невозможно переименовать + Не удалось переименовать %1 в %2 @@ -559,14 +557,14 @@ to Could not open %1 - Невозможно открыть + Не удалось открыть %1 Could not write %1 - Невозможно записать + Не удалось записать %1 @@ -575,12 +573,12 @@ to Line up - Выровнять + Выровнять Customize... - Настроить... + Настроить... @@ -588,7 +586,7 @@ to Operation stopped by the user - Операция прервана пользователем + Операция остановлена пользователем @@ -597,7 +595,7 @@ to Cancel - Отмена + Отмена @@ -606,27 +604,27 @@ to OK - OK + Готово Apply - Применить + Применить Help - Справка + Справка Defaults - По умолчанию + По умолчанию Cancel - Отмена + Отмена @@ -634,38 +632,38 @@ to &Undo - &Отменить + &Отменить действие &Redo - &Повторить + &Повторить действие Cu&t - &Вырезать + &Вырезать &Copy - &Копировать + &Копировать &Paste - &Вставить + В&ставить Clear - Очистить + Очистить Select All - Выделить все + Выделить всё @@ -673,67 +671,67 @@ to System - + Системное меню Restore up - + Восстановить Minimize - Свернуть + Свернуть Restore down - + Восстановить Maximize - Развернуть + Распахнуть Close - Закрыть + Закрыть Contains commands to manipulate the window - + Содержит команды управления окном Puts a minimized back to normal - + Возвращает свёрнутое окно в нормальное состояние Moves the window out of the way - + Сворачивает окно Puts a maximized window back to normal - + Возвращает распахнутое окно в нормальное состояние Makes the window full screen - + Разворачивает окно на весь экран Closes the window - + Зыкрывает окно Displays the name of the window and contains controls to manipulate it - + Отображает название окна и содержит команды управления им @@ -741,7 +739,7 @@ to More... - Больше... + Больше... @@ -751,49 +749,49 @@ to The protocol `%1' is not supported - Протокол `%1' не поддерживается + Протокол '%1' не поддерживается The protocol `%1' does not support listing directories - Протокол `%1' не поддерживает просмотр каталогов + Протокол '%1' не поддерживает просмотр каталогов The protocol `%1' does not support creating new directories - Протокол `%1' не поддерживает создание новых каталогов + Протокол '%1' не поддерживает создание каталогов The protocol `%1' does not support removing files or directories - Протокол `%1' не поддерживает удаление файлов или каталогов + Протокол '%1' не поддерживает удаление файлов или каталогов The protocol `%1' does not support renaming files or directories - Протокол `%1' не поддерживает переименование файлов или каталогов + Протокол '%1' не поддерживает переименование файлов или каталогов The protocol `%1' does not support getting files - Протокол `%1' не поддерживает доставку файлов + Протокол '%1' не поддерживает доставку файлов The protocol `%1' does not support putting files - Протокол `%1' не поддерживает отправку файлов + Протокол '%1' не поддерживает отправку файлов The protocol `%1' does not support copying or moving files or directories - Протокол `%1' не поддерживает копирование или перемещение файлов и каталогов + Протокол '%1' не поддерживает копирование или перемещение файлов или каталогов (unknown) - (неизвестно) + (неизвестно) @@ -801,72 +799,72 @@ to &Cancel - &Отмена + &Отмена < &Back - < &Назад + < &Назад &Next > - &Вперед > + &Далее > &Finish - &Финиш + &Завершить &Help - &Справка + &Справка QAbstractSocket - + Host not found - + Узел не найден Connection refused - Отказано в соединении + Отказано в соединении Connection timed out - + Время на соединение истекло Operation on socket is not supported - + Операция с сокетом не поддерживается Socket operation timed out - + Время на операцию с сокетом истекло Socket is not connected - + Сокет не подключён Network unreachable - + Сеть недоступна @@ -874,26 +872,25 @@ to &Step up - + Шаг вв&ерх Step &down - + Шаг вн&из &Select All - + &Выделить всё QApplication - - QT_LAYOUT_DIRECTION - Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. - LTR + + Activate + Активировать @@ -906,37 +903,38 @@ to Ошибка совместимости библиотеки Qt - - Activate - + + QT_LAYOUT_DIRECTION + Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. + LTR - + Activates the program's main window - + Активирует главное окно программы QAxSelect - + Select ActiveX Control - + Выбор компоненты ActiveX - + OK - OK + Выбрать - + &Cancel - &Отмена + &Отмена - + COM &Object: - + COM &Объект: @@ -944,17 +942,17 @@ to Uncheck - + Снять отметку Check - + Отметить Toggle - + Переключить @@ -977,17 +975,17 @@ to &Red: - &Крас: + &Красный: &Green: - &Зел: + &Зелёный: Bl&ue: - С&ин: + С&иний: @@ -997,7 +995,7 @@ to Select Color - + Выбор цвета @@ -1007,28 +1005,12 @@ to &Custom colors - &Собственные цвета - - - &Define Custom Colors >> - &Выбрать собственные цвета >> - - - OK - OK - - - Cancel - Отмена + &Произвольные цвета &Add to Custom Colors - &Добавить к собственным цветам - - - Select color - Выбрать цвет + &Добавить к произвольным цветам @@ -1037,22 +1019,22 @@ to Open - Открыть + Открыть False - False + Нет True - True + Да Close - Закрыть + Закрыть @@ -1061,76 +1043,76 @@ to %1: key is empty QSystemSemaphore - + %1: пустой ключ %1: unable to make key QSystemSemaphore - + %1: невозможно создать ключ %1: ftok failed QSystemSemaphore - + %1: ошибка ftok QDB2Driver - + Unable to connect - + Невозможно соединиться - + Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback transaction - + Невозможно откатить транзакцию Unable to set autocommit - + Невозможно установить автовыполнение транзакции QDB2Result - + Unable to execute statement - + Невозможно выполнить выражение Unable to prepare statement - + Невозможно подготовить выражение Unable to bind variable - + Невозможно привязать значение Unable to fetch record %1 - + Невозможно получить запись %1 Unable to fetch next - + Невозможно получить следующую строку Unable to fetch first - + Невозможно получить первую строку @@ -1184,132 +1166,132 @@ to Done - + Готово QDialogButtonBox - + OK - OK + Готово - - Save - Сохранить + + &OK + &Готово - + &Save - &Сохранить + &Сохранить + + + + Save + Сохранить Open - Открыть + Открыть - Cancel - Отмена + &Cancel + &Отмена - &Cancel - &Отмена + Cancel + Отмена - Close - Закрыть + &Close + &Закрыть - &Close - &Закрыть + Close + Закрыть Apply - Применить + Применить Reset - + Сбросить Help - Справка + Справка Don't Save - + Не сохранять Discard - + Отклонить &Yes - &Да + &Да Yes to &All - + Да для &всех &No - &Нет + &Нет N&o to All - + Н&ет для всех Save All - + Сохранить все Abort - + Прервать Retry - + Повторить Ignore - + Пропустить Restore Defaults - + Восстановить значения по умолчанию Close without Saving - - - - - &OK - &OK + Закрыть без сохранения @@ -1317,29 +1299,29 @@ to Name - Имя + Имя Size - Размер + Размер Kind Match OS X Finder - + Вид Type All other platforms - Тип + Тип Date Modified - + Дата изменения @@ -1347,7 +1329,7 @@ to Close - Закрыть + Закрыть @@ -1365,28 +1347,18 @@ to More - + Больше Less - + Меньше QErrorMessage - - &Show this message again - &Показывать это сообщение в дальнейшем - - - - &OK - &OK - - - + Debug Message: Отладочное сообщение: @@ -1400,326 +1372,347 @@ to Fatal Error: Критическая ошибка: + + + &Show this message again + &Показывать это сообщение в дальнейшем + + + + &OK + &Закрыть + QFile - + Destination file exists - + Файл существует - + + Will not rename sequential file using block copy + Последовательный файл не будет переименовываться с использованием поблочного копирования + + + Cannot remove source file - + Невозможно удалить исходный файл - + Cannot open %1 for input - + Невозможно открыть %1 для ввода Cannot open for output - + Невозможно открыть для вывода Failure to write block - + Сбой записи блока Cannot create %1 for output - + Невозможно создать %1 для вывода QFileDialog - - + + All Files (*) Все файлы (*) - - - Back - Назад - - - - - List View - Список + + Directories + Каталоги - - - Detail View - Детальный вид + + + + + &Open + &Открыть - - - File - Файл + + + &Save + &Сохранить - + Open Открыть - - Save As - Сохранить как - - - - - - - &Open - &Открыть + + %1 already exists. +Do you want to replace it? + %1 уже существует. +Хотите заменить его? - - - &Save - &Сохранить + + %1 +File not found. +Please verify the correct file name was given. + %1 +Файл не найден. +Проверьте правильность указанного имени файла. - - Recent Places - + + My Computer + Мой компьютер - + &Rename - &Переименовать + &Переименовать &Delete - &Удалить + &Удалить Show &hidden files - Показать &скрытые файлы + Показать скр&ытые файлы - - New Folder - Новый каталог + + + Back + Назад - - Find Directory - Найти каталог + + + Parent Directory + Родительский каталог - - Directories - Каталоги + + + List View + Список - - All Files (*.*) - Все файлы (*.*) + + + Detail View + Подробный вид - - - Directory: - Каталог: + + + Files of type: + Типы файлов: - - %1 already exists. -Do you want to replace it? - + + + Directory: + Каталог: - + + %1 -File not found. -Please verify the correct file name was given. - +Directory not found. +Please verify the correct directory name was given. + %1 +Каталог не найден. +Проверьте правильность указанного имени каталога. - - My Computer - + + '%1' is write protected. +Do you want to delete it anyway? + '%1' защищён от записи. +Всё-равно хотите удалить? - - - Parent Directory - + + Are sure you want to delete '%1'? + Вы уверены, что хотите удалить '%1'? - - - Files of type: - + + Could not delete directory. + Не удалось удалить каталог. - - - %1 -Directory not found. -Please verify the correct directory name was given. - + + Recent Places + Недавние документы - - '%1' is write protected. -Do you want to delete it anyway? - + + All Files (*.*) + Все файлы (*.*) - - Are sure you want to delete '%1'? - + + Save As + Сохранить как - - Could not delete directory. - + + Drive + Диск - - Drive - + + + File + Файл - + Unknown - + Неизвестный - + + Find Directory + Найти каталог + + + Show - + Показать - - + + Forward - Вперед + Вперёд + + + + New Folder + Новая папка - + &New Folder - + &Новая папка - + &Choose - + &Выбрать - + Remove - + Удалить - - + + File &name: - &Имя файла: + &Имя файла: - - + + Look in: - + Перейти к: - - + + Create New Folder - Создать новый каталог + Создать папку QFileSystemModel - - %1 TB - - - - - %1 GB - - - - - %1 MB - - - - - %1 KB - - - - - %1 bytes - - - - + Invalid filename - + Некорректное имя файла <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. - + <b>Имя "%1" не может быть использовано.</b><p>Попробуйте использовать имя меньшей длины и/или без символов пунктуации. Name - Имя + Имя Size - Размер + Размер Kind Match OS X Finder - + Вид Type All other platforms - Тип + Тип Date Modified - + Дата изменения - + My Computer - + Мой компьютер Computer - + Компьютер + + + + %1 TB + %1 Тб + + + + %1 GB + %1 Гб + + + + %1 MB + %1 Мб + + + + %1 KB + %1 Кб + + + + %1 bytes + %1 байт @@ -1728,80 +1721,80 @@ Do you want to delete it anyway? Normal - + Обычный Bold - + Жирный Demi Bold - + Полужирный Black - + Чёрный Demi - + Средний Light - + Светлый Italic - + Курсив Oblique - + Наклонный Any - + Любая Latin - + Латиница Greek - + Греческая Cyrillic - + Кириллица Armenian - + Армянская Hebrew - + Иврит @@ -1811,7 +1804,7 @@ Do you want to delete it anyway? Syriac - + Сирийская @@ -1871,7 +1864,7 @@ Do you want to delete it anyway? Thai - + Тайская @@ -1881,7 +1874,7 @@ Do you want to delete it anyway? Tibetan - + Тибетская @@ -1891,42 +1884,42 @@ Do you want to delete it anyway? Georgian - + Грузинская Khmer - + Кхмерская Simplified Chinese - + Китайская упрощенная Traditional Chinese - + Китайская традиционная Japanese - + Японская Korean - + Корейская Vietnamese - + Вьетнамская Symbol - + Символьная @@ -1936,20 +1929,20 @@ Do you want to delete it anyway? Runic - + Руническая QFontDialog - + &Font &Шрифт Font st&yle - &Стиль шрифта + Ст&иль шрифта @@ -1964,12 +1957,12 @@ Do you want to delete it anyway? Stri&keout - &Перечеркивать + Зачёр&кнутый &Underline - П&одчеркивать + П&одчёркнутый @@ -1977,74 +1970,59 @@ Do you want to delete it anyway? Пример - - - Select Font - Выбрать шрифт + + Wr&iting System + &Система письма - - Wr&iting System - + + + Select Font + Выбор шрифта QFtp - - Host %1 found - Обнаружен узел %1 - - - - Host found - Узел обнаружен - - - - - - Connected to host %1 - Установлено соединение с узлом %1 - - - - Connected to host - Соединение с узлом установлено - - - - Connection to %1 closed - Соединение с узлом %1 разорвано - - - - - - Connection closed - Соединение разорвано + + + Not connected + Соединение не установлено - - + + Host %1 not found - Узел %1 не обнаружен + Узел %1 не найден Connection refused to host %1 - Отказано в соединении с узлом %1 + В соединении с узлом %1 отказано Connection timed out to host %1 - + Время на соединение с узлом %1 истекло - + + + + Connected to host %1 + Установлено соединение с узлом %1 + + + + + Connection refused for data connection + Отказ в соединении для передачи данных + + + - + Unknown error Неизвестная ошибка @@ -2054,7 +2032,7 @@ Do you want to delete it anyway? Connecting to host failed: %1 - Ошибка соединения с узлом: + Не удалось соединиться с узлом: %1 @@ -2062,7 +2040,7 @@ Do you want to delete it anyway? Login failed: %1 - Ошибка входа в систему: + Не удалось авторизоваться: %1 @@ -2070,7 +2048,7 @@ Do you want to delete it anyway? Listing directory failed: %1 - Ошибка просмотра каталога: + Не удалось прочитать каталог: %1 @@ -2078,7 +2056,7 @@ Do you want to delete it anyway? Changing directory failed: %1 - Ошибка смены каталога: + Не удалось сменить каталог: %1 @@ -2086,7 +2064,7 @@ Do you want to delete it anyway? Downloading file failed: %1 - Ошибка загрузки файла: + Не удалось загрузить файл: %1 @@ -2094,7 +2072,7 @@ Do you want to delete it anyway? Uploading file failed: %1 - Ошибка отправки файла: + Не удалось отгрузить файл: %1 @@ -2102,7 +2080,7 @@ Do you want to delete it anyway? Removing file failed: %1 - Ошибка удаления файла: + Не удалось удалить файл: %1 @@ -2110,7 +2088,7 @@ Do you want to delete it anyway? Creating directory failed: %1 - Ошибка создания каталога: + Не удалось создать каталог: %1 @@ -2118,20 +2096,35 @@ Do you want to delete it anyway? Removing directory failed: %1 - Ошибка удаления каталога: + Не удалось удалить каталог: %1 - - - Not connected - Нет соединения + + + + Connection closed + Соединение закрыто - - - Connection refused for data connection - Отказано в соединении передачи данных + + Host %1 found + Узел %1 найден + + + + Connection to %1 closed + Соединение с %1 закрыто + + + + Host found + Узел найден + + + + Connected to host + Соединение с узлом установлено @@ -2139,7 +2132,7 @@ Do you want to delete it anyway? Unknown error - Неизвестная ошибка + Неизвестная ошибка @@ -2149,12 +2142,12 @@ Do you want to delete it anyway? - + Host not found - + Узел не найден @@ -2162,170 +2155,170 @@ Do you want to delete it anyway? Unknown address type - + Неизвестный тип адреса Unknown error - Неизвестная ошибка + Неизвестная ошибка QHttp - - - Connection refused - Отказано в соединении - - - - - - Host %1 not found - Узел %1 не обнаружен + + + + + Unknown error + Неизвестная ошибка - - - Wrong content length - Неверная длина данных + + + Request aborted + Запрос прерван - - HTTPS connection requested but SSL support not compiled in - + + + No server set to connect to + Не указан сервер для подключения - - - - - HTTP request failed - Ошибка HTTP-запроса + + + Wrong content length + Неверная длина содержимого - - Host %1 found - Обнаружен узел %1 + + + Server closed connection unexpectedly + Сервер неожиданно разорвал соединение - - Host found - Узел обнаружен + + Unknown authentication method + Неизвестный метод авторизации - - Connected to host %1 - Установлено соединение с узлом %1 + + Error writing response to device + Ошибка записи ответа на устройство - - Connected to host - Соединение с узлом установлено + + + Connection refused + Отказано в соединении - - Connection to %1 closed - Соединение с узлом %1 разорвано + + + + Host %1 not found + Узел %1 не найден - - - Connection closed - Соединение разорвано + + + + + HTTP request failed + HTTP-запрос не удался - - - - - Unknown error - Неизвестная ошибка + + + Invalid HTTP response header + Некорректный HTTP-заголовок ответа - - - Request aborted - Запрос отменен + + + + + Invalid HTTP chunked body + Некорректное HTTP-фрагментирование данных - - - No server set to connect to - Не выбран сервер для подключения + + Host %1 found + Узел %1 найден - - - Server closed connection unexpectedly - Неожиданный разрыв соединения сервером + + Connected to host %1 + Установлено соединение с узлом %1 - - - Invalid HTTP response header - Получен некорректный HTTP-заголовок + + Connection to %1 closed + Соединение с узлом %1 закрыто - - Unknown authentication method - + + Host found + Узел найден - - - - - Invalid HTTP chunked body - Некорректный HTTP-ответ + + Connected to host + Соединение с узлом установлено - - Error writing response to device - + + + Connection closed + Соединение закрыто - + Proxy authentication required - + Требуется авторизация на прокси-сервере Authentication required - + Требуется авторизация Connection refused (or timed out) - + В соединении отказано (или время ожидания истекло) Proxy requires authentication - + Прокси-сервер требует авторизацию Host requires authentication - + Узел требует авторизацию Data corrupted - + Данные повреждены Unknown protocol specified - + Указан неизвестный протокол SSL handshake failed - + Квитирование SSL не удалось + + + + HTTPS connection requested but SSL support not compiled in + Запрошено соединение по протоколу HTTPS, но поддержка SSL не скомпилирована @@ -2333,188 +2326,188 @@ Do you want to delete it anyway? Did not receive HTTP response from proxy - + Не получен HTTP-ответ от прокси-сервера Error parsing authentication request from proxy - + Ошибка разбора запроса авторизации от прокси-сервера Authentication required - + Требуется авторизация Proxy denied connection - + Прокси-сервер запретил соединение Error communicating with HTTP proxy - + Ошибка обмена данными с прокси-сервером HTTP Proxy server not found - + Прокси-сервер не найден Proxy connection refused - + В соединении прокси-сервером отказано Proxy server connection timed out - + Время на соединение с прокси-сервером истекло Proxy connection closed prematurely - + Соединение с прокси-сервером неожиданно закрыто QIBaseDriver - + Error opening database - + Ошибка открытия базы данных Could not start transaction - + Не удалось начать транзакцию Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback transaction - + Невозможно откатить транзакцию QIBaseResult - + Unable to create BLOB - + Невозможно создать BLOB Unable to write BLOB - + Невозможно записать BLOB Unable to open BLOB - + Невозможно открыть BLOB Unable to read BLOB - + Невозможно прочитать BLOB - + Could not find array - + Не удалось найти массив - + Could not get array data - + Не удалось найти данные массива - + Could not get query info - + Не удалось найти информацию о запросе Could not start transaction - + Не удалось начать транзакцию Unable to commit transaction - + Невозможно выполнить транзакцию Could not allocate statement - + Не удалось получить ресурсы для создания выражения Could not prepare statement - + Не удалось подготовить выражение Could not describe input statement - + Не удалось описать входящее выражение Could not describe statement - + Не удалось описать выражение Unable to close statement - + Невозможно закрыть выражение Unable to execute query - + Невозможно выполнить запрос Could not fetch next item - + Не удалось получить следующий элемент Could not get statement info - + Не удалось найти информацию о выражении QIODevice - + Permission denied - + Доступ запрещён Too many open files - + Слишком много открытых файлов No such file or directory - + Файл или каталог не существует No space left on device - + Нет свободного места на устройстве - + Unknown error - Неизвестная ошибка + Неизвестная ошибка @@ -2522,22 +2515,22 @@ Do you want to delete it anyway? XIM - + Метод ввода X-сервера XIM input method - + Метод ввода X-сервера Windows input method - + Метод ввода Windows Mac OS X input method - + Метод ввода Mac OS X @@ -2545,7 +2538,7 @@ Do you want to delete it anyway? Enter a value: - + Укажите значение: @@ -2553,66 +2546,66 @@ Do you want to delete it anyway? Could not mmap '%1': %2 - + Не удалось выполнить mmap '%1': %2 Plugin verification data mismatch in '%1' - + Проверочная информация для модуля '%1' не совпадает Could not unmap '%1': %2 - + Не удалось выполнить unmap '%1': %2 The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] - + Модуль '%1' использует несоместимую библиотеку Qt. (%2.%3.%4) [%5] The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" - + Модуль '%1' использует несоместимую библиотеку Qt. Ожидается ключ "%2", но получен ключ "%3" Unknown error - Неизвестная ошибка + Неизвестная ошибка The shared library was not found. - + Динамическая библиотека не найдена. The file '%1' is not a valid Qt plugin. - + Файл '%1' - не является корректным модулем Qt. The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) - + Модуль '%1' использует несоместимую библиотеку Qt. (Невозможно совместить релизные и отладочные библиотеки.) Cannot load library %1: %2 - + Невозможно загрузить библиотеку %1: %2 Cannot unload library %1: %2 - + Невозможно выгрузить библиотеку %1: %2 Cannot resolve symbol "%1" in %2: %3 - + Невозможно разрешить символ "%1" в %2: %3 @@ -2620,62 +2613,62 @@ Do you want to delete it anyway? &Undo - &Отменить + &Отменить действие &Redo - &Повторить + &Повторить действие Cu&t - &Вырезать + &Вырезать &Copy - &Копировать + &Копировать &Paste - В&ставить + В&ставить - - Select All - Выделить все + + Delete + Удалить - - Delete - Удалить + + Select All + Выделить всё QLocalServer - + %1: Name error - + %1: Некорректное имя %1: Permission denied - + %1: Доступ запрещён %1: Address in use - + %1: Адрес используется %1: Unknown error %2 - + %1: Неизвестная ошибка %2 @@ -2684,13 +2677,13 @@ Do you want to delete it anyway? %1: Connection refused - + %1: Отказано в соединении %1: Remote closed - + %1: Закрыто удаленной стороной @@ -2698,143 +2691,143 @@ Do you want to delete it anyway? %1: Invalid name - + %1: Некорректное имя %1: Socket access error - + %1: Ошибка обращения к сокету %1: Socket resource error - + %1: Ошибка выделения ресурсов сокета %1: Socket operation timed out - + %1: Время на операцию с сокетом истекло %1: Datagram too large - + %1: Датаграмма слишком большая %1: Connection error - + %1: Ошибка соединения %1: The socket operation is not supported - + %1: Операция с сокетом не поддерживается %1: Unknown error - + %1: Неизвестная ошибка %1: Unknown error %2 - + %1: Неизвестная ошибка %2 QMYSQLDriver - + Unable to open database ' - + Невозможно открыть базу данных ' Unable to connect - + Невозможно соединиться - + Unable to begin transaction - + Невозможно начать транзакцию Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback transaction - + Невозможно откатить транзакцию QMYSQLResult - + Unable to fetch data - + Невозможно получить данные - + Unable to execute query - + Невозможно выполнить запрос Unable to store result - + Невозможно сохранить результат - + Unable to prepare statement - + Невозможно подготовить выражение - + Unable to reset statement - + Невозможно сбросить выражение - + Unable to bind value - + Невозможно привязать значение Unable to execute statement - + Невозможно выполнить выражение Unable to bind outvalues - + Невозможно привязать результирующие значения Unable to store statement results - + Невозможно сохранить результаты выполнения выражения - + Unable to execute next query - + Невозможно выполнить следующий запрос Unable to store next result - + Невозможно сохранить следующий результат @@ -2842,7 +2835,7 @@ Do you want to delete it anyway? (Untitled) - + (Неозаглавлено) @@ -2850,92 +2843,92 @@ Do you want to delete it anyway? %1 - [%2] - %1 - [%2] + %1 - [%2] Close - Закрыть + Закрыть Minimize - Свернуть + Свернуть Restore Down - Восстановить + Восстановить &Restore - &Восстановить + &Восстановить &Move - &Переместить + &Переместить &Size - &Размер + &Размер Mi&nimize - &Свернуть + &Свернуть Ma&ximize - Р&азвернуть + Р&аспахнуть Stay on &Top - Всегда &наверху + Оставаться &сверху &Close - &Закрыть + &Закрыть - [%1] - + - [%1] Maximize - Развернуть + Распахнуть Unshade - + Восстановить из заголовка Shade - + Свернуть в заголовок Restore - + Восстановить Help - Справка + Справка Menu - Меню + Меню @@ -2944,91 +2937,56 @@ Do you want to delete it anyway? Close - Закрыть + Закрыть Open - Открыть + Открыть Execute - + Выполнить - QMenuBar - - About - О программе - - - Config - Конфигурация - - - Preference - Настройки - - - Options - Параметры - - - Setting - Настройки - - - Setup - Настройки - - - Quit - Выход - + QMessageBox - Exit - Выход + + Help + Справка - - - QMessageBox - - + + OK - OK + Закрыть - - About Qt - + + <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> for more information.</p> + <h3>О Qt</h3><p>Данная программа использует Qt версии %1.</p><p>Qt - это инструментарий для разработки кроссплатформенных приложений на C++.</p><p>Qt предоставляет совместимость на уровне исходных текстов между MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux и всеми популярными коммерческими вариантами Unix. Также Qt доступна для встраиваемых устройств в виде Qt для Embedded Linux и Qt для Windows CE.</p><p>Qt доступна под тремя различными лицензиями, разработанными для удовлетворения требований различных пользователей.</p>Qt под нашей коммерческой лицензией предназначена для развития проприетарного/коммерческого программного обеспечения, когда Вы не желаете предоставлять исходные коды третьим сторонам, или в случае невозможности принятия условий лицензий GNU LGPL версии 2.1 или GNU GPL версии 3.0.</p><p>Qt под лицензией GNU LGPL версии 2.1 предназначена для разработки программного обеспечения с открытым исходным кодом или коммерческого программного обеспечения при соблюдении постановлений и условий лицензии GNU LGPL версии 2.1.</p><p>Qt под лицензией GNU General Public License версии 3.0 предназначена для разработки программных приложений в тех случаях, когда Вы хотели бы использовать такие приложения в сочетании с программным обеспечением на условиях лицензии GNU GPL с версии 3.0 или если Вы готовы соблюдать условия лицензии GNU GPL версии 3.0.</p><p>Обратитесь к <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> для обзора лицензий Qt.</p><p>Copyright (C) 2009 Корпорация Nokia и/или её дочерние подразделения.</p><p>Qt - продукт компании Nokia. Обратитесь к <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> для получения дополнительной информации.</p> - - Help - Справка + + About Qt + О Qt - + Show Details... - + Показать подробности... Hide Details... - - - - - <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> for more information.</p> - + Скрыть подробности... @@ -3036,7 +2994,7 @@ Do you want to delete it anyway? Select IM - + Выбор режима ввода @@ -3057,132 +3015,132 @@ Do you want to delete it anyway? The remote host closed the connection - + Удалённый узел закрыл соединение Network operation timed out - + Время на сетевую операцию истекло Out of resources - + Недостаточно ресурсов Unsupported socket operation - + Операция с сокетом не поддерживается Protocol type not supported - + Протокол не поддерживается Invalid socket descriptor - + Некорректный дескриптор сокета Network unreachable - + Сеть недоступна Permission denied - + Доступ запрещён Connection timed out - + Время на соединение истекло Connection refused - Отказано в соединении + Отказано в соединении The bound address is already in use - + Адрес уже используется The address is not available - + Адрес недоступен The address is protected - + Адрес защищён Unable to send a message - + Невозможно отправить сообщение Unable to receive a message - + Невозможно получить сообщение Unable to write - + Невозможно записать Network error - + Ошибка сети Another socket is already listening on the same port - + Другой сокет уже прослушивает этот порт Unable to initialize non-blocking socket - + Невозможно инициализировать не-блочный сокет Unable to initialize broadcast socket - + Невозможно инициализировать широковещательный сокет Attempt to use IPv6 socket on a platform with no IPv6 support - + Попытка использовать IPv6 на платформе, не поддерживающей IPv6 Host unreachable - + Узел недоступен Datagram was too large to send - + Датаграмма слишком большая для отправки Operation on non-socket - + Операция с не-сокетом Unknown error - Неизвестная ошибка + Неизвестная ошибка The proxy type is invalid for this operation - + Некорректный тип прокси-сервера для данной операции @@ -3190,7 +3148,7 @@ Do you want to delete it anyway? Error opening %1 - + Ошибка открытия %1 @@ -3198,27 +3156,27 @@ Do you want to delete it anyway? Request for opening non-local file %1 - + Запрос на открытие файла вне файловой системы %1 Error opening %1: %2 - + Ошибка открытия %1: %2 Write error writing to %1: %2 - + Ошибка записи в %1: %2 Cannot open %1: Path is a directory - + Невозможно открыть %1: Указан путь к каталогу Read error reading from %1: %2 - + Ошибка чтения из %1: %2 @@ -3226,27 +3184,27 @@ Do you want to delete it anyway? No suitable proxy found - + Подходящий прокси-сервер не найден Cannot open %1: is a directory - + Невозможно открыть %1: Указан путь к каталогу Logging in to %1 failed: authentication required - + Соединение с %1 не удалось: требуется авторизация Error while downloading %1: %2 - + Ошибка в процессе загрузки %1: %2 Error while uploading %1: %2 - + Ошибка в процессе отгрузки %1: %2 @@ -3254,7 +3212,7 @@ Do you want to delete it anyway? No suitable proxy found - + Подходящий прокси-сервер не найден @@ -3262,123 +3220,128 @@ Do you want to delete it anyway? Error downloading %1 - server replied: %2 - + Ошибка загрузки %1 - ответ сервера: %2 Protocol "%1" is unknown - + Неизвестный протокол "%1" QNetworkReplyImpl - + Operation canceled - + Операция отменена QOCIDriver - + Unable to logon - + Невозможно авторизоваться Unable to initialize QOCIDriver - + Невозможно инициализировать Unable to begin transaction - + Невозможно начать транзакцию Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback transaction - + Невозможно откатить транзакцию QOCIResult - + Unable to bind column for batch execute - + Невозможно привязать столбец для пакетного выполнения Unable to execute batch statement - + Невозможно выполнить пакетное выражение Unable to goto next - + Невозможно перейти к следующей строке Unable to alloc statement - + Невозможно создать выражение Unable to prepare statement - + Невозможно подготовить выражение - + + Unable to get statement type + Невозможно определить тип выражения + + + Unable to bind value - + Невозможно привязать результирующие значения Unable to execute statement - + Невозможно выполнить выражение QODBCDriver - + Unable to connect - + Невозможно соединиться Unable to connect - Driver doesn't support all needed functionality - + Невозможно соединиться - Драйвер не поддерживает требуемый функционал Unable to disable autocommit - + Невозможно отключить автовыполнение транзакции Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback transaction - + Невозможно откатить транзакцию Unable to enable autocommit - + Невозможно установить автовыполнение транзакции @@ -3387,50 +3350,50 @@ Do you want to delete it anyway? QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration - + QODBCResult::reset: Невозможно установить 'SQL_CURSOR_STATIC' атрибутом выражение. Проверьте настройки драйвера ODBC Unable to execute statement - + Невозможно выполнить выражение Unable to fetch next - + Невозможно получить следующую строку Unable to prepare statement - + Невозможно подготовить выражение Unable to bind variable - + Невозможно привязать значение Unable to fetch last - + Невозможно получить последнюю строку Unable to fetch - + Невозможно получить данные Unable to fetch first - + Невозможно получить первую строку Unable to fetch previous - + Невозможно получить предыдущую строку @@ -3438,61 +3401,61 @@ Do you want to delete it anyway? Home - Home + Домой Operation not supported on %1 - + Операция не поддерживается для %1 Invalid URI: %1 - + Некорректный URI: %1 Write error writing to %1: %2 - + Ошибка записи в %1: %2 Read error reading from %1: %2 - + Ошибка чтения из %1: %2 Socket error on %1: %2 - + Ошика сокета для %1: %2 Remote host closed the connection prematurely on %1 - + Удалённый узел неожиданно прервал соединение для %1 Protocol error: packet of size 0 received - + Ошибка протокола: получен пакет нулевого размера No host name given - + Имя узла не задано QPPDOptionsModel - + Name - Имя + Имя Value - + Значение @@ -3500,45 +3463,45 @@ Do you want to delete it anyway? Unable to connect - + Невозможно соединиться Could not begin transaction - + Не удалось начать транзакцию Could not commit transaction - + Не удалось выполнить транзакцию Could not rollback transaction - + Не удалось откатить транзакцию - + Unable to subscribe - + Невозможно подписаться Unable to unsubscribe - + Невозможно отписаться QPSQLResult - + Unable to create query - + Невозможно создать запрос Unable to prepare statement - + Невозможно подготовить выражение @@ -3546,102 +3509,106 @@ Do you want to delete it anyway? Centimeters (cm) - + Сантиметры (cm) Millimeters (mm) - + Миллиметры (mm) Inches (in) - + Дюймы (in) Points (pt) - + Точки (pt) - + Form - + Форма - + Paper - + Бумага - + Page size: - + Размер страницы: - + Width: - + Ширина: - + Height: - + Высота: - + Paper source: - + Источник бумаги: - + Orientation - + Ориентация - + Portrait - Портрет + Книжная - + Landscape - Альбом + Альбомная - + Reverse landscape - + Перевёрнутая альбомная - + Reverse portrait - + Перевёрнутая книжная - + Margins - + Поля - + + top margin - + верхнее поле - + + left margin - + левое поле - + + right margin - + правое поле - + + bottom margin - + нижнее поле @@ -3649,12 +3616,12 @@ Do you want to delete it anyway? Unknown error - Неизвестная ошибка + Неизвестная ошибка The plugin was not loaded. - + Модуль не был загружен. @@ -3662,13 +3629,13 @@ Do you want to delete it anyway? locally connected - локальный + соединено локально Aliases: %1 - Алиасы: %1 + Псевдонимы: %1 @@ -3677,54 +3644,7 @@ Do you want to delete it anyway? неизвестно - - OK - OK - - - Cancel - Отмена - - - Print in color if available - Цветная печать - - - Printer - Принтер - - - - Print all - Печатать все - - - - Print range - Печатать диапазон - - - Print last page first - Начать с последней страницы - - - Number of copies: - Число копий: - - - Paper format - Формат бумаги - - - Portrait - Портрет - - - Landscape - Альбом - - - + A0 (841 x 1189 mm) A0 (841 x 1189 мм) @@ -3744,7 +3664,12 @@ Do you want to delete it anyway? A3 (297 x 420 мм) - + + A4 (210 x 297 mm, 8.26 x 11.7 inches) + A4 (210 x 297 мм, 8.26 x 11.7 дюймов) + + + A5 (148 x 210 mm) A5 (148 x 210 мм) @@ -3794,7 +3719,12 @@ Do you want to delete it anyway? B4 (250 x 353 мм) - + + B5 (176 x 250 mm, 6.93 x 9.84 inches) + B5 (176 x 250 мм, 6.93 x 9.84 дюймов) + + + B6 (125 x 176 mm) B6 (125 x 176 мм) @@ -3829,7 +3759,12 @@ Do you want to delete it anyway? DLE (110 x 220 мм) - + + Executive (7.5 x 10 inches, 191 x 254 mm) + Executive (191 x 254 мм, 7.5 x 10 дюймов) + + + Folio (210 x 330 mm) Folio (210 x 330 мм) @@ -3839,88 +3774,87 @@ Do you want to delete it anyway? Ledger (432 x 279 мм) - - Tabloid (279 x 432 mm) - Tabloid (279 x 432 мм) - - - US Common #10 Envelope (105 x 241 mm) - Конверт US #10 (105x241 мм) - - - - A4 (210 x 297 mm, 8.26 x 11.7 inches) - + Legal (8.5 x 14 inches, 216 x 356 mm) + Legal (216 x 356 мм, 8.5 x 14 дюймов) - - B5 (176 x 250 mm, 6.93 x 9.84 inches) - + + Letter (8.5 x 11 inches, 216 x 279 mm) + Letter (216 x 279 мм, 8.5 x 11 дюймов) - - Executive (7.5 x 10 inches, 191 x 254 mm) - + + Tabloid (279 x 432 mm) + Tabloid (279 x 432 мм) - - Legal (8.5 x 14 inches, 216 x 356 mm) - + + US Common #10 Envelope (105 x 241 mm) + Конверт US #10 (105x241 мм) - - Letter (8.5 x 11 inches, 216 x 279 mm) - + + OK + Закрыть Print - Print - - - File - Файл + Печать Print To File ... - + Печать в файл ... + + + + Print range + Печатать диапазон + + + + Print all + Печатать все - + File %1 is not writable. Please choose a different file name. - + %1 недоступен для записи. +Выберите другое имя файла. %1 already exists. Do you want to overwrite it? - + %1 уже существует. +Хотите заменить его? - + File exists - + Файл существует <qt>Do you want to overwrite it?</qt> - + <qt>Хотите заменить?</qt> Print selection - + Выделенный фрагмент %1 is a directory. Please choose a different file name. - + %1 - это каталог. +Выберите другое имя файла. @@ -4075,48 +4009,48 @@ Please choose a different file name. Custom - + Произвольный - + &Options >> - + &Параметры >> &Print - + &Печать &Options << - + &Параметры << Print to File (PDF) - + Печать в файл (PDF) Print to File (Postscript) - + Печать в файл (Postscript) - + Local file - + Локальный файл Write %1 file - + Запись %1 файла The 'From' value cannot be greater than the 'To' value. - + Значение 'от' не может быть больше значения 'до'. @@ -4125,302 +4059,291 @@ Please choose a different file name. Page Setup - + Параметры страницы %1% - + %1% Print Preview - + Просмотр печати Next page - + Следующая страница Previous page - + Предыдущая страница First page - + Первая страница Last page - + Последняя страница Fit width - + По ширине Fit page - + На всю страницу Zoom in - + Увеличить Zoom out - + Уменьшить Portrait - Портрет + Книжная Landscape - Альбом + Альбомная Show single page - + Показать одну страницу Show facing pages - + Показать титульные страницы Show overview of all pages - + Показать обзор всех страниц Print - Print + Печать Page setup - + Параметры страницы Close - Закрыть + Закрыть Export to PDF - + Экспорт в PDF Export to PostScript - - - - - QPrintPropertiesDialog - - Save - Сохранить - - - OK - OK + Экспорт в Postscript QPrintPropertiesWidget - + Form - + Форма - + Page - + Страница - + Advanced - + Дополнительно QPrintSettingsOutput - + Form - + Форма - + Copies - + Копии - + Print range - Печатать диапазон + Диапазон печати - + Print all - Печатать все + Все - + Pages from - + Страницы от - + to - + до - + Selection - + Выделенный фрагмент - + Output Settings - + Настройки вывода - + Copies: - + Количество копий: - + Collate - + Разобрать про копиям - + Reverse - + Обратный порядок - + Options - Параметры + Параметры - + Color Mode - + Режим цвета - + Color - + Цвет - + Grayscale - + Оттенки серого - + Duplex Printing - + Двусторонняя печать - + None - + Нет - + Long side - + По длинной стороне - + Short side - + По короткой стороне QPrintWidget - + Form - + Форма - + Printer - Принтер + Принтер - + &Name: - + &Название: - + P&roperties - + С&войства - + Location: - + Расположение: - + Preview - + Просмотр - + Type: - + Тип: - + Output &file: - + Выходной &файл: - + ... - + ... QProcess - + Could not open input redirection for reading - + Не удалось открыть перенаправление ввода для чтения Could not open output redirection for writing - + Не удалось открыть перенаправление вывода для записи Resource error (fork failure): %1 - + Ошибка выделения ресурсов (сбой fork): %1 @@ -4433,7 +4356,7 @@ Please choose a different file name. Process operation timed out - + Время на операцию с процессом истекло @@ -4441,29 +4364,29 @@ Please choose a different file name. Error reading from process - + Ошибка получения данных от процесса Error writing to process - + Ошибка отправки данных процессу Process crashed - + Процесс завершился с ошибкой No program defined - + Программа не указана Process failed to start - + Не удалось запустить процесс @@ -4479,7 +4402,7 @@ Please choose a different file name. Open - Открыть + Открыть @@ -4487,7 +4410,7 @@ Please choose a different file name. Check - + Отметить @@ -4500,22 +4423,22 @@ Please choose a different file name. disabled feature used - использовались отключенные возможности + использование отключённых возможностей bad char class syntax - bad char class syntax + неправильный синтаксис класса символов bad lookahead syntax - bad lookahead syntax + неправильный предварительный синтаксис bad repetition syntax - bad repetition syntax + неправильный синтаксис повторения @@ -4541,37 +4464,37 @@ Please choose a different file name. QSQLite2Driver - + Error to open database - + Ошибка открытия базы данных Unable to begin transaction - + Невозможно начать транзакцию Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback Transaction - + Невозможно откатить транзакцию QSQLite2Result - + Unable to fetch results - + Невозможно получить результаты - + Unable to execute statement - + Невозможно выполнить выражение @@ -4579,27 +4502,27 @@ Please choose a different file name. Error opening database - + Ошибка открытия базы данных Error closing database - + Ошибка закрытия базы данных Unable to begin transaction - + Невозможно начать транзакцию Unable to commit transaction - + Невозможно выполнить транзакцию Unable to rollback transaction - + Невозможно откатить транзакцию @@ -4609,32 +4532,32 @@ Please choose a different file name. Unable to fetch row - + Невозможно получить строку Unable to execute statement - + Невозможно выполнить выражение Unable to reset statement - + Невозможно сбросить выражение Unable to bind parameters - + Невозможно привязать параметр Parameter count mismatch - + Количество параметров не совпадает No query - + Отсутствует запрос @@ -4642,184 +4565,184 @@ Please choose a different file name. Scroll here - + Прокрутить сюда Left edge - + К левой границе Top - + Вверх Right edge - + К правой границе Bottom - + Вниз Page left - + На страницу влево Page up - + На страницу вверх Page right - + На страницу вправо Page down - + На страницу вниз Scroll left - + Прокрутить влево Scroll up - + Прокрутить вверх Scroll right - + Прокрутить вправо Scroll down - + Прокрутить вниз Line up - Выровнять + На строку вверх Position - + Положение Line down - + На строку вниз QSharedMemory - + %1: unable to set key on lock - + %1: невозможно установить ключ на блокировку %1: create size is less then 0 - + %1: размер меньше нуля %1: unable to lock - + %1: невозможно заблокировать %1: unable to unlock - + %1: невозможно разблокировать %1: permission denied - + %1: доступ запрещён %1: already exists - + %1: уже существует %1: doesn't exists - + %1: не существует %1: out of resources - + %1: недостаточно ресурсов %1: unknown error %2 - + %1: неизвестная ошибка %2 %1: key is empty - + %1: пустой ключ %1: unix key file doesn't exists - + %1: специфический ключ unix не существует %1: ftok failed - + %1: ошибка ftok %1: unable to make key - + %1: невозможно создать ключ %1: system-imposed size restrictions - + %1: системой наложены ограничения на размер %1: not attached - + %1: не приложенный %1: invalid size - + %1: некорректный размер %1: key error - + %1: некорректный ключ %1: size query failed - + %1: не удалось запросить размер @@ -4827,117 +4750,117 @@ Please choose a different file name. Space - Space + Esc - Esc + Tab - Tab + Backtab - Backtab + Backspace - Backspace + Return - Return + Enter - Enter + Ins - Ins + Del - Del + Pause - Pause + Пауза Print - Print + Печать SysReq - SysReq + Home - Home + Домой End - End + Left - Left + Влево Up - Up + Вверх Right - Right + Вправо Down - Down + Вниз PgUp - PgUp + PgDown - PgDown + CapsLock - CapsLock + NumLock - NumLock + ScrollLock - ScrollLock + @@ -4957,12 +4880,12 @@ Please choose a different file name. Forward - Вперед + Вперёд Stop - Стоп + Остановить @@ -4972,72 +4895,72 @@ Please choose a different file name. Volume Down - Тише + Volume Mute - Выключить звук + Volume Up - Громче + Bass Boost - Bass Boost + Bass Up - Bass Up + Bass Down - Bass Down + Treble Up - Treble Up + Treble Down - Treble Down + Media Play - Воспроизведение + Media Stop - Остановить воспроизведение + Media Previous - Воспроизвести предыдущее + Media Next - Воспроизвести следующее + Media Record - Запись + Favorites - Избранное + @@ -5047,102 +4970,102 @@ Please choose a different file name. Standby - Дежурный режим + Open URL - Открыть URL + Launch Mail - Почта + Launch Media - Проигрыватель + Launch (0) - Запустить (0) + Launch (1) - Запустить (1) + Launch (2) - Запустить (2) + Launch (3) - Запустить (3) + Launch (4) - Запустить (4) + Launch (5) - Запустить (5) + Launch (6) - Запустить (6) + Launch (7) - Запустить (7) + Launch (8) - Запустить (8) + Launch (9) - Запустить (9) + Launch (A) - Запустить (A) + Launch (B) - Запустить (B) + Launch (C) - Запустить (C) + Launch (D) - Запустить (D) + Launch (E) - Запустить (E) + Launch (F) - Запустить (F) + @@ -5250,41 +5173,41 @@ Please choose a different file name. - + Ctrl - Ctrl + Shift - Shift + Alt - Alt + Meta - Meta + + - + + F%1 - F%1 + - + Home Page @@ -5294,27 +5217,27 @@ Please choose a different file name. Page left - + Страница влево Page up - + Страница вверх Position - + Положение Page right - + Страница вправо Page down - + Страница вниз @@ -5322,72 +5245,72 @@ Please choose a different file name. Connection to proxy refused - + В соединении прокси-сервером отказано Connection to proxy closed prematurely - + Соединение с прокси-сервером неожиданно закрыто Proxy host not found - + Прокси-сервер не найден Connection to proxy timed out - + Время на соединение с прокси-сервером истекло Proxy authentication failed - + Не удалось авторизоваться на прокси-сервере Proxy authentication failed: %1 - + Не удалось авторизоваться на прокси-сервере: %1 SOCKS version 5 protocol error - + Ошибка протокола SOCKSv5 General SOCKSv5 server failure - + Ошибка сервере SOCKSv5 Connection not allowed by SOCKSv5 server - + Соединение не разрешено сервером SOCKSv5 TTL expired - + TTL истекло SOCKSv5 command not supported - + Команда SOCKSv5 не поддерживается Address type not supported - + Тип адреса не поддерживается Unknown SOCKSv5 proxy error code 0x%1 - + Неизвестная ошибка SOCKSv5 прокси (код 0x%1) Network operation timed out - + Время на сетевую операцию истекло @@ -5395,12 +5318,12 @@ Please choose a different file name. More - + Больше Less - + Меньше @@ -5413,7 +5336,7 @@ Please choose a different file name. Delete this record? - Удалить эту запись? + Удалить данную запись? @@ -5452,7 +5375,7 @@ Please choose a different file name. Confirm - Подтвердить + Подтверждение @@ -5463,59 +5386,59 @@ Please choose a different file name. QSslSocket - + Unable to write data: %1 - + Невозможно записать данные: %1 Error while reading: %1 - + Ошибка чтения: %1 Error during SSL handshake: %1 - + Ошибка квитирования SSL: %1 - + Error creating SSL context (%1) - + Ошибка создания контекста SSL: (%1) Invalid or empty cipher list (%1) - + Неправильный или пустой список шифров (%1) Error creating SSL session, %1 - + Ошибка создания сессии SSL, %1 Error creating SSL session: %1 - + Ошибка создания сессии SSL: %1 Cannot provide a certificate with no key, %1 - + Невозможно предоставить сертификат без ключа, %1 Error loading local certificate, %1 - + Ошибка загрузки локального сертификата, %1 Error loading private key, %1 - + Ошибка загрузки закрытого ключа, %1 Private key does not certificate public key, %1 - + Закрытый ключ не соответствует открытому ключу, %1 @@ -5524,42 +5447,42 @@ Please choose a different file name. %1: out of resources - + %1: недостаточно ресурсов %1: permission denied - + %1: доступ запрещён %1: already exists - + %1: уже существует %1: does not exist - + %1: не существует %1: unknown error %2 - + %1: неизвестная ошибка %2 QTDSDriver - + Unable to open connection - + Невозможно открыть соединение Unable to use database - + Невозможно использовать базу данных @@ -5567,12 +5490,12 @@ Please choose a different file name. Scroll Left - + Прокрутить влево Scroll Right - + Прокрутить вправо @@ -5580,7 +5503,7 @@ Please choose a different file name. Operation on socket is not supported - + Операция с сокетом не поддерживается @@ -5588,42 +5511,42 @@ Please choose a different file name. &Undo - &Отменить + &Отменить действие &Redo - &Повторить + &Повторить действие Cu&t - &Вырезать + &Вырезать &Copy - &Копировать + &Копировать Copy &Link Location - + Скопировать &адрес ссылки &Paste - &Вставить + В&ставить Delete - Удалить + Удалить Select All - Выделить все + Выделить всё @@ -5632,13 +5555,13 @@ Please choose a different file name. Press - + Нажать Open - Открыть + Открыть @@ -5646,7 +5569,7 @@ Please choose a different file name. This platform does not support IPv6 - + Данная платформа не поддерживает IPv6 @@ -5654,12 +5577,12 @@ Please choose a different file name. Undo - Отменить + Отменить действие Redo - Повторить + Повторить действие @@ -5667,7 +5590,7 @@ Please choose a different file name. <empty> - + <пусто> @@ -5675,12 +5598,12 @@ Please choose a different file name. Undo - Отменить + Отменить действие Redo - Повторить + Повторить действие @@ -5688,12 +5611,12 @@ Please choose a different file name. LRM Left-to-right mark - + LRM Признак письма слева направо RLM Right-to-left mark - + RLM Признак письма справа налево @@ -5738,7 +5661,7 @@ Please choose a different file name. Insert Unicode control character - + Вставить управляющий символ Unicode @@ -5746,160 +5669,160 @@ Please choose a different file name. Request cancelled - + Запрос отменён Request blocked - + Запрос блокирован Cannot show URL - + Невозможно отобразить URL Frame load interruped by policy change - + Загрузка фрейма прервана изменением политики Cannot show mimetype - + Невозможно отобразить тип MIME File does not exist - + Файл не существует QWebPage - + Bad HTTP request - + Некорректный HTTP-запрос Submit default label for Submit buttons in forms on web pages - + Отправить Submit Submit (input element) alt text for <input> elements with no alt, title, or value - + Отправить Reset default label for Reset buttons in forms on web pages - + Сбросить This is a searchable index. Enter search keywords: text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' - + Индекс поиска. Введите ключевые слова для поиска: Choose File title for file button used in HTML forms - + Обзор... No file selected text to display in file button used in HTML forms when no file is selected - + Файл не указан Open in New Window Open in New Window context menu item - + Открыть в новом окне Save Link... Download Linked File context menu item - + Сохранить по ссылке как... Copy Link Copy Link context menu item - + Копировать адрес ссылки Open Image Open Image in New Window context menu item - + Открыть изображение Save Image Download Image context menu item - + Сохранить изображение Copy Image Copy Link context menu item - + Копировать изображение в буффер обмена Open Frame Open Frame in New Window context menu item - + Открыть фрейм Copy Copy context menu item - + Копировать Go Back Back context menu item - + Назад Go Forward Forward context menu item - + Вперёд Stop Stop context menu item - Стоп + Остановить Reload Reload context menu item - + Обновить Cut Cut context menu item - + Вырезать Paste Paste context menu item - + Вставить @@ -5911,43 +5834,43 @@ Please choose a different file name. Ignore Ignore Spelling context menu item - + Пропустить Add To Dictionary Learn Spelling context menu item - + Добавить в словарь Search The Web Search The Web context menu item - + Найти в Интернет Look Up In Dictionary Look Up in Dictionary context menu item - + Поиск в словаре Open Link Open Link context menu item - + Открыть ссылку Ignore Ignore Grammar context menu item - + Пропустить Spelling Spelling and Grammar context sub-menu item - + Орфография @@ -5965,13 +5888,13 @@ Please choose a different file name. Check Spelling Check spelling context menu item - + Проверка орфографии Check Spelling While Typing Check spelling while typing context menu item - + Проверять орфографию при наборе @@ -5983,97 +5906,97 @@ Please choose a different file name. Fonts Font context sub-menu item - + Шрифты Bold Bold context menu item - + Жирный Italic Italic context menu item - + Курсив Underline Underline context menu item - + Подчёркнутый Outline Outline context menu item - + Перечёркнутый Direction Writing direction context sub-menu item - + Направление Text Direction Text direction context sub-menu item - + Направление текста Default Default writing direction context menu item - + По умолчанию LTR Left to Right context menu item - + Слева направо RTL Right to Left context menu item - + Справа налево Inspect Inspect Element context menu item - + Проверить No recent searches Label for only item in menu that appears when clicking on the search field image, when no searches have been performed - + История поиска пуста Recent searches label for first item in the menu that appears when clicking on the search field image, used as embedded menu title - + История поиска Clear recent searches menu item in Recent Searches menu that empties menu's contents - + Очистить историю поиска Unknown Unknown filesize FTP directory listing item - + Неизвестно %1 (%2x%3 pixels) Title string for images - + %1 (%2x%3 px) @@ -6083,74 +6006,76 @@ Please choose a different file name. Scroll here - + Прокрутить сюда Left edge - + К левой границе Top - + Вверх Right edge - + К правой границе Bottom - + Вниз Page left - + На страницу влево Page up - + На страницу вверх Page right - + На страницу вправо Page down - + На страницу вниз Scroll left - + Прокрутить влево Scroll up - + Прокрутить вверх Scroll right - + Прокрутить вправо Scroll down - + Прокрутить вниз %n file(s) number of chosen file - - + + %n файл(а) + %n файла + %n файлов @@ -6169,149 +6094,149 @@ Please choose a different file name. - + Move the cursor to the next character - + Переместить указатель к следующему символу Move the cursor to the previous character - + Переместить указатель к предыдущему символу Move the cursor to the next word - + Переместить указатель к следующему слову Move the cursor to the previous word - + Переместить указатель к предыдущему слову Move the cursor to the next line - + Переместить указатель на следующую строку Move the cursor to the previous line - + Переместить указатель на предыдущую строку Move the cursor to the start of the line - + Переместить указатель в начало строки Move the cursor to the end of the line - + Переместить указатель в конец строки Move the cursor to the start of the block - + Переместить указатель в начало блока Move the cursor to the end of the block - + Переместить указатель в конец блока Move the cursor to the start of the document - + Переместить указатель в начало документа Move the cursor to the end of the document - + Переместить указатель в конец документа Select all - + Выделить всё Select to the next character - + Выделить до следующего символа Select to the previous character - + Выделить до предыдущего символа Select to the next word - + Выделить до следующего слова Select to the previous word - + Выделить до предыдущего слова Select to the next line - + Выделить до следующей строки Select to the previous line - + Выделить до предыдущей строки Select to the start of the line - + Выделить до начала строки Select to the end of the line - + Выделить до конца строки Select to the start of the block - + Выделить до начала блока Select to the end of the block - + Выделить до конца блока Select to the start of the document - + Выделить до начала документа Select to the end of the document - + Выделить до конца документа Delete to the start of the word - + Удалить до начала слова Delete to the end of the word - + Удалить до конца слова Insert a new paragraph - + Вставить новый параграф Insert a new line - + Вставить новую строку @@ -6319,77 +6244,73 @@ Please choose a different file name. What's This? - Что это? + Что это? QWidget - + * - + * QWizard - < &Back - < &Назад - - - - &Finish - &Финиш - - - - &Help - &Справка - - - Go Back - + Назад Continue - + Продолжить Commit - + Передать Done - - - - Quit - Выход + Готово Help - Справка + Справка + + + + < &Back + < &Назад + + + + &Finish + &Завершить + + + + Cancel + Отмена - - Cancel - Отмена + + &Help + &Справка - + &Next - + &Далее &Next > - &Вперед > + &Далее > @@ -6397,43 +6318,43 @@ Please choose a different file name. &Restore - &Восстановить + &Восстановить &Move - &Переместить + &Переместить &Size - &Размер + &Размер Mi&nimize - &Свернуть + &Свернуть Ma&ximize - Р&азвернуть + Р&аспахнуть &Close - &Закрыть + &Закрыть Stay on &Top - Всегда &наверху + Оставаться &сверху Sh&ade - Свернуть в за&головок + Св&ернуть в заголовок @@ -6444,22 +6365,22 @@ Please choose a different file name. Minimize - Свернуть + Свернуть Restore Down - Восстановить + Восстановить Close - Закрыть + Закрыть &Unshade - Восстановить из за&головка + В&осстановить из заголовка @@ -6472,7 +6393,7 @@ Please choose a different file name. error triggered by consumer - ошибка инициирована пользователем + ошибка вызвана пользователем @@ -6482,22 +6403,22 @@ Please choose a different file name. more than one document type definition - определен более, чем один тип документов + указано более одного типа документа error occurred while parsing element - в процессе грамматического разбора элемента произошла ошибка + ошибка разбора элемента tag mismatch - отсутствует тег + тэг не совпадает error occurred while parsing content - в процессе грамматического разбора произошла ошибка + ошибка разбора документа @@ -6507,12 +6428,12 @@ Please choose a different file name. invalid name for processing instruction - некорректное имя директивы + некорректное имя директивы разбора version expected while reading the XML declaration - при чтении XML-тега ожидался параметр version + в объявлении XML ожидается параметр version @@ -6522,52 +6443,52 @@ Please choose a different file name. encoding declaration or standalone declaration expected while reading the XML declaration - при чтении XML-тега ожидался параметр encoding или параметр standalone + в объявлении XML ожидаются параметры encoding или standalone standalone declaration expected while reading the XML declaration - при чтении XML-тега ожидался параметр standalone + в объявлении XML ожидается параметр standalone error occurred while parsing document type definition - в процессе грамматического разбора типа документа произошла ошибка + ошибка разбора объявления типа документа letter is expected - ожидался символ + ожидалась буква error occurred while parsing comment - в процессе грамматического разбора комментария произошла ошибка + ошибка разбора комментария error occurred while parsing reference - в процессе грамматического разбора ссылки произошла ошибка + ошибка разбора ссылки internal general entity reference not allowed in DTD - internal general entity reference not allowed in DTD + внутренняя ссылка на общий объект недопустима в DTD external parsed general entity reference not allowed in attribute value - external parsed general entity reference not allowed in attribute value + внешняя ссылка на общий объект недопустима в значении атрибута external parsed general entity reference not allowed in DTD - external parsed general entity reference not allowed in DTD + внешняя ссылка на общий объект недопустима в DTD unparsed entity reference in wrong context - unparsed entity reference in wrong context + неразобранная ссылка на объект в неверном контексте @@ -6577,7 +6498,7 @@ Please choose a different file name. error in the text declaration of an external entity - error in the text declaration of an external entity + ошибка в объявлении внешнего объекта @@ -6586,127 +6507,128 @@ Please choose a different file name. Extra content at end of document. - + Лишние данные в конце документа. Invalid entity value. - + Некорректное значение объекта. Invalid XML character. - + Некорректный символ XML. Sequence ']]>' not allowed in content. - + Последовательность ']]>' недопустима в содержимом. Namespace prefix '%1' not declared - + Префикс пространства имён '%1' не объявлен Attribute redefined. - + Атрибут переопределен. Unexpected character '%1' in public id literal. - + Неожиданный символ '%1' в литерале открытого идентификатора. Invalid XML version string. - + Неверная строка версии XML. Unsupported XML version. - + Неподдерживаемая версия XML. %1 is an invalid encoding name. - + %1 - неверное название кодировки. Encoding %1 is unsupported - + Кодировка %1 не поддерживается Standalone accepts only yes or no. - + Псевдоатрибут 'standalone' может принимать только значения 'yes' или 'no'. Invalid attribute in XML declaration. - + Некорректный атрибут в объявлении XML. Premature end of document. - + Неожиданный конец документа. Invalid document. - + Некорректный документ. Expected - + Ожидалось , but got ' - + , получили ' Unexpected ' - + Неожиданное ' Expected character data. - + Ожидаются символьные данные. Recursive entity detected. - + Обнаружен рекурсивный объект. Start tag expected. - + Ожидается открывающий тэг. XML declaration not at start of document. - + Объявление XML находится не в начале документа. NDATA in parameter entity declaration. - + Не уверен в правильности перевода + NDATA в объявлении объекта-параметра. %1 is an invalid processing instruction name. - + %1 неверное название обрабатываемой инструкции. Invalid processing instruction name. - + Неверное название обрабатываемой инструкции. @@ -6714,55 +6636,55 @@ Please choose a different file name. Illegal namespace declaration. - + Неверное объявление пространства имён. Invalid XML name. - + Некорректное имя XML. Opening and ending tag mismatch. - + Открывающий тэг не совпадает с закрывающим. Reference to unparsed entity '%1'. - + Ссылка на необработанный объект '%1'. Entity '%1' not declared. - + Объект '%1' не объявлен. Reference to external entity '%1' in attribute value. - + Ссылка на внешний объект '%1' в значении атрибута. Invalid character reference. - + Неверная символьная ссылка. Encountered incorrectly encoded content. - + Обнаружено неверно закодированное содержимое. The standalone pseudo attribute must appear after the encoding. - + Псевдоатрибут 'standalone' должен находиться после указания кодировки. %1 is an invalid PUBLIC identifier. - + %1 - неверный идентификатор PUBLIC. @@ -6770,1038 +6692,1042 @@ Please choose a different file name. An %1-attribute with value %2 has already been declared. - + Атрибут '%1' со значением '%2' уже определен. An %1-attribute must have a valid %2 as value, which %3 isn't. - + Атрибут '%1' должен иметь значение типа '%2', но '%3' им не является. Network timeout. - + Время ожидания сети истекло. Element %1 can't be serialized because it appears outside the document element. - - - - - Attribute %1 can't be serialized because it appears at the top level. - + Элемент %1 не может быть сериализован, так как присутствует вне документа. Year %1 is invalid because it begins with %2. - + Год %1 неверен, так как начинается с %2. Day %1 is outside the range %2..%3. - + День %1 вне диапазона %2..%3. Month %1 is outside the range %2..%3. - + Месяц %1 вне диапазона %2..%3. Overflow: Can't represent date %1. - + Переполнение: Не удается представить дату %1. Day %1 is invalid for month %2. - + День %1 неверен для месяца %2. Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; - + Время 24:%1:%2.%3 неверно. 24 часа, но минуты, секунды и/или миллисекунды отличны от 0; Time %1:%2:%3.%4 is invalid. - + Время %1:%2:%3.%4 неверно. Overflow: Date can't be represented. - + Переполнение: невозможно представить дату. At least one component must be present. - + Должна присутствовать как минимум одна компонента. At least one time component must appear after the %1-delimiter. - + Как минимум одна компонента времени должна следовать за разделителем '%1'. No operand in an integer division, %1, can be %2. - + Нет параметра в целочисленном делении %1, может быть %2. The first operand in an integer division, %1, cannot be infinity (%2). - + Первый параметр целочисленного деления (%1) не может быть бесконечностью (%2). The second operand in a division, %1, cannot be zero (%2). - + Второй параметр целочисленного деления (%1) не может быть нулем (%2). %1 is not a valid value of type %2. - + %1 не является правильным значением типа %2. When casting to %1 from %2, the source value cannot be %3. - + При преобразовании %2 в %1 исходное значение не может быть %3. Integer division (%1) by zero (%2) is undefined. - + Целочисленное деление (%1) на нуль (%2) не определено. Division (%1) by zero (%2) is undefined. - + Деление (%1) на нуль (%2) не определено. Modulus division (%1) by zero (%2) is undefined. - + Деление по модулю (%1) на нуль (%2) не определено. Dividing a value of type %1 by %2 (not-a-number) is not allowed. - + Деление числа типа %1 на %2 (not-a-number) недопустимо. Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. - + Деление числа типа %1 на %2 или %3 (плюс-минус нуль) недопустимо. Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. - + Умножение числа типа %1 на %2 или %3 (плюс-минус бесконечность) недопустимо. A value of type %1 cannot have an Effective Boolean Value. - + Значение типа %1 не может быть булевым значением. Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. - + Булево значение не может быть вычислено для последовательностей, которые содержат два и более атомарных значения. Value %1 of type %2 exceeds maximum (%3). - + Значение %1 типа %2 больше максимума (%3). Value %1 of type %2 is below minimum (%3). - + Значение %1 типа %2 меньше минимума (%3). A value of type %1 must contain an even number of digits. The value %2 does not. - + Значение типа %1 должно содержать четное количество цифр. Значение %2 этому требованию не удовлетворяет. %1 is not valid as a value of type %2. - + Значение %1 некорректно для типа %2. Operator %1 cannot be used on type %2. - + Оператор %1 не может использоваться для типа %2. Operator %1 cannot be used on atomic values of type %2 and %3. - + Оператор %1 не может использоваться для атомарных значений типов %2 и %3. The namespace URI in the name for a computed attribute cannot be %1. - + URI пространства имён в названии рассчитываемого атрибута не может быть %1. The name for a computed attribute cannot have the namespace URI %1 with the local name %2. - + Название расчитываемого атрибута не может иметь URI пространства имён %1 с локальным именем %2. Type error in cast, expected %1, received %2. - + Ошибка типов в преобразовании, ожидалось %1, получено %2. When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. - + При преобразовании в %1 или производные от него типы исходное значение должно быть того же типа или строковым литералом. Тип %2 недопустим. No casting is possible with %1 as the target type. - + Преобразование к типу %1 невозможно. It is not possible to cast from %1 to %2. - + Невозможно преобразовать %1 в %2. Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated. - + Преобразование к %1 невозможно, так как это абстрактный тип и, следовательно, для него невозможно создать объект. It's not possible to cast the value %1 of type %2 to %3 - + Невозможно преобразовать значение %1 типа %2 в %3 Failure when casting from %1 to %2: %3 - + Не удалось преобразовать %1 в %2: %3 A comment cannot contain %1 - + Комментарий не может содержать %1 A comment cannot end with a %1. - + Комментарий не может оканчиваться на %1. No comparisons can be done involving the type %1. - + Невозможно выполнить сравнение с типом %1. Operator %1 is not available between atomic values of type %2 and %3. - + Оператор %1 недоступен между атомарными значениями типа %2 и %3. An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. - + Узел-атрибут не может быть потомком узла-документа. Атрибут %1 неуместен. A library module cannot be evaluated directly. It must be imported from a main module. - + Модуль библиотеки не может использоваться напрямую. Он должен быть импортирован из основного модуля. No template by name %1 exists. - + Шаблон с именем %1 отсутствует. A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. - + Значение типа %1 не может быть условием. Условием могут являться числовой и булевый типы. A positional predicate must evaluate to a single numeric value. - + Позиционный предикат должен вычисляться как числовое выражение. The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. - + Целевое имя в обрабатываемой инструкции не может быть %1 в любой комбинации нижнего и верхнего регистров. Имя %2 некорректно. %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. - + %1 некорректное целевое имя в обрабатываемой инструкции. Имя должно быть значением типа %2, например: %3. The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. - + Последняя часть пути должна содержать узлы или атомарные значения, но не может содержать и то, и другое одновременно. The data of a processing instruction cannot contain the string %1 - + Данные обрабатываемой инструкции не могут содержать строку '%1' No namespace binding exists for the prefix %1 - + Отсутствует привязка к пространству имён для префикса %1 No namespace binding exists for the prefix %1 in %2 - + Отсутствует привязка к пространству имён для префикса %1 в %2 %1 is an invalid %2 - + %1 некоррекно для %2 %1 takes at most %n argument(s). %2 is therefore invalid. - - + + %1 принимает не более %n аргумента. Следовательно, %2 неверно. + %1 принимает не более %n аргументов. Следовательно, %2 неверно. + %1 принимает не более %n аргументов. Следовательно, %2 неверно. %1 requires at least %n argument(s). %2 is therefore invalid. - - + + %1 принимает не менее %n аргумента. Следовательно, %2 неверно. + %1 принимает не менее %n аргументов. Следовательно, %2 неверно. + %1 принимает не менее %n аргументов. Следовательно, %2 неверно. The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. - + Первый аргумент %1 не может быть типа %2. Он должен быть числового типа, типа xs:yearMonthDuration или типа xs:dayTimeDuration. The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - + Первый аргумент %1 не может быть типа %2. Он должен быть типа %3, %4 или %5. The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - + Второй аргумент %1 не может быть типа %2. Он должен быть типа %3, %4 или %5. %1 is not a valid XML 1.0 character. - + Символ %1 недопустим для XML 1.0. The first argument to %1 cannot be of type %2. - + Первый аргумент %1 не может быть типа %2. If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. - + Если оба значения имеют региональные смещения, смещения должны быть одинаковы. %1 и %2 не одинаковы. %1 was called. - + %1 было вызвано. %1 must be followed by %2 or %3, not at the end of the replacement string. - + '%1' должно сопровождаться '%2' или '%3', но не в конце замещаемой строки. In the replacement string, %1 must be followed by at least one digit when not escaped. - + В замещаемой строке '%1' должно сопровождаться как минимум одной цифрой, если неэкранировано. In the replacement string, %1 can only be used to escape itself or %2, not %3 - + В замещаемой строке символ '%1' может использоваться только для экранирования самого себя или '%2', но не '%3' %1 matches newline characters - + %1 соответствует символам конца строки %1 and %2 match the start and end of a line. - + %1 и %2 соответствуют началу и концу строки. Matches are case insensitive - + Соответствия регистронезависимы Whitespace characters are removed, except when they appear in character classes - + Символы пробелов удалены, за исключением тех, что были в классах символов %1 is an invalid regular expression pattern: %2 - + %1 - неверный шаблон регулярного выражения: %2 %1 is an invalid flag for regular expressions. Valid flags are: - + %1 - неверный флаг для регулярного выражения. Допустимые флаги: If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. - + Префикс не должен быть указан, если первый параметр - пустая последовательность или пустая строка (вне пространства имён). Был указан префикс %1. - + It will not be possible to retrieve %1. - + Будет невозможно восстановить %1. The root node of the second argument to function %1 must be a document node. %2 is not a document node. - + Корневой узел второго аргумента функции %1 должен быть документом. %2 не является документом. The default collection is undefined - + Набор по умолчанию не определен %1 cannot be retrieved - + %1 не может быть восстановлен The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). - + Форма нормализации %1 не поддерживается. Поддерживаются только %2, %3, %4, %5 и пустая, т.е. пустая строка (без нормализации). A zone offset must be in the range %1..%2 inclusive. %3 is out of range. - + Региональное смещение должно быть в переделах от %1 до %2 включительно. %3 выходит за допустимые пределы. %1 is not a whole number of minutes. - + %1 не является полным количеством минут. Required cardinality is %1; got cardinality %2. - + Необходимое число элементов - %1, получено %2. The item %1 did not match the required type %2. - + Элемент %1 не соответствует необходимому типу %2. %1 is an unknown schema type. - + %1 является схемой неизвестного типа. Only one %1 declaration can occur in the query prolog. - + Только одно объявление %1 может присутствовать в прологе запроса. The initialization of variable %1 depends on itself - + Инициализация переменной %1 зависит от себя самой No variable by name %1 exists - + Переменная с именем %1 отсутствует The variable %1 is unused - + Переменная %1 не используется Version %1 is not supported. The supported XQuery version is 1.0. - + Версия %1 не поддерживается. Поддерживается XQuery версии 1.0. The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. - + Кодировка %1 неверна. Имя кодировки должно содержать только символы латиницы без пробелов и должно удовлетворять регулярному выражению %2. No function with signature %1 is available - + Функция с сигнатурой %1 отсутствует A default namespace declaration must occur before function, variable, and option declarations. - + Объявление пространство имён по умолчанию должно быть до объявления функций, переменных и опций. Namespace declarations must occur before function, variable, and option declarations. - + Объявление пространства имён должно быть до объявления функций, переменных и опций. Module imports must occur before function, variable, and option declarations. - + Импорт модулей должен быть до объявлений функций, переменных и опций. It is not possible to redeclare prefix %1. - + Невозможно переопределить префикс %1. Prefix %1 is already declared in the prolog. - + Префикс %1 уже объявлен в прологе. The name of an option must have a prefix. There is no default namespace for options. - + Название опции должно содержать префикс. Нет пространства имён по умолчанию для опций. The Schema Import feature is not supported, and therefore %1 declarations cannot occur. - + Возможность импорта схем не поддерживается. Следовательно, объявлений %1 быть не должно. The target namespace of a %1 cannot be empty. - + Целевое пространство имён %1 не может быть пустым. The module import feature is not supported - + Возможность импорта модулей не поддерживается No value is available for the external variable by name %1. - + Отсутствует значение для внешней переменной с именем %1. A construct was encountered which only is allowed in XQuery. - + Указана конструкция, допустимая только в XQuery. A template by name %1 has already been declared. - + Шаблон с именем %1 уже был объявлен. The keyword %1 cannot occur with any other mode name. - + Ключевое слово %1 не может встречаться с любым другим названием режима. The value of attribute %1 must of type %2, which %3 isn't. - + Значение атрибута %1 должно быть типа %2, но %3 ему не соответствует. The prefix %1 can not be bound. By default, it is already bound to the namespace %2. - + Не удается связать префикс %1. По умолчанию префикс связан с пространством имён %2. A variable by name %1 has already been declared. - + Переменная с именем %1 уже объявлена. A stylesheet function must have a prefixed name. - + Функция стилей должна иметь имя с префиксом. The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) - + Пространство имён для пользовательских функций не может быть пустым (попробуйте предопределенный префикс %1, который существует для подобных ситуаций) The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. - + Пространтсво имён %1 зарезервировано, поэтому пользовательские функции не могут его использовать. Попробуйте предопределенный префикс %2, который существует для подобных ситуаций. The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 - + Пространство имён пользовательской функции в модуле библиотеки должен соответствовать пространству имён модуля. Другими словами, он должен быть %1 вместо %2 A function already exists with the signature %1. - + Функция с сигнатурой %1 уже существует. No external functions are supported. All supported functions can be used directly, without first declaring them as external - + Внешние функции не поддерживаются. Все поддерживаемые функции могут использоваться напрямую без первоначального объявления их внешними An argument by name %1 has already been declared. Every argument name must be unique. - + Аргумент с именем %1 уже объявлен. Имя каждого аргумента должно быть уникальным. When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. - + Если функция %1 используется для сравнения внутри шаблона, аргумент должен быть ссылкой на переменную или строковым литералом. In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. - + В шаблоне XSL-T первый аргумент функции %1 должен быть строковым литералом, если функция используется для сравнения. In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. - + В шаблоне XSL-T первый аргумент функции %1 должен быть литералом или ссылкой на переменную, если функция используется для сравнения. In an XSL-T pattern, function %1 cannot have a third argument. - + В шаблоне XSL-T у функции %1 не должно быть третьего аргумента. In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. - + В шаблоне XSL-T только функции %1 и %2 могут использоваться для сравнения, но не %3. In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. - + В шаблоне XSL-T не может быть использована ось %1 - только оси %2 или %3. %1 is an invalid template mode name. - + %1 является неверным шаблоном имени режима. The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. - + Имя переменной, связанной с выражением for, должно отличаться от позиционной переменной. Две переменные с именем %1 конфликтуют. The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. - + Возможность проверки по схеме не поддерживается. Выражения %1 не могут использоваться. None of the pragma expressions are supported. Therefore, a fallback expression must be present - + Ни одно из выражений pragma не поддерживается. Должно существовать запасное выражение Each name of a template parameter must be unique; %1 is duplicated. - + Имя каждого параметра шаблона должно быть уникальным, но %1 повторяется. The %1-axis is unsupported in XQuery - + Ось %1 не поддерживается в XQuery %1 is not a valid name for a processing-instruction. - + %1 является неверным названием для инструкции обработки. %1 is not a valid numeric literal. - + %1 является неверным числовым литералом. No function by name %1 is available. - + Функция с именем %1 отсутствует. The namespace URI cannot be the empty string when binding to a prefix, %1. - + URI пространства имён не может быть пустой строкой при связывании с префиксом %1. %1 is an invalid namespace URI. - + %1 - неверный URI пространства имён. It is not possible to bind to the prefix %1 - + Невозможно связать с префиксом %1 Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). - + Пространство имён %1 может быть связано только с %2 (в данном случае уже предопределено). Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). - + Префикс %1 может быть связан только с %2 (в данном случае уже предопределено). Two namespace declaration attributes have the same name: %1. - + Два атрибута объявления пространств имён имеют одинаковое имя: %1. The namespace URI must be a constant and cannot use enclosed expressions. - + URI пространства имён должно быть константой и не может содержать выражений. An attribute by name %1 has already appeared on this element. - + Атрибут с именем %1 уже есть в этом элементе. A direct element constructor is not well-formed. %1 is ended with %2. - + Прямой конструктор элемента составлен некорректно. %1 заканчивается %2. The name %1 does not refer to any schema type. - + Название %1 не соответствует ни одному типу схемы. %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. - + %1 - сложный тип. Преобразование к сложным типам невозможно. Однако, преобразование к атомарным типам как %2 работает. %1 is not an atomic type. Casting is only possible to atomic types. - + %1 - не атомарный тип. Преобразование возможно только к атомарным типам. %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. - + %1 является объявлением атрибута вне положенного места. Имейте в виду, возможность импорта схем не поддерживается. The name of an extension expression must be in a namespace. - + Название выражения расширения должно быть в пространстве имён. empty - + пусто zero or one - + нуль или один exactly one - + ровно один one or more - + один или более zero or more - + нуль или более Required type is %1, but %2 was found. - + Требуется тип %1, но обнаружен %2. Promoting %1 to %2 may cause loss of precision. - + Преобразование %1 к %2 может снизить точность. The focus is undefined. - + Фокус не определен. It's not possible to add attributes after any other kind of node. - + Невозможно добавлять атрибуты после любого другого вида узла. An attribute by name %1 has already been created. - + Атрибут с именем %1 уже существует. Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. - + Только Unicode Codepoint Collation поддерживается (%1). %2 не поддерживается. + + + + Attribute %1 can't be serialized because it appears at the top level. + Атрибут %1 не может быть сериализован, так как присутствует на верхнем уровне. %1 is an unsupported encoding. - + Кодировка %1 не поддерживается. %1 contains octets which are disallowed in the requested encoding %2. - + %1 содержит октеты, которые недопустимы в требуемой кодировке %2. The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. - + Символ с кодом %1, присутствующий в %2 при использовании кодировки %3, не является допустимым символом XML. Ambiguous rule match. - + Неоднозначное соответствие правилу. In a namespace constructor, the value for a namespace cannot be an empty string. - + В конструкторе пространства имён значение пространства имён не может быть пустой строкой. The prefix must be a valid %1, which %2 is not. - + Префикс должен быть корректным %1, но %2 им не является. The prefix %1 cannot be bound. - + Префикс%1 не может быть связан. Only the prefix %1 can be bound to %2 and vice versa. - + Только префикс %1 может быть связан с %2 и наоборот. Circularity detected - + Обнаружена зацикленность The parameter %1 is required, but no corresponding %2 is supplied. - + Необходим параметр %1 , но соответствующего %2 не передано. The parameter %1 is passed, but no corresponding %2 exists. - + Передан параметр %1 , но соответствующего %2 не существует. The URI cannot have a fragment - + URI не может содержать фрагмент Element %1 is not allowed at this location. - + Элемент %1 недопустим в этом месте. Text nodes are not allowed at this location. - + Текстовые узлы недопустимы в этом месте. Parse error: %1 - + Ошибка разбора: %1 The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. - + Значение атрибута версии XSL-T должно быть типа %1, но %2 им не является. Running an XSL-T 1.0 stylesheet with a 2.0 processor. - + Выполняется таблица стилей XSL-T 1.0 с обработчиком версии 2.0. Unknown XSL-T attribute %1. - + Неизвествный атрибут XSL-T %1. Attribute %1 and %2 are mutually exclusive. - + Атрибуты %1 и %2 взаимоисключающие. In a simplified stylesheet module, attribute %1 must be present. - + В модуле упрощённой таблицы стилей атрибут %1 обязан присутствовать. If element %1 has no attribute %2, it cannot have attribute %3 or %4. - + Если элемент %1 не имеет атрибут %2, у него не может быть атрибутов %3 и %4. Element %1 must have at least one of the attributes %2 or %3. - + Элемент %1 должен иметь как минимум один из атрибутов %2 или %3. At least one mode must be specified in the %1-attribute on element %2. - + Как минимум один режим должен быть указан в атрибуте %1 элемента %2. Attribute %1 cannot appear on the element %2. Only the standard attributes can appear. - + Атрибут %1 недопустим в элементе %2. Допустимы только стандартные атрибуты. Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes. - + Атрибут %1 недопустим в элементе %2. Допустимы только %3 и стандартные атрибуты. Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes. - + Атрибут %1 недопустим в элементе %2. Допустимы только %3, %4 и стандартные атрибуты. Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes. - + Атрибут %1 недопустим в элементе %2. Допустимы только %3 и стандартные атрибуты. XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is. - + Атрибуты XSL-T элементов XSL-T должны быть вне пространства имён, а не в простанстве имеё XSL-T, которым является %1. The attribute %1 must appear on element %2. - + Элемента %2 должен иметь атрибут %1. The element with local name %1 does not exist in XSL-T. - + Элемент с локальным именем %1 отсутствует в XSL-T. Element %1 must come last. - + Элемент %1 должен идти последним. At least one %1-element must occur before %2. - + Как минимум один элемент %1 должен быть перед %2. Only one %1-element can appear. - + Должен быть только один элемент %1. At least one %1-element must occur inside %2. - + Как минимум один элемент %1 должен быть внутри %2. When attribute %1 is present on %2, a sequence constructor cannot be used. - + Если %2 содержит атрибут %1, конструктор последовательности не может быть использован. Element %1 must have either a %2-attribute or a sequence constructor. - + Элемент %1 должен иметь атрибут %2 или конструктор последовательности. When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. - + Если параметр необходим, значение по умолчание не может быть передано через атрибут %1 или конструктор последовательности. Element %1 cannot have children. - + У элемента %1 не может быть потомков. Element %1 cannot have a sequence constructor. - + У элемента %1 не может быть конструктора последовательности. The attribute %1 cannot appear on %2, when it is a child of %3. - + У %2 не может быть атрибута %1, когда он является потомком %3. A parameter in a function cannot be declared to be a tunnel. - + Параметр в функции не может быть объявлен туннелем. This processor is not Schema-aware and therefore %1 cannot be used. - + Данный обработчик не работает со схемами, следовательно, %1 не может использоваться. Top level stylesheet elements must be in a non-null namespace, which %1 isn't. - + Элементы верхнего уровня таблицы стилей должны быть в пространстве имен, которым %1 не является. The value for attribute %1 on element %2 must either be %3 or %4, not %5. - + Значение атрибута %1 элемента %2 должно быть или %3, или %4, но не %5. Attribute %1 cannot have the value %2. - + Атрибут %1 не может принимать значение %2. The attribute %1 can only appear on the first %2 element. - + Атрибут %1 может быть только у первого элемента %2. At least one %1 element must appear as child of %2. - + Как минимум один элемент %1 должен быть в %2. @@ -7809,13 +7735,13 @@ Please choose a different file name. Muted - + Без звука Volume: %1% - + Громкость: %1% -- cgit v0.12 From d12ec7f58ac16dea055d02b0b64db7cfe2e16aa8 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 17 Jun 2009 14:52:02 +0200 Subject: Update Russian phrase book. Several uncorrect phrases was re-translated. Added new common used phrases. Merge-request: 689 Reviewed-by: Oswald Buddenhagen --- tools/linguist/phrasebooks/russian.qph | 127 +++++++++++++++++++++++++++------ 1 file changed, 104 insertions(+), 23 deletions(-) diff --git a/tools/linguist/phrasebooks/russian.qph b/tools/linguist/phrasebooks/russian.qph index 0b06cea..629c60b 100644 --- a/tools/linguist/phrasebooks/russian.qph +++ b/tools/linguist/phrasebooks/russian.qph @@ -1,4 +1,5 @@ - + + About О программе @@ -68,10 +69,6 @@ авто-прокрутка - Back - Назад - - boxed edit окно редактирования @@ -117,11 +114,11 @@ Close button - кнопка закрытия + Кнопка закрытия collapse - крах + свернуть column heading @@ -257,7 +254,7 @@ expand - расширять + развернуть Explore @@ -285,15 +282,15 @@ Find Next - Продолжить поиск + Найти далее Find What - Поиск + Искать folder - каталог + папка font @@ -385,7 +382,7 @@ landscape - альбом + альбомная link @@ -513,7 +510,7 @@ OK - OK + Готово OLE @@ -525,7 +522,7 @@ OLE embedded object - внедренный OLE-объект + внедрённый OLE-объект OLE linked object @@ -533,7 +530,7 @@ OLE nondefault drag and drop - предопределенный OLE-механизм + предопределённый OLE-механизм Open @@ -557,7 +554,7 @@ Page Setup - шаг установки + Параметры страницы palette window @@ -625,11 +622,11 @@ portrait - портрет + книжная press - нажимать + нажать primary container @@ -757,7 +754,7 @@ secondary window - подчиненное окно + подчинённое окно select @@ -765,7 +762,7 @@ Select All - Выделить все + Выделить всё selection @@ -861,11 +858,11 @@ status bar - статусная строка + строка состояния Stop - Стоп + Остановить tab control @@ -897,7 +894,7 @@ toggle key - кнопка-выключатель + кнопка-переключатель toolbar @@ -979,4 +976,88 @@ Yes Да + + No + Нет + + + Options + Параметры + + + directory + каталог + + + Finish + Завершить + + + Continue + Продолжить + + + advanced + расширенный + + + layout + компоновка + + + layout + компоновщик + + + plugin + модуль + + + script + сценарий + + + spacer + разделитель + + + tabbar + панель вкладок + + + whitespace + символ пробела + + + Forward + Вперёд + + + Back + Назад + + + Search wrapped + Поиск с начала + + + OK + Выбрать + + + OK + Закрыть + + + Match case + С учётом регистра + + + Case Sensitive + Регистрозависимо + + + Whole words + Слова полностью + -- cgit v0.12 From 65f0a022ab50e6f50f297f8be577b6f334692357 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 17 Jun 2009 14:52:03 +0200 Subject: Add Russian translation for Qt Linguist. Merge-request: 689 Reviewed-by: Oswald Buddenhagen --- tools/linguist/linguist/linguist.pro | 1 + translations/linguist_ru.ts | 2002 ++++++++++++++++++++++++++++++++++ 2 files changed, 2003 insertions(+) create mode 100644 translations/linguist_ru.ts diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro index 968293a..9f16ced 100644 --- a/tools/linguist/linguist/linguist.pro +++ b/tools/linguist/linguist/linguist.pro @@ -99,6 +99,7 @@ RESOURCES += linguist.qrc TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/linguist_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_pl.ts \ + $$[QT_INSTALL_TRANSLATIONS]/linguist_ru.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_zh_TW.ts \ diff --git a/translations/linguist_ru.ts b/translations/linguist_ru.ts new file mode 100644 index 0000000..058d86a --- /dev/null +++ b/translations/linguist_ru.ts @@ -0,0 +1,2002 @@ + + + + + + + + (New Entry) + (Новая запись) + + + + AboutDialog + + + Qt Linguist + Qt Linguist + + + + BatchTranslationDialog + + + Qt Linguist - Batch Translation + Qt Linguist - Пакетный перевод + + + + Options + Параметры + + + + Set translated entries to finished + Помечать переведенные записи как завершённые + + + + Retranslate entries with existing translation + Переводить записи, уже имеющие перевод + + + + Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked. + Имейте в виду, что изменённые записи будут отмечены как незавершённые, если не включен параметр "Помечать переведенные записи как завершённые". + + + + Translate also finished entries + Также переводить записи с завершёнными переводами + + + + Phrase book preference + Предпочитаемые разговорники + + + + Move up + Поднять + + + + Move down + Опустить + + + + The batch translator will search through the selected phrase books in the order given above. + Пакетный переводчик будет искать в выбранных разговорниках в указанном выше порядке. + + + + &Run + &Выполнить + + + + Cancel + Отмена + + + + Batch Translation of '%1' - Qt Linguist + Пакетный перевод '%1' - Qt Linguist + + + + Searching, please wait... + Идёт поиск, ждите... + + + + &Cancel + &Отмена + + + + Linguist batch translator + Пакетный переводчик Qt Linguist + + + + Batch translated %n entries + + Автоматически переведена %n запись + Автоматически переведены %n записи + Автоматически переведено %n записей + + + + + DataModel + + + <qt>Duplicate messages found in '%1': + <qt>В '%1' обнаружены повторяющиеся сообщения: + + + + <p>[more duplicates omitted] + <p>[остальные повторы не указаны] + + + + <p>* Context: %1<br>* Source: %2 + <p>* Контекст: %1<br>* Источник: %2 + + + + <br>* Comment: %3 + <br>* Комментарий: %3 + + + + Linguist does not know the plural rules for '%1'. +Will assume a single universal form. + Qt Linguist не знает правила множественных форм для '%1'. +Будет использована универсальная единичная форма. + + + + Cannot create '%2': %1 + Не удалось создать '%2': %1 + + + + Universal Form + Универсальная форма + + + + ErrorsView + + + Accelerator possibly superfluous in translation. + Возможно, лишний акселератор в переводе. + + + + Accelerator possibly missing in translation. + Возможно, пропущен акселератор в переводе. + + + + Translation does not end with the same punctuation as the source text. + Перевод не заканчивается тем же знаком препинания, что и исходный текст. + + + + A phrase book suggestion for '%1' was ignored. + Предложение разговорника для '%1' пропущено. + + + + Translation does not refer to the same place markers as in the source text. + Перевод не содержит тех же маркеров форматирования, что и исходный текст. + + + + Translation does not contain the necessary %n place marker. + Перевод не содержит необходимого маркера форматирования %n. + + + + Unknown error + Неизвестная ошибка + + + + FindDialog + + + + Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog + + + + + Find + Поиск + + + + This window allows you to search for some text in the translation source file. + Данное окно позволяет искать текст в файле перевода. + + + + &Find what: + &Искать: + + + + Type in the text to search for. + Введите искомый текст. + + + + Options + Параметры + + + + Source texts are searched when checked. + Если отмечено, поиск будет вестись в исходных текстах. + + + + &Source texts + &Исходные тексты + + + + Translations are searched when checked. + Если отмечено, поиск будет вестись в переведённых текстах. + + + + &Translations + &Переводы + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + Если отмечено, строки "ПрИмЕр" и "пример" будет считаться разными. + + + + &Match case + С учётом &регистра + + + + Comments and contexts are searched when checked. + Если отмечено, поиск будет вестись по контекстам и комментариям. + + + + &Comments + &Комментарии + + + + Ignore &accelerators + Пропускать &акселераторы + + + + Click here to find the next occurrence of the text you typed in. + Найти следующее совпадение для введённого текста. + + + + Find Next + Найти далее + + + + Click here to close this window. + Закрыть окно. + + + + Cancel + Отмена + + + + LRelease + + + Generated %n translation(s) (%1 finished and %2 unfinished) + + + Создан %n перевод (%1 завершённых и %2 незавершённых) + + Создано %n перевода (%1 завершённых и %2 незавершённых) + + Создано %n переводов (%1 завершённых и %2 незавершённых) + + + + + + Ignored %n untranslated source text(s) + + + Пропущен %n непереведённый исходный текст + + Пропущено %n непереведённых исходных текста + + Пропущено %n непереведённых исходных текстов + + + + + + MainWindow + + + + This is the application's main window. + Основное окно программы. + + + + + Source text + Исходный текст + + + + + Index + Индекс + + + + + Context + Контекст + + + + Items + Записи + + + + This panel lists the source contexts. + В данной панели перечислены исходные контексты. + + + + Strings + Строки + + + + Phrases and guesses + Фразы и похожие переводы + + + + Sources and Forms + Исходники и формы + + + + Warnings + Предупреждения + + + + MOD + status bar: file(s) modified + ИЗМ + + + + Loading... + Загрузка... + + + + + Loading File - Qt Linguist + Загрузка файла - Qt Linguist + + + + The file '%1' does not seem to be related to the currently open file(s) '%2'. + +Close the open file(s) first? + Файл '%1', похоже, не связан с открытым файлом(ами) '%2'. + +Закрыть открытые файлы? + + + + The file '%1' does not seem to be related to the file '%2' which is being loaded as well. + +Skip loading the first named file? + Файл '%1', похоже, не связан с загруженным файлом '%2'. + +Пропустить загрузку файла? + + + + %n translation unit(s) loaded. + + Загружена %n запись. + Загружено %n записи. + Загружено %n записей. + + + + + Related files (%1);; + Связанные файлы (%1);; + + + + Open Translation Files + Открыть файлы перевода + + + + + File saved. + Файл сохранён. + + + + + + Release + Компиляция + + + + Qt message files for released applications (*.qm) +All files (*) + Скомпилированные файлы перевода для приложений Qt (*.qm) +Все файлы (*) + + + + + File created. + Файл создан. + + + + + Printing... + Печать... + + + + Context: %1 + Контекст: %1 + + + + finished + завершён + + + + unresolved + неразрешённый + + + + obsolete + устаревший + + + + + Printing... (page %1) + Печать... (страница %1) + + + + + Printing completed + Печать завершена + + + + + Printing aborted + Печать прервана + + + + Search wrapped. + Поиск с начала. + + + + + + + + + + + + + Qt Linguist + Qt Linguist + + + + + Cannot find the string '%1'. + Не удалось найти строку '%1'. + + + + Search And Translate in '%1' - Qt Linguist + Поиск и перевод '%1' - Qt Linguist + + + + + + Translate - Qt Linguist + Перевод - Qt Linguist + + + + Translated %n entry(s) + + Переведена %n запись + Переведено %n записи + Переведено %n записей + + + + + No more occurrences of '%1'. Start over? + Нет больше совпадений с '%1'. Начать заново? + + + + Create New Phrase Book + Создать разговорник + + + + Qt phrase books (*.qph) +All files (*) + Разговорники Qt (*.qph) +Все файлы (*) + + + + Phrase book created. + Разговорник создан. + + + + Open Phrase Book + Открыть разговорник + + + + Qt phrase books (*.qph);;All files (*) + Разговорники Qt (*.qph);;Все файлы (*) + + + + %n phrase(s) loaded. + + Загружена %n фраза. + Загружено %n фразы. + Загружено %n фраз. + + + + + + + Add to phrase book + Добавить в разговорник + + + + No appropriate phrasebook found. + Подходящий разговорник не найден. + + + + Adding entry to phrasebook %1 + Добавление записи в разговорник %1 + + + + Select phrase book to add to + Выберите разговорник, в который желаете добавить фразу + + + + Unable to launch Qt Assistant (%1) + Не удалось запустить Qt Assistant (%1) + + + + Version %1 + Версия %1 + + + + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist - инструмент для добавления переводов в приложения на основе Qt.</p><p>%2</p><p>Copyright (C) 2009 Корпорация Nokia и/или её дочерние подразделения.</p><p>Программа предоставляется "как есть" без гарантий любого рода, включая гарантии дизайна, коммерческой ценности и пригодности для определённой цели.</p> + + + + Do you want to save the modified files? + Желаете сохранить изменённые файлы? + + + + Do you want to save '%1'? + Желаете сохранить '%1'? + + + + Qt Linguist[*] + Qt Linguist[*] + + + + %1[*] - Qt Linguist + %1[*] - Qt Linguist + + + + + No untranslated translation units left. + Непереведённых записей не осталось. + + + + &Window + &Окно + + + + Minimize + Свернуть + + + + Ctrl+M + + + + + Display the manual for %1. + Показать руководство для %1. + + + + Display information about %1. + Показать информацию о %1. + + + + &Save '%1' + &Сохранить'%1' + + + + Save '%1' &As... + Сохранить'%1' &как... + + + + Release '%1' + Скомпилировать '%1' + + + + Release '%1' As... + Скомпилировать '%1' как... + + + + &Close '%1' + &Закрыть '%1' + + + + + &Save + &Сохранить + + + + + + Save &As... + Сохранить &как... + + + + + + + Release As... + Скомпилировать как... + + + + + &Close + &Закрыть + + + + Save All + Сохранить все + + + + + &Release All + С&компилировать все + + + + Close All + Закрыть все + + + + &Release + С&компилировать + + + + Translation File &Settings for '%1'... + &Параметры файла перевода для '%1'... + + + + &Batch Translation of '%1'... + Пак&етный перевод '%1'... + + + + Search And &Translate in '%1'... + &Найти и перевести в '%1'... + + + + + Translation File &Settings... + &Параметры файла перевода... + + + + + &Batch Translation... + Пак&етный перевод... + + + + Search And &Translate... + &Найти и перевести... + + + + + File + Файл + + + + + Edit + Правка + + + + + Translation + Перевод + + + + + Validation + Проверка + + + + + Help + Справка + + + + Cannot read from phrase book '%1'. + Не удалось прочитать из разговорника '%1'. + + + + Close this phrase book. + Закрыть разговорник. + + + + Enables you to add, modify, or delete entries in this phrase book. + Позволяет добавлять, изменять и удалять записи в разговорнике. + + + + Print the entries in this phrase book. + Печать записей фраз разговорника. + + + + Cannot create phrase book '%1'. + Не удалось создать разговорник '%1'. + + + + Do you want to save phrase book '%1'? + Желаете сохранить разговорник '%1'? + + + + All + Все + + + + MainWindow + Главное окно + + + + &Phrases + Фра&зы + + + + &Close Phrase Book + &Закрыть разговорник + + + + &Edit Phrase Book + &Редактироваь разговорник + + + + &Print Phrase Book + &Печатать разговорник + + + + V&alidation + П&роверка + + + + &View + &Вид + + + + Vie&ws + Вид&ы + + + + &Toolbars + Пан&ели инструментов + + + + &Help + &Справка + + + + &Translation + П&еревод + + + + &File + &Файл + + + + Recently Opened &Files + Недавно открытые &файлы + + + + &Edit + &Правка + + + + &Open... + &Открыть... + + + + Open a Qt translation source file (TS file) for editing + Открыть исходный файл переводов Qt (файл TS) для изменения + + + + Ctrl+O + + + + + E&xit + В&ыход + + + + Close this window and exit. + Закрыть окно и выйти. + + + + Ctrl+Q + + + + + Save + Сохранить + + + + Save changes made to this Qt translation source file + Сохранить изменения в данном исходном файле перевода Qt + + + + Save As... + Сохранить как... + + + + Save changes made to this Qt translation source file into a new file. + Сохранить изменения в данном исходном файле перевода Qt в новый файл. + + + + Create a Qt message file suitable for released applications from the current message file. + Скомпилировать файл перевода Qt из текущего файла. + + + + &Print... + &Печать... + + + + Print a list of all the translation units in the current translation source file. + Печать списка всех записей перевода из текущего файла. + + + + Ctrl+P + + + + + &Undo + &Отменить + + + + Undo the last editing operation performed on the current translation. + Отменить последнее изменение текущего перевода. + + + + Ctrl+Z + + + + + &Redo + &Повторить + + + + Redo an undone editing operation performed on the translation. + Повторить отменённую правку перевода. + + + + Ctrl+Y + + + + + Cu&t + Выр&езать + + + + Copy the selected translation text to the clipboard and deletes it. + Скопировать отмеченный текст в буфер обмена и удалить его из оригинала. + + + + Ctrl+X + + + + + &Copy + &Копировать + + + + Copy the selected translation text to the clipboard. + Скопировать отмеченный текст в буфер обмена. + + + + Ctrl+C + + + + + &Paste + &Вставить + + + + Paste the clipboard text into the translation. + Вставить текст из буфера обмена в перевод. + + + + Ctrl+V + + + + + Select &All + В&ыделить всё + + + + Select the whole translation text. + Выделить весь текст перевода. + + + + Ctrl+A + + + + + &Find... + &Найти... + + + + Search for some text in the translation source file. + Найти текст в исходном файле перевода. + + + + Ctrl+F + + + + + Find &Next + Найти д&алее + + + + Continue the search where it was left. + Продолжить поиск с места, где он был остановлен. + + + + F3 + + + + + &Prev Unfinished + &Пред. незавершённый + + + + Previous unfinished item. + Предыдущий незавершённый перевод. + + + + Move to the previous unfinished item. + Перейти к предыдущему незавершённому переводу. + + + + Ctrl+K + + + + + &Next Unfinished + &След. незавершённый + + + + Next unfinished item. + Следующий незавершённый перевод. + + + + Move to the next unfinished item. + Перейти к следующему незавершённому переводу. + + + + Ctrl+J + + + + + P&rev + Пр&едыдущий + + + + Move to previous item. + Предыдущий перевод. + + + + Move to the previous item. + Перейти к предыдущему переводу. + + + + Ctrl+Shift+K + + + + + Ne&xt + С&ледующий + + + + Next item. + Следующий перевод. + + + + Move to the next item. + Перейти к следующему переводу. + + + + Ctrl+Shift+J + + + + + &Done and Next + &Готово и далее + + + + Mark item as done and move to the next unfinished item. + Пометить перевод как завершённый и перейти к следующему незавершённому. + + + + Mark this item as done and move to the next unfinished item. + Пометить перевод как завершённый и перейти к следующему незавершённому. + + + + + Copy from source text + Скопировать из исходного текста + + + + + Copies the source text into the translation field. + Скопировать исходный текст в поле перевода. + + + + Ctrl+B + + + + + &Accelerators + &Акселераторы + + + + Toggle the validity check of accelerators. + Переключение проверки акселераторов. + + + + Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. + Переключение проверки акселераторов, т.е. совпадает ли количество амперсандов в исходном и переведённом текстах. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. + + + + &Ending Punctuation + &Знаки препинания + + + + Toggle the validity check of ending punctuation. + Переключение проверки знаков препинания в конце текста. + + + + Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. + Переключение проверки знаков препинания в конце текста. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. + + + + &Phrase matches + Совпадение &фраз + + + + Toggle checking that phrase suggestions are used. + Переключение проверки использования предложений для фраз. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. + + + + Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. + Переключение проверки использования предложений для фраз. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. + + + + Place &Marker Matches + Совпадение &маркеров + + + + Toggle the validity check of place markers. + Переключение проверки маркеров форматирования. + + + + Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. + Переключение проверки маркеров форматирования, т.е. все ли маркеры (%1, %2, ...) исходного текста присутствуют в переведённом. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. + + + + &New Phrase Book... + &Новый разговорник... + + + + Create a new phrase book. + Создать разговорник. + + + + Ctrl+N + + + + + &Open Phrase Book... + &Открыть разговорник... + + + + Open a phrase book to assist translation. + Открыть разговорник для помощи в переводе. + + + + Ctrl+H + + + + + &Reset Sorting + &Сброс сортировки + + + + Sort the items back in the same order as in the message file. + Упорядочить элементы в той последовательности, в которой они находятся в файле. + + + + &Display guesses + &Предлагать похожие + + + + Set whether or not to display translation guesses. + Определяет необходимо или нет отображать похожие переводы. + + + + &Statistics + &Статистика + + + + Display translation statistics. + Показать статистику перевода. + + + + &Manual + &Руководство + + + + F1 + + + + + About Qt Linguist + О Qt Linguist + + + + About Qt + О Qt + + + + Display information about the Qt toolkit by Trolltech. + Показать информацию об инструментарии Qt от Nokia. + + + + &What's This? + &Что это? + + + + + What's This? + Что это? + + + + Enter What's This? mode. + Переход в режим "Что это?". + + + + Shift+F1 + + + + + &Search And Translate... + &Найти и перевести... + + + + Replace the translation on all entries that matches the search source text. + Заменить перевод всех записей, которые совпадают с искомым исходным текстом. + + + + Batch translate all entries using the information in the phrase books. + Перевести все записи в пакетном режиме, используя информацию из разговорника. + + + + Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the .ts file. + Создание готового файла перевода Qt из текущего файла. Имя файла будет автоматически определено из имени .ts файла. + + + + Open/Refresh Form &Preview + Открыть/обновить предпрос&мотр формы + + + + + Form Preview Tool + Инструмент предпросмотра форм + + + + F5 + + + + + &Add to Phrase Book + &Добавить в разговорник + + + + Ctrl+T + + + + + Open Read-O&nly... + Открыть только для &чтения... + + + + &Save All + &Сохранить все + + + + Ctrl+S + + + + + Close + Закрыть + + + + &Close All + &Закрыть все + + + + Ctrl+W + + + + + MessageEditor + + + + This is the right panel of the main window. + Правая панель основного окна + + + + + German + Немецкий + + + + Japanese + Японский + + + + French + Французский + + + + Polish + Польский + + + + Chinese + Китайский + + + + This whole panel allows you to view and edit the translation of some source text. + Данная панель позволяет просматривать и редактировать перевод исходного текста. + + + + Source text + Исходный текст + + + + This area shows the source text. + В данной области отображается исходный текст. + + + + Source text (Plural) + Исходный текст (множественная форма) + + + + This area shows the plural form of the source text. + В данной области отображается исходный текст во множественной форме. + + + + Developer comments + Комментарии разработчика + + + + This area shows a comment that may guide you, and the context in which the text occurs. + В данной области отображается комментарий, который поможет определить в каком контексте встречается переводимый текст. + + + + Here you can enter comments for your own use. They have no effect on the translated applications. + Здесь вы можете оставить комментарий для собственного использования. Комментарии не влияют на перевод приложений. + + + + %1 translation (%2) + %1 перевод (%2) + + + + This is where you can enter or modify the translation of the above source text. + Здесь вы можете ввести или изменить перевод текста, представленного выше. + + + + %1 translation + %1 перевод + + + + %1 translator comments + Комментарий переводчика на %1 + + + + '%1' +Line: %2 + '%1' +Строка: %2 + + + + MessageModel + + + Completion status for %1 + Состояние завершённости для %1 + + + + <file header> + <заголовок файла> + + + + <context comment> + <контекстный комментарий> + + + + <unnamed context> + <безымянный контекст> + + + + MsgEdit + + + + This is the right panel of the main window. + + + + + PhraseBookBox + + + + Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox. + + + + + %1[*] - Qt Linguist + %1[*] - Qt Linguist + + + + Qt Linguist + Qt Linguist + + + + Cannot save phrase book '%1'. + Не удалось сохранить разговорник '%1'. + + + + Edit Phrase Book + Правка разговорника + + + + This window allows you to add, modify, or delete entries in a phrase book. + Данное окно позволяет добавлять, изменять и удалять записи в разговорнике. + + + + &Translation: + &Перевод: + + + + This is the phrase in the target language corresponding to the source phrase. + Перевод, соответствующий исходной фразе. + + + + S&ource phrase: + &Исходная фраза: + + + + This is a definition for the source phrase. + Определение исходной фразы. + + + + This is the phrase in the source language. + Фраза на исходном языке. + + + + &Definition: + &Определение: + + + + Click here to add the phrase to the phrase book. + Добавить фразу в разговорник. + + + + &New Entry + Новая &запись + + + + Click here to remove the entry from the phrase book. + Удалить фразу из разговорника. + + + + &Remove Entry + &Удалить + + + + Settin&gs... + &Настройки... + + + + Click here to save the changes made. + Сохранить изменения. + + + + &Save + &Сохранить + + + + Click here to close this window. + Закрыть окно. + + + + Close + Закрыть + + + + PhraseModel + + + Source phrase + Исходная фраза + + + + Translation + Перевод + + + + Definition + Определение + + + + PhraseView + + + Insert + Вставить + + + + Edit + Правка + + + + Guess (%1) + Похожая (%1) + + + + Guess + Похожая + + + + QObject + + + Translation files (%1);; + Файлы перевода (%1);; + + + + All files (*) + Все файлы (*) + + + + + + + + + + Qt Linguist + Qt Linguist + + + + GNU Gettext localization files + Файлы локализации GNU Gettext + + + + Compiled Qt translations + Скомпилированные переводы Qt + + + + Qt Linguist 'Phrase Book' + 'Разговорник' Qt Linguist + + + + Qt translation sources (format 1.1) + Исходные файлы перевода Qt (формат 1.1) + + + + Qt translation sources (format 2.0) + Исходные файлы перевода Qt (формат 2.0) + + + + Qt translation sources (latest format) + Исходные файлы перевода Qt (последний формат) + + + + XLIFF localization files + Файлы локализации XLIFF + + + + C++ source files + Исходные коды C++ + + + + Java source files + Исходные коды Java + + + + Qt Script source files + Исходные коды Qt Script + + + + Qt Designer form files + Формы Qt Designer + + + + Qt Jambi form files + Формы Qt Jambi + + + + SourceCodeView + + + <i>Source code not available</i> + <i>Исходный код недоступен</i> + + + + <i>File %1 not available</i> + <i>Файл %1 недоступен</i> + + + + <i>File %1 not readable</i> + <i>Невозможно прочитать файл %1</i> + + + + Statistics + + + Statistics + Статистика + + + + Close + Закрыть + + + + Translation + Перевод + + + + Source + Источник + + + + + + + + + 0 + 0 + + + + Words: + Слов: + + + + Characters: + Символов: + + + + Characters (with spaces): + Символов (с пробелами): + + + + TranslateDialog + + + This window allows you to search for some text in the translation source file. + Данное окно позволяет искать текст в файле перевода. + + + + + Type in the text to search for. + Введите искомый текст. + + + + Find &source text: + &Найти текст: + + + + &Translate to: + &Перевести как: + + + + Search options + Параметры поиска + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + Если отмечено, строки "ПрИмЕр" и "пример" будет считаться разными. + + + + Match &case + С учётом &регистра + + + + Mark new translation as &finished + Помечать перевод как завер&шённый + + + + Click here to find the next occurrence of the text you typed in. + Найти следующее совпадение для введённого текста. + + + + Find Next + Найти далее + + + + Translate + Перевести + + + + Translate All + Перевести все + + + + Click here to close this window. + Закрыть окно. + + + + Cancel + Отмена + + + + TranslationSettingsDialog + + + Source language + Исходный язык + + + + + Language + Язык + + + + + Country/Region + Страна/Регион + + + + Target language + Язык перевода + + + + Any Country + Любая страна + + + + + Settings for '%1' - Qt Linguist + Настройки для '%1' - Qt Linguist + + + -- cgit v0.12 From bae2a5c42d97e783b0624355505d3109ba91753d Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 17 Jun 2009 14:52:04 +0200 Subject: Add Russian translation for QtHelp. Merge-request: 689 Reviewed-by: Oswald Buddenhagen --- tools/assistant/translations/qt_help.pro | 1 + translations/qt_help_ru.ts | 361 +++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+) create mode 100644 translations/qt_help_ru.ts diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index e6208a6..9f4d7d8 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -42,6 +42,7 @@ HEADERS += ../lib/qhelpcollectionhandler_p.h \ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qt_help_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_pl.ts \ + $$[QT_INSTALL_TRANSLATIONS]/qt_help_ru.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts \ diff --git a/translations/qt_help_ru.ts b/translations/qt_help_ru.ts new file mode 100644 index 0000000..16748fb --- /dev/null +++ b/translations/qt_help_ru.ts @@ -0,0 +1,361 @@ + + + + + QCLuceneResultWidget + + + Search Results + Результаты поиска + + + + Note: + Замечание: + + + + The search results may not be complete since the documentation is still being indexed! + Могли быть показаны не все результаты, так как документация ещё индексируется! + + + + Your search did not match any documents. + По вашему запросу не найдено ни одного документа. + + + + (The reason for this might be that the documentation is still being indexed.) + (Причиной этого может быть то, что документация ещё индексируется.) + + + + QHelpCollectionHandler + + + The collection file is not set up yet! + Файл набора ещё не установлен! + + + + Cannot load sqlite database driver! + Не удалось загрузить драйвер базы данных sqlite! + + + + + Cannot open collection file: %1 + Не удалось открыть файл набора: %1 + + + + Cannot create tables in file %1! + Не удалось создать таблицы в файле %1! + + + + The specified collection file already exists! + Указанный файла набора уже существует! + + + + Cannot create directory: %1 + Не удалось создать каталог: %1 + + + + Cannot copy collection file: %1 + Не удалось скопировать файл набора: %1 + + + + Unknown filter! + Неизвестный фильтр! + + + + Cannot register filter %1! + Не удалось зарегистрировать фильтр %1! + + + + Cannot open documentation file %1! + Не удалось открыть файл документации %1! + + + + Invalid documentation file! + Некорректный файл документации! + + + + The namespace %1 was not registered! + Пространство имён %1 не зарегистрировано! + + + + Namespace %1 already exists! + Пространство имён %1 уже существует! + + + + Cannot register namespace! + Не удалось зарегистрировать пространство имён! + + + + Cannot open database to optimize! + Не удалось открыть базу данных для оптимизации! + + + + QHelpDBReader + + + Cannot open database '%1' '%2': %3 + The placeholders are: %1 - The name of the database which cannot be opened %2 - The unique id for the connection %3 - The actual error string + Не удалось открыть базу данных '%1' '%2': %3 + + + + QHelpEngineCore + + + The specified namespace does not exist! + Указанное пространство имён не существует! + + + + QHelpEngineCorePrivate + + + Cannot open documentation file %1: %2! + Не удалось открыть файл документации %1: %2! + + + + QHelpGenerator + + + Invalid help data! + Некорректные данные справки! + + + + No output file name specified! + Не указано имя результирующего файла! + + + + Building up file structure... + Создание структуры файла... + + + + The file %1 cannot be overwritten! + Невозможно перезаписать файл %1! + + + + Cannot open data base file %1! + Не удалось открыть файл базы данных %1! + + + + Cannot register namespace %1! + Не удалось зарегистрировать пространство имён %1! + + + + Insert custom filters... + Вставка индивидуальных фильтров... + + + + Insert help data for filter section (%1 of %2)... + Вставка данных справки для секции фильтра (%1 из %2)... + + + + Documentation successfully generated. + Документация успешно создана. + + + + Some tables already exist! + Некоторые таблицы уже существуют! + + + + Cannot create tables! + Не удалось создать таблицы! + + + + Cannot register virtual folder! + Не удалось зарегистрировать виртуальный каталог! + + + + Insert files... + Вставка файлов... + + + + The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it. + Файл %1 должен быть в каталоге '%2' или в его подкаталоге. Пропускаем. + + + + The file %1 does not exist! Skipping it. + Файл %1 не существует! Пропускаем. + + + + Cannot open file %1! Skipping it. + Не удалось открыть файл %1! Пропускаем. + + + + The filter %1 is already registered! + Фильтр %1 уже зарегистрирован! + + + + Cannot register filter %1! + Не удалось зарегистрировать фильтр %1! + + + + Insert indices... + Вставка указателей... + + + + Insert contents... + Вставка оглавления... + + + + Cannot insert contents! + Не удаётся вставить оглавление! + + + + Cannot register contents! + Не удаётся зарегистрировать оглавление! + + + + QHelpSearchQueryWidget + + + Search for: + Искать: + + + + Search + Поиск + + + + Advanced search + Расширенный поиск + + + + words <B>similar</B> to: + <B>похожие</B> слова: + + + + <B>without</B> the words: + <B>не содержит</B> слова: + + + + with <B>exact phrase</B>: + содержит <B>фразу полностью</B>: + + + + with <B>all</B> of the words: + содержит <B>все</B> слова: + + + + with <B>at least one</B> of the words: + содержит <B> минимум одно</B> из слов: + + + + QHelpSearchResultWidget + + + 0 - 0 of 0 Hits + 0 - 0 из 0 соответствий + + + + QHelpSearchResultWidgetPrivate + + + %1 - %2 of %3 Hits + %1 - %2 из %3 соответствий + + + + QObject + + + Untitled + Безымянный + + + + Unknown token. + Неизвестный токен. + + + + Unknown token. Expected "QtHelpProject"! + Неизвестный токен. Ожидается "QtHelpProject"! + + + + Error in line %1: %2 + Ошибка в строке %1: %2 + + + + A virtual folder must not contain a '/' character! + Виртуальный каталог не должен содержать символ '/'! + + + + A namespace must not contain a '/' character! + Пространство имён не должно содержать символ '/'! + + + + Missing namespace in QtHelpProject. + Отсутствует пространство имён в QtHelpProject. + + + + Missing virtual folder in QtHelpProject + Отсутствует виртуальный каталог в QtHelpProject + + + + Missing attribute in keyword at line %1. + Отсутствует атрибут у ключевого слова в строке %1. + + + + The input file %1 could not be opened! + Невозможно открыть исходный файл %1! + + + -- cgit v0.12 From 688454f4fa508e5262786070a149f604156d5197 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Wed, 17 Jun 2009 14:52:04 +0200 Subject: Add Russian translation for Qt Assistant. Merge-request: 689 Reviewed-by: Oswald Buddenhagen --- tools/assistant/translations/translations.pro | 1 + tools/assistant/translations/translations_adp.pro | 1 + translations/assistant_adp_ru.ts | 780 +++++++++++++++ translations/assistant_ru.ts | 1063 +++++++++++++++++++++ 4 files changed, 1845 insertions(+) create mode 100644 translations/assistant_adp_ru.ts create mode 100644 translations/assistant_ru.ts diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro index 8572123..4b836e6 100644 --- a/tools/assistant/translations/translations.pro +++ b/tools/assistant/translations/translations.pro @@ -43,6 +43,7 @@ HEADERS += ../tools/assistant/aboutdialog.h \ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_pl.ts \ + $$[QT_INSTALL_TRANSLATIONS]/assistant_ru.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts \ diff --git a/tools/assistant/translations/translations_adp.pro b/tools/assistant/translations/translations_adp.pro index e3edca4..c6f3e81 100644 --- a/tools/assistant/translations/translations_adp.pro +++ b/tools/assistant/translations/translations_adp.pro @@ -34,6 +34,7 @@ HEADERS += ../compat/helpwindow.h \ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_adp_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_pl.ts \ + $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ru.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_TW.ts diff --git a/translations/assistant_adp_ru.ts b/translations/assistant_adp_ru.ts new file mode 100644 index 0000000..a587a91 --- /dev/null +++ b/translations/assistant_adp_ru.ts @@ -0,0 +1,780 @@ + + + + + AssistantServer + + Failed to bind to port %1 + Не удалось открыть порт %1 + + + Qt Assistant + Qt Assistant + + + + FontPanel + + &Family + Се&мейство + + + &Style + &Стиль + + + Font + Шрифт + + + &Writing system + Система &письма + + + &Point size + &Размер в пикселях + + + + FontSettingsDialog + + Application + Приложение + + + Browser + Обозреватель + + + Font settings for: + Настройки шрифта для: + + + Use custom settings + Использование индивидуальных настроек + + + Font Settings + Настройки шрифта + + + + HelpDialog + + &Index + &Указатель + + + &Look For: + &Искать: + + + &New + &Создать + + + &Search + &Поиск + + + <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> + <b>Ввод слова.</b><p>В список попадет то, что лучше соответствует введенной строке.</p> + + + <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> + <b>Ввод одного или более слов для поиска.</b><p>Сюда следует ввести одно или несколько слов, которые требуется найти. Слова могут содержкать символы-заменители (*). Если требуется найти словосочетание, то его нужно заключить в кавычки.</p> + + + <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> + <b>Найденные документы</b><p>В этом списке представлены все найденные при последнем поиске документы. Документы упорядочены по релевантности, т.е. чем выше, тем чаще в нём встречаются указанные слова.</p> + + + <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> + <b>Статьи справки распределённые по разделам.</b><p>Дважды кликните по одному из пунктов, чтобы увидеть какие статьи содержатся в данном разделе. Для открытия статьи просто дважды щелкните на ней.</p> + + + <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> + <b>Справка</b><p>Выберите необходимую статью справки из списка разделов или воспользуйтесь поиском по предметному указателю.</p> + + + <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> + <b>Список доступных статей справки.</b><p>Дважды щёлкните на пункте для открытия страницы помощи. Если найдено более одной, то потребуется выбрать желаемую страницу.</p> + + + Add new bookmark + Добавить новую закладку + + + Add the currently displayed page as a new bookmark. + Добавление текущей открытой страницы в закладки. + + + Cannot open the index file %1 + Не удаётся открыть файл индекса %1 + + + Con&tents + Содер&жание + + + Delete bookmark + Удалить закладку + + + Delete the selected bookmark. + Удаление выбранной закладки. + + + Display the help page for the full text search. + Открытие справки по полнотекстовому поиску. + + + Display the help page. + Открыть страницу справки. + + + Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. + Здесь отображается список тем, распределенных по разделам, указатель или закладки. Последняя вкладка содержит полнотекстовый поиск. + + + Displays the list of bookmarks. + Отображает список закладок. + + + Documentation file %1 does not exist! +Skipping file. + Файл документации %1 не существует! +Пропущен. + + + Documentation file %1 is not compatible! +Skipping file. + Файл документации %1 не совместим! +Пропущен. + + + Done + Готово + + + Enter keyword + Введите ключевое слово + + + Enter searchword(s). + Введите одно или более слов для поиска. + + + Failed to load keyword index file +Assistant will not work! + Не удалось загрузить файл индекса ключевых слов +Assistant не будет работать! + + + Failed to save fulltext search index +Assistant will not work! + Не удалось сохранить индекс полнотекстового поиска +Assistant не будет работать! + + + Found &Documents: + Найденные &документы: + + + Full Text Search + Полнотекстовый поиск + + + He&lp + &Справка + + + Help + Справка + + + Indexing files... + Индексирование файлов... + + + Open Link in New Tab + Открыть ссылку в новой вкладке + + + Open Link in New Window + Открыть ссылку в новом окне + + + Parse Error + Ошибка обработки + + + Prepare... + Подготовка... + + + Preparing... + Подготовка... + + + Pressing this button starts the search. + Нажатие на эту кнопку запустит процесс поиска. + + + Qt Assistant + Qt Assistant + + + Reading dictionary... + Чтение каталога... + + + Searching f&or: + &Искать: + + + Start searching. + Начать поиск. + + + The closing quotation mark is missing. + Пропущена закрывающая кавычка. + + + Using a wildcard within phrases is not allowed. + Использование символов-заменителей внутри фраз не допустимо. + + + Warning + Предупреждение + + + column 1 + столбец 1 + + + Open Link in Current Tab + Открыть ссылку в текущей вкладке + + + %n document(s) found. + + Найден %n документ. + Найдено %n документа. + Найдено %n документов. + + + + &Bookmarks + &Закладки + + + &Delete + &Удалить + + + + HelpWindow + + <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> + <div align="center"><h1>Страница не найдена</h1><br><h3>'%1'</h3></div> + + + Copy &Link Location + Копировать &адрес ссылки + + + Error... + Ошибка... + + + Failed to open link: '%1' + Не удалось открыть ссылку: '%1' + + + Help + Справка + + + OK + Закрыть + + + Open Link in New Tab + Открыть ссылку в новой вкладке + + + Open Link in New Window Shift+LMB + Открыть ссылку в новом окне Shift+LMB + + + Unable to launch web browser. + + Невозможно запустить вэб-браузер. + + + + + Index + + Untitled + Неозаглавлено + + + + MainWindow + + "What's This?" context sensitive help. + "Что это?" - контекстная справка. + + + &Add Bookmark + &Добавление закладки + + + &Close + &Закрыть + + + &Copy + &Копировать + + + &Edit + &Правка + + + &File + &Файл + + + &Find in Text... + П&оиск по тексту... + + + &Go + &Перейти + + + &Help + &Справка + + + &Home + &Домой + + + &Next + &Вперёд + + + &Previous + &Назад + + + &Print... + &Печать... + + + &View + &Вид + + + &Window + &Окно + + + ... + ... + + + About Qt + О Qt + + + About Qt Assistant + О Qt Assistant + + + Add Tab + Добавить вкладку + + + Add the currently displayed page as a new bookmark. + Добавление текущей открытой страницы в закладки. + + + Boo&kmarks + &Закладки + + + Cannot open file for writing! + Не удается открыть файл для записи! + + + Close Tab + Закрыть вкладку + + + Close the current window. + Закрыть текущее окно. + + + Display further information about Qt Assistant. + Показать дополнительную информацию о Qt Assistant. + + + Displays the main page of a specific documentation set. + Открывает главную страницу выбранного набора документации. + + + E&xit + Вы&ход + + + Failed to open about application contents in file: '%1' + Не удалось получить информацию о приложении из файла: '%1' + + + Find &Next + Продолжить п&оиск + + + Find &Previous + Найти &предыдущее + + + Font Settings... + Настройки шрифта... + + + Go + Перейти + + + Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. + Перейти на домашнюю страницу. Домашная страница Qt Assistant - Справочная документация по Qt. + + + Go to the next page. + Переход на следующую страницу. + + + Initializing Qt Assistant... + Инициализация Qt Assistant... + + + Minimize + Свернуть + + + New Window + Новое окно + + + Next Tab + Следующая вкладка + + + Open a new window. + Открыть новое окно. + + + Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. + Открыть окно поиска. Qt Assistant произведёт поиск введённого текста на текущей открытой странице. + + + Previous Tab + Предыдущая вкладка + + + Print the currently displayed page. + Печать текущей открытой страницы. + + + Qt Assistant + Qt Assistant + + + Qt Assistant Manual + Руководство по Qt Assistant + + + Qt Assistant by Nokia + Qt Assistant от Nokia + + + Quit Qt Assistant. + Выйти из Qt Assistant. + + + Save Page + Сохранить страницу + + + Save Page As... + Сохранить страницу как... + + + Select the page in contents tab. + Выбор страницы в оглавлении. + + + Sidebar + Боковая панель + + + Sync with Table of Contents + Синхронизировать с оглавлением + + + Toolbar + Панель инструментов + + + Views + Виды + + + What's This? + Что это? + + + Zoom &in + У&величить + + + Zoom &out + У&меньшить + + + Zoom in on the document, i.e. increase the font size. + Увеличение масштаба документа, т.е. увеличение размера шрифта. + + + Zoom out on the document, i.e. decrease the font size. + Уменьшение масштаба документа, т.е. уменьшение размера шрифта. + + + Ctrl+M + + + + SHIFT+CTRL+= + + + + Ctrl+T + + + + Ctrl+I + + + + Ctrl+B + + + + Ctrl+S + + + + Ctrl+] + + + + Ctrl+[ + + + + Ctrl+P + + + + Ctrl+Q + + + + Copy the selected text to the clipboard. + Скопировать выделенный текст в буфер обмена. + + + Ctrl+C + + + + Ctrl+F + + + + F3 + + + + Shift+F3 + + + + Ctrl+Home + + + + Go to the previous page. + Переход на предыдущую страницу. + + + Alt+Left + + + + Alt+Right + + + + Ctrl++ + + + + Ctrl+- + + + + Ctrl+N + + + + Ctrl+W + + + + Shift+F1 + + + + Ctrl+Alt+N + + + + Ctrl+Alt+Right + + + + Ctrl+Alt+Left + + + + Ctrl+Alt+Q + + + + F1 + + + + Ctrl+Alt+S + + + + + QObject + + Qt Assistant by Nokia + Qt Assistant от Nokia + + + + TabbedBrowser + + ... + ... + + + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Поиск с начала + + + Add page + Добавить страницу + + + Case Sensitive + Регистрозависимо + + + Close Other Tabs + Закрыть остальные вкладки + + + Close Tab + Закрыть вкладку + + + Close page + Закрыть страницу + + + New Tab + Новая вкладка + + + Next + Следующий + + + Previous + Предыдущий + + + Untitled + Безымянный + + + Whole words + Слова полностью + + + TabbedBrowser + + + + + TopicChooser + + &Close + &Закрыть + + + &Display + &Показать + + + &Topics + &Статьи + + + Choose Topic + Выбор статьи + + + Choose a topic for <b>%1</b> + Выберите статью для <b>%1</b> + + + Close the Dialog. + Закрытие окна. + + + Displays a list of available help topics for the keyword. + Показывает список доступных статей справки, соответствующих ключевому слову. + + + Open the topic selected in the list. + Открытие выбранной в списке темы. + + + Select a topic from the list and click the <b>Display</b>-button to open the online help. + Выберите статью из списка и нажмите на кнопку <b>Показать</b> для открытия онлайн справки. + + + diff --git a/translations/assistant_ru.ts b/translations/assistant_ru.ts new file mode 100644 index 0000000..32aa739 --- /dev/null +++ b/translations/assistant_ru.ts @@ -0,0 +1,1063 @@ + + + + + AboutDialog + + + &Close + &Закрыть + + + + AboutLabel + + + Warning + Предупреждение + + + + Unable to launch external application. + + Невозможно запустить внешнее приложение. + + + + + OK + Закрыть + + + + BookmarkDialog + + + Add Bookmark + Добавление закладки + + + + Bookmark: + Закладка: + + + + Add in Folder: + Добавить в папку: + + + + + + + + + + + New Folder + Новая папка + + + + + + + + Bookmarks + Закладки + + + + Delete Folder + Удалить папку + + + + Rename Folder + Переименовать папку + + + + BookmarkManager + + + Bookmarks + Закладки + + + + Remove + Удалить + + + + You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? + Удаление папки приведёт к удалению её содержимого.<br>Желаете продолжить? + + + + + New Folder + Новая папка + + + + BookmarkWidget + + + Delete Folder + Удалить папку + + + + Rename Folder + Переименовать папку + + + + Show Bookmark + Открыть закладку + + + + Show Bookmark in New Tab + Открыть закладку в новой вкладке + + + + Delete Bookmark + Удалить закладку + + + + Rename Bookmark + Переименовать закладку + + + + Filter: + Фильтр: + + + + Add + Добавить + + + + Remove + Удалить + + + + CentralWidget + + + Add new page + Открыть новую страницу + + + + Close current page + Закрыть текущую страницу + + + + Print Document + Печать документа + + + + + unknown + безымянная вкладка + + + + Add New Page + Открыть новую страницу + + + + Close This Page + Закрыть данную страницу + + + + Close Other Pages + Закрыть остальные страницы + + + + Add Bookmark for this Page... + Добавить закладку для этой страницы... + + + + Search + Поиск + + + + ContentWindow + + + Open Link + Открыть ссылку + + + + Open Link in New Tab + Открыть ссылку в новой вкладке + + + + FilterNameDialogClass + + + Add Filter Name + Добавление фильтра + + + + Filter Name: + Название фильтра: + + + + FindWidget + + + Previous + Предыдущее совпадение + + + + Next + Следующее совпадение + + + + Case Sensitive + Регистрозависимо + + + + Whole words + Слова полностью + + + + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Поиск с начала + + + + FontPanel + + + Font + Шрифт + + + + &Writing system + Система &письма + + + + &Family + Се&мейство + + + + &Style + &Стиль + + + + &Point size + &Размер в точках + + + + HelpViewer + + + Open Link in New Tab + Открыть ссылку в новой вкладке + + + + <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> + <title>Ошибка 404...</title><div align="center"><br><br><h1>Страница не найдена</h1><br><h3>'%1'</h3></div> + + + + Help + Справка + + + + Unable to launch external application. + + Невозможно запустить внешнее приложение. + + + + + OK + Закрыть + + + + Copy &Link Location + Копировать &адрес ссылки + + + + Open Link in New Tab Ctrl+LMB + Открыть ссылку в новой вкладке Ctrl+LMB + + + + IndexWindow + + + &Look for: + &Искать: + + + + Open Link + Открыть ссылку + + + + Open Link in New Tab + Открыть ссылку в новой вкладке + + + + InstallDialog + + + + Install Documentation + Установка документации + + + + Downloading documentation info... + Загрузка информации о документации... + + + + Download canceled. + Загрузка отменена. + + + + + + Done. + Готово. + + + + The file %1 already exists. Do you want to overwrite it? + Файл %1 уже существует. Желаете перезаписать его? + + + + Unable to save the file %1: %2. + Невозможно сохранить файл %1: %2. + + + + Downloading %1... + Загрузка %1... + + + + + + Download failed: %1. + Загрузка не удалась: %1. + + + + Documentation info file is corrupt! + Файл информации о документации повреждён! + + + + Download failed: Downloaded file is corrupted. + Загрузка не удалась: загруженный файл повреждён. + + + + Installing documentation %1... + Установка документации %1... + + + + Error while installing documentation: +%1 + При установке документации возникла ошибка: +%1 + + + + Available Documentation: + Доступная документация: + + + + Install + Установить + + + + Cancel + Отмена + + + + Close + Закрыть + + + + Installation Path: + Путь установки: + + + + ... + ... + + + + MainWindow + + + + Index + Индекс + + + + + Contents + Содержание + + + + + Bookmarks + Закладки + + + + + + Qt Assistant + Qt Assistant + + + + + Unfiltered + Без фильтрации + + + + Looking for Qt Documentation... + Поиск по документации Qt... + + + + &File + &Файл + + + + Page Set&up... + Параметры &страницы... + + + + Print Preview... + Предпросмотр печати... + + + + &Print... + &Печать... + + + + New &Tab + Новая &вкладка + + + + &Close Tab + &Закрыть вкладку + + + + &Quit + В&ыход + + + + CTRL+Q + + + + + &Edit + &Правка + + + + &Copy selected Text + &Копировать выделенный текст + + + + &Find in Text... + П&оиск в тексте... + + + + Find &Next + Найти &следующее + + + + Find &Previous + Найти &предыдущее + + + + Preferences... + Настройки... + + + + &View + &Вид + + + + Zoom &in + У&величить + + + + Zoom &out + У&меньшить + + + + Normal &Size + Нормальный р&азмер + + + + Ctrl+0 + + + + + ALT+C + + + + + ALT+I + + + + + ALT+O + + + + + Search + Поиск + + + + ALT+S + + + + + &Go + &Перейти + + + + &Home + &Домой + + + + ALT+Home + + + + + &Back + &Назад + + + + &Forward + &Вперёд + + + + Sync with Table of Contents + Синхронизировать с содержанием + + + + Next Page + Следующая страница + + + + Ctrl+Alt+Right + + + + + Previous Page + Предыдущая страница + + + + Ctrl+Alt+Left + + + + + &Bookmarks + &Закладки + + + + Add Bookmark... + Добавить закладку... + + + + CTRL+D + + + + + &Help + &Справка + + + + About... + О программе... + + + + Navigation Toolbar + Панель навигации + + + + &Window + &Окно + + + + Zoom + Масштаб + + + + Minimize + Свернуть + + + + Ctrl+M + + + + + Toolbars + Панели инструментов + + + + Filter Toolbar + Панель фильтров + + + + Filtered by: + Отфильтровано по: + + + + Address Toolbar + Панель адреса + + + + Address: + Адрес: + + + + Could not find the associated content item. + Не удалось найти элемент, связанный с содержанием. + + + + About %1 + О %1 + + + + Updating search index + Обновление поискового индекса + + + + PreferencesDialog + + + + Add Documentation + Добавить документацию + + + + Qt Compressed Help Files (*.qch) + Сжатые файлы справки Qt (*.qch) + + + + The namespace %1 is already registered! + Пространство имён %1 уже зарегистрировано! + + + + The specified file is not a valid Qt Help File! + Указанный файл не является корректным файлом справки Qt! + + + + Remove Documentation + Удалить документацию + + + + Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. + Некоторые открытые в Qt Assistant документы ссылаются на документацию, которую вы пытаетесь удалить. Удаление данной документации приведёт к закрытию таких документов. + + + + Cancel + Отмена + + + + OK + Удалить + + + + Use custom settings + Использовать индивидуальные настройки + + + + PreferencesDialogClass + + + Preferences + Настройки + + + + Fonts + Шрифты + + + + Font settings: + Настройки шрифта: + + + + Browser + Обозреватель + + + + Application + Приложение + + + + Filters + Фильтры + + + + Filter: + Фильтр: + + + + Attributes: + Атрибуты: + + + + 1 + + + + + Add + Добавить + + + + + Remove + Удалить + + + + Documentation + Документация + + + + Registered Documentation: + Зарегистрированная документация: + + + + Add... + Добавить... + + + + Options + Параметры + + + + Homepage + Домашная страница + + + + Current Page + Текущая страница + + + + Restore to default + Восстановить по умолчанию + + + + QObject + + + + Bookmark + Закладка + + + + The specified collection file does not exist! + Указанный файл набора отсутствует! + + + + Missing collection file! + Отсутствует файл набора! + + + + Invalid URL! + Некорректный URL! + + + + Missing URL! + Отсутствует URL! + + + + + + Unknown widget: %1 + Неизвестный виджет: %1 + + + + + + Missing widget! + Отсутствует виджет! + + + + + The specified Qt help file does not exist! + Указанный файл справки Qt отсутствует! + + + + + Missing help file! + Отсутствует файл справки! + + + + Missing filter argument! + Отсутствует параметр фильтра! + + + + Unknown option: %1 + Неизвестный параметр: %1 + + + + + Qt Assistant + Qt Assistant + + + + Could not register documentation file +%1 + +Reason: +%2 + Не удалось зарегистрировать файл документации +%1 + +Причина: +%2 + + + + Documentation successfully registered. + Документация успешно зарегистрирована. + + + + Documentation successfully unregistered. + Документация успешно дерегистрирована. + + + + Could not unregister documentation file +%1 + +Reason: +%2 + Не удалось дерегистрировать файл документации +%1 + +Причина: +%2 + + + + Cannot load sqlite database driver! + Не удалось загрузить драйвер базы данных sqlite! + + + + The specified collection file could not be read! + Не удалось прочитать указанный файл набора! + + + + RemoteControl + + + Debugging Remote Control + Отладочное удалённое управление + + + + Received Command: %1 %2 + Получена команда: %1 %2 + + + + SearchWidget + + + &Copy + &Копировать + + + + Copy &Link Location + Копировать &адрес ссылки + + + + Open Link in New Tab + Открыть ссылку в новой вкладке + + + + Select All + Выделить всё + + + + TopicChooser + + + Choose a topic for <b>%1</b>: + Выберите статью для <b>%1</b>: + + + + Choose Topic + Выбор статьи + + + + &Topics + &Статьи + + + + &Display + &Показать + + + + &Close + &Закрыть + + + -- cgit v0.12 From cb59c2fcfaed088f1dc82af7b5b7ec1d5e2a8edc Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 16 Jun 2009 16:31:45 +0200 Subject: Fixes: Tablet not sending mouse release events. Rewrote the usage of XCheckTypedWindowEvent to now use a XCheckIfEvent based scanner. Using XCheckTypedWindowEvent caused us to sometimes hop over relevant events while doing compression. So we could end up merging a tablet move event with another tablet move event even while there was a mouse-release event between them. This rewrite makes sure we stop merging when needed. Task: 249606 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qapplication_x11.cpp | 128 +++++++++++++++++++----------------- 1 file changed, 67 insertions(+), 61 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 988b34a..942836a 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -4611,6 +4611,46 @@ void fetchWacomToolId(int &deviceType, qint64 &serialId) } #endif +struct qt_tablet_motion_data +{ + Time timestamp; + int tabletMotionType; + bool error; // found a reason to stop searching +}; + +static Bool qt_mouseMotion_scanner(Display *, XEvent *event, XPointer arg) +{ + qt_tablet_motion_data *data = (qt_tablet_motion_data *) arg; + if (data->error) + return false; + + if (event->type == MotionNotify) + return true; + + data->error = event->type != data->tabletMotionType; // we stop compression when another event gets in between. + return false; +} + +static Bool qt_tabletMotion_scanner(Display *, XEvent *event, XPointer arg) +{ + qt_tablet_motion_data *data = (qt_tablet_motion_data *) arg; + if (data->error) + return false; + + if (event->type == data->tabletMotionType) { + if (data->timestamp > 0) { + if ((reinterpret_cast(event))->time > data->timestamp) { + data->error = true; + return false; + } + } + return true; + } + + data->error = event->type != MotionNotify; // we stop compression when another event gets in between. + return false; +} + bool QETWidget::translateXinputEvent(const XEvent *ev, QTabletDeviceData *tablet) { #if defined (Q_OS_IRIX) @@ -4637,7 +4677,6 @@ bool QETWidget::translateXinputEvent(const XEvent *ev, QTabletDeviceData *tablet qreal rotation = 0; int deviceType = QTabletEvent::NoDevice; int pointerType = QTabletEvent::UnknownPointer; - XEvent xinputMotionEvent; XEvent mouseMotionEvent; const XDeviceMotionEvent *motion = 0; XDeviceButtonEvent *button = 0; @@ -4645,8 +4684,6 @@ bool QETWidget::translateXinputEvent(const XEvent *ev, QTabletDeviceData *tablet QEvent::Type t; Qt::KeyboardModifiers modifiers = 0; bool reinsertMouseEvent = false; - bool neverFoundMouseEvent = true; - XEvent xinputMotionEventNext; XEvent mouseMotionEventSave; #if !defined (Q_OS_IRIX) XID device_id; @@ -4654,72 +4691,41 @@ bool QETWidget::translateXinputEvent(const XEvent *ev, QTabletDeviceData *tablet if (ev->type == tablet->xinput_motion) { motion = reinterpret_cast(ev); - for (;;) { - // get the corresponding mouseMotionEvent for motion - if (XCheckTypedWindowEvent(X11->display, internalWinId(), MotionNotify, &mouseMotionEvent)) { + + // Do event compression. Skip over tablet+mouse move events if there are newer ones. + qt_tablet_motion_data tabletMotionData; + tabletMotionData.tabletMotionType = tablet->xinput_motion; + while (true) { + // Find first mouse event since we expect them in pairs inside Qt + tabletMotionData.error =false; + tabletMotionData.timestamp = 0; + if (XCheckIfEvent(X11->display, &mouseMotionEvent, &qt_mouseMotion_scanner, (XPointer) &tabletMotionData)) { mouseMotionEventSave = mouseMotionEvent; reinsertMouseEvent = true; - neverFoundMouseEvent = false; - - if (mouseMotionEvent.xmotion.time > motion->time) { - XEvent xinputMotionEventLoop = *ev; - - // xinput event is older than the mouse event --> search for the corresponding xinput event for the given mouse event - while (mouseMotionEvent.xmotion.time > (reinterpret_cast(&xinputMotionEventLoop))->time) { - if (XCheckTypedWindowEvent(X11->display, internalWinId(), tablet->xinput_motion, &xinputMotionEventLoop)) { - xinputMotionEvent = xinputMotionEventLoop; - } - else { - break; - } - } - motion = reinterpret_cast(&xinputMotionEvent); - } - - // get the next xinputMotionEvent, for the next loop run - if (!XCheckTypedWindowEvent(X11->display, internalWinId(), tablet->xinput_motion, &xinputMotionEventNext)) { - XPutBackEvent(X11->display, &mouseMotionEvent); - reinsertMouseEvent = false; - break; - } - - if (mouseMotionEvent.xmotion.time != motion->time) { - // reinsert in order - if (mouseMotionEvent.xmotion.time >= motion->time) { - XPutBackEvent(X11->display, &mouseMotionEvent); - XPutBackEvent(X11->display, &xinputMotionEventNext); - // next entry in queue is xinputMotionEventNext - } - else { - XPutBackEvent(X11->display, &xinputMotionEventNext); - XPutBackEvent(X11->display, &mouseMotionEvent); - // next entry in queue is mouseMotionEvent - } - reinsertMouseEvent = false; - break; - } - } - else { + } else { break; } - xinputMotionEvent = xinputMotionEventNext; - motion = (reinterpret_cast(&xinputMotionEvent)); - } + // Now discard any duplicate tablet events. + XEvent dummy; + tabletMotionData.error = false; + tabletMotionData.timestamp = mouseMotionEvent.xmotion.time; + while (XCheckIfEvent(X11->display, &dummy, &qt_tabletMotion_scanner, (XPointer) &tabletMotionData)) { + motion = reinterpret_cast(&dummy); + } - if (reinsertMouseEvent) { - XPutBackEvent(X11->display, &mouseMotionEventSave); + // now check if there are more recent tablet motion events since we'll compress the current one with + // newer ones in that case + tabletMotionData.error = false; + tabletMotionData.timestamp = 0; + if (! XCheckIfEvent(X11->display, &dummy, &qt_tabletMotion_scanner, (XPointer) &tabletMotionData)) { + break; // done with compression + } + motion = reinterpret_cast(&dummy); } - if (neverFoundMouseEvent) { - XEvent xinputMotionEventLoop; - bool eventFound = false; - // xinput event without mouseMotionEvent --> search the newest xinputMotionEvent - while (XCheckTypedWindowEvent(X11->display, internalWinId(), tablet->xinput_motion, &xinputMotionEventLoop)) { - xinputMotionEvent = xinputMotionEventLoop; - eventFound = true; - } - if (eventFound) motion = reinterpret_cast(&xinputMotionEvent); + if (reinsertMouseEvent) { + XPutBackEvent(X11->display, &mouseMotionEventSave); } t = QEvent::TabletMove; -- cgit v0.12 From 38ef45edb1955b07c537be37bc4283749d8f28b2 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Wed, 17 Jun 2009 17:16:59 +0200 Subject: Compile fix on HP-UX Explicit casts make aCC happy. --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index e8a6d10..981efeb 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -3952,7 +3952,7 @@ void tst_QGraphicsItem::itemChange() QCOMPARE(tester.changes.size(), changeCount); QCOMPARE(tester.changes.at(tester.changes.size() - 2), QGraphicsItem::ItemFlagsChange); QCOMPARE(tester.changes.at(tester.changes.size() - 1), QGraphicsItem::ItemFlagsHaveChanged); - QVariant expectedFlags = qVariantFromValue(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges); + QVariant expectedFlags = qVariantFromValue(QGraphicsItem::GraphicsItemFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges)); QCOMPARE(tester.values.at(tester.values.size() - 2), expectedFlags); QCOMPARE(tester.values.at(tester.values.size() - 1), qVariantFromValue(QGraphicsItem::ItemIsSelectable)); } -- cgit v0.12 From 652b2ca3379715f757776654b406c1ac08573f22 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 17 Jun 2009 17:01:45 +0200 Subject: QNAM: More comments, some renamings Renamed some classes and member variables. Their names were causing confusion before because. Reviewed-by: Peter Hartmann --- src/network/access/qnetworkaccesscache_p.h | 3 +++ src/network/access/qnetworkaccessftpbackend.cpp | 18 +++++++++--------- src/network/access/qnetworkaccessftpbackend_p.h | 4 ++-- src/network/access/qnetworkaccesshttpbackend.cpp | 19 +++++++++++++------ src/network/access/qnetworkaccesshttpbackend_p.h | 4 ++-- src/network/access/qnetworkaccessmanager.cpp | 24 ++++++++++++------------ src/network/access/qnetworkaccessmanager_p.h | 12 +++++++++--- 7 files changed, 50 insertions(+), 34 deletions(-) diff --git a/src/network/access/qnetworkaccesscache_p.h b/src/network/access/qnetworkaccesscache_p.h index 3fdfbb4..439b3a0 100644 --- a/src/network/access/qnetworkaccesscache_p.h +++ b/src/network/access/qnetworkaccesscache_p.h @@ -64,6 +64,9 @@ QT_BEGIN_NAMESPACE class QNetworkRequest; class QUrl; +// this class is not about caching files but about +// caching objects used by QNetworkAccessManager, e.g. existing TCP connections +// or credentials. class QNetworkAccessCache: public QObject { Q_OBJECT diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp index 9be433d..d6276a3 100644 --- a/src/network/access/qnetworkaccessftpbackend.cpp +++ b/src/network/access/qnetworkaccessftpbackend.cpp @@ -82,11 +82,11 @@ QNetworkAccessFtpBackendFactory::create(QNetworkAccessManager::Operation op, return 0; } -class QNetworkAccessFtpFtp: public QFtp, public QNetworkAccessCache::CacheableObject +class QNetworkAccessCachedFtpConnection: public QFtp, public QNetworkAccessCache::CacheableObject { // Q_OBJECT public: - QNetworkAccessFtpFtp() + QNetworkAccessCachedFtpConnection() { setExpires(true); setShareable(false); @@ -148,11 +148,11 @@ void QNetworkAccessFtpBackend::open() } state = LoggingIn; - QNetworkAccessCache* cache = QNetworkAccessManagerPrivate::getCache(this); + QNetworkAccessCache* objectCache = QNetworkAccessManagerPrivate::getObjectCache(this); QByteArray cacheKey = makeCacheKey(url); - if (!cache->requestEntry(cacheKey, this, + if (!objectCache->requestEntry(cacheKey, this, SLOT(ftpConnectionReady(QNetworkAccessCache::CacheableObject*)))) { - ftp = new QNetworkAccessFtpFtp; + ftp = new QNetworkAccessCachedFtpConnection; #ifndef QT_NO_NETWORKPROXY if (proxy.type() == QNetworkProxy::FtpCachingProxy) ftp->setProxy(proxy.hostName(), proxy.port()); @@ -160,7 +160,7 @@ void QNetworkAccessFtpBackend::open() ftp->connectToHost(url.host(), url.port(DefaultFtpPort)); ftp->login(url.userName(), url.password()); - cache->addEntry(cacheKey, ftp); + objectCache->addEntry(cacheKey, ftp); ftpConnectionReady(ftp); } @@ -207,7 +207,7 @@ void QNetworkAccessFtpBackend::downstreamReadyWrite() void QNetworkAccessFtpBackend::ftpConnectionReady(QNetworkAccessCache::CacheableObject *o) { - ftp = static_cast(o); + ftp = static_cast(o); connect(ftp, SIGNAL(done(bool)), SLOT(ftpDone())); connect(ftp, SIGNAL(rawCommandReply(int,QString)), SLOT(ftpRawCommandReply(int,QString))); connect(ftp, SIGNAL(readyRead()), SLOT(ftpReadyRead())); @@ -227,7 +227,7 @@ void QNetworkAccessFtpBackend::disconnectFromFtp() disconnect(ftp, 0, this, 0); QByteArray key = makeCacheKey(url()); - QNetworkAccessManagerPrivate::getCache(this)->releaseEntry(key); + QNetworkAccessManagerPrivate::getObjectCache(this)->releaseEntry(key); ftp = 0; } @@ -278,7 +278,7 @@ void QNetworkAccessFtpBackend::ftpDone() // we're not connected, so remove the cache entry: QByteArray key = makeCacheKey(url()); - QNetworkAccessManagerPrivate::getCache(this)->removeEntry(key); + QNetworkAccessManagerPrivate::getObjectCache(this)->removeEntry(key); disconnect(ftp, 0, this, 0); ftp->dispose(); diff --git a/src/network/access/qnetworkaccessftpbackend_p.h b/src/network/access/qnetworkaccessftpbackend_p.h index 9626403..bb6d766 100644 --- a/src/network/access/qnetworkaccessftpbackend_p.h +++ b/src/network/access/qnetworkaccessftpbackend_p.h @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE class QNetworkAccessFtpIODevice; -class QNetworkAccessFtpFtp; +class QNetworkAccessCachedFtpConnection; class QNetworkAccessFtpBackend: public QNetworkAccessBackend { @@ -101,7 +101,7 @@ public slots: private: friend class QNetworkAccessFtpIODevice; - QPointer ftp; + QPointer ftp; QIODevice *uploadDevice; qint64 totalBytes; int helpId, sizeId, mdtmId; diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 8a6f27a..71808d4 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -270,12 +270,12 @@ static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const return code; } -class QNetworkAccessHttpBackendCache: public QHttpNetworkConnection, +class QNetworkAccessCachedHttpConnection: public QHttpNetworkConnection, public QNetworkAccessCache::CacheableObject { // Q_OBJECT public: - QNetworkAccessHttpBackendCache(const QString &hostName, quint16 port, bool encrypt) + QNetworkAccessCachedHttpConnection(const QString &hostName, quint16 port, bool encrypt) : QHttpNetworkConnection(hostName, port, encrypt) { setExpires(true); @@ -311,8 +311,11 @@ QNetworkAccessHttpBackend::~QNetworkAccessHttpBackend() void QNetworkAccessHttpBackend::disconnectFromHttp() { if (http) { + // This is abut disconnecting signals, not about disconnecting TCP connections disconnect(http, 0, this, 0); - QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getCache(this); + + // Get the object cache that stores our QHttpNetworkConnection objects + QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getObjectCache(this); cache->releaseEntry(cacheKey); } @@ -583,16 +586,20 @@ void QNetworkAccessHttpBackend::open() // check if we have an open connection to this host cacheKey = makeCacheKey(this, theProxy); - QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getCache(this); - if ((http = static_cast(cache->requestEntryNow(cacheKey))) == 0) { + QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getObjectCache(this); + // the http object is actually a QHttpNetworkConnection + http = static_cast(cache->requestEntryNow(cacheKey)); + if (http == 0) { // no entry in cache; create an object - http = new QNetworkAccessHttpBackendCache(url.host(), url.port(), encrypt); + // the http object is actually a QHttpNetworkConnection + http = new QNetworkAccessCachedHttpConnection(url.host(), url.port(), encrypt); #ifndef QT_NO_NETWORKPROXY http->setTransparentProxy(transparentProxy); http->setCacheProxy(cacheProxy); #endif + // cache the QHttpNetworkConnection corresponding to this cache key cache->addEntry(cacheKey, http); } diff --git a/src/network/access/qnetworkaccesshttpbackend_p.h b/src/network/access/qnetworkaccesshttpbackend_p.h index e0801ce..dec69d0 100644 --- a/src/network/access/qnetworkaccesshttpbackend_p.h +++ b/src/network/access/qnetworkaccesshttpbackend_p.h @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE -class QNetworkAccessHttpBackendCache; +class QNetworkAccessCachedHttpConnection; class QNetworkAccessHttpBackendIODevice; @@ -106,7 +106,7 @@ private slots: private: QHttpNetworkReply *httpReply; - QPointer http; + QPointer http; QByteArray cacheKey; QNetworkAccessBackendUploadIODevice *uploadDevice; diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 0ae920b..ed2f220 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -836,7 +836,7 @@ void QNetworkAccessManagerPrivate::addCredentials(const QNetworkProxy &p, QNetworkAuthenticationCache *auth = new QNetworkAuthenticationCache; auth->insert(QString(), authenticator->user(), authenticator->password()); - cache.addEntry(cacheKey, auth); // replace the existing one, if there's any + objectCache.addEntry(cacheKey, auth); // replace the existing one, if there's any if (realm.isEmpty()) { break; @@ -870,13 +870,13 @@ QNetworkAccessManagerPrivate::fetchCachedCredentials(const QNetworkProxy &p, QByteArray cacheKey = proxyAuthenticationKey(proxy, realm); if (cacheKey.isEmpty()) return 0; - if (!cache.hasEntry(cacheKey)) + if (!objectCache.hasEntry(cacheKey)) return 0; QNetworkAuthenticationCache *auth = - static_cast(cache.requestEntryNow(cacheKey)); + static_cast(objectCache.requestEntryNow(cacheKey)); QNetworkAuthenticationCredential *cred = auth->findClosestMatch(QString()); - cache.releaseEntry(cacheKey); + objectCache.releaseEntry(cacheKey); // proxy cache credentials always have exactly one item Q_ASSERT_X(cred, "QNetworkAccessManager", @@ -917,15 +917,15 @@ void QNetworkAccessManagerPrivate::addCredentials(const QUrl &url, copy.setUserName(authenticator->user()); do { QByteArray cacheKey = authenticationKey(copy, realm); - if (cache.hasEntry(cacheKey)) { + if (objectCache.hasEntry(cacheKey)) { QNetworkAuthenticationCache *auth = - static_cast(cache.requestEntryNow(cacheKey)); + static_cast(objectCache.requestEntryNow(cacheKey)); auth->insert(domain, authenticator->user(), authenticator->password()); - cache.releaseEntry(cacheKey); + objectCache.releaseEntry(cacheKey); } else { QNetworkAuthenticationCache *auth = new QNetworkAuthenticationCache; auth->insert(domain, authenticator->user(), authenticator->password()); - cache.addEntry(cacheKey, auth); + objectCache.addEntry(cacheKey, auth); } if (copy.userName().isEmpty()) { @@ -959,19 +959,19 @@ QNetworkAccessManagerPrivate::fetchCachedCredentials(const QUrl &url, realm = authentication->realm(); QByteArray cacheKey = authenticationKey(url, realm); - if (!cache.hasEntry(cacheKey)) + if (!objectCache.hasEntry(cacheKey)) return 0; QNetworkAuthenticationCache *auth = - static_cast(cache.requestEntryNow(cacheKey)); + static_cast(objectCache.requestEntryNow(cacheKey)); QNetworkAuthenticationCredential *cred = auth->findClosestMatch(url.path()); - cache.releaseEntry(cacheKey); + objectCache.releaseEntry(cacheKey); return cred; } void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager) { - manager->d_func()->cache.clear(); + manager->d_func()->objectCache.clear(); } QT_END_NAMESPACE diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h index c80613b..bcf9a2b 100644 --- a/src/network/access/qnetworkaccessmanager_p.h +++ b/src/network/access/qnetworkaccessmanager_p.h @@ -98,10 +98,12 @@ public: QNetworkAccessBackend *findBackend(QNetworkAccessManager::Operation op, const QNetworkRequest &request); + // this is the cache for storing downloaded files QAbstractNetworkCache *networkCache; + QNetworkCookieJar *cookieJar; - QNetworkAccessCache cache; + #ifndef QT_NO_NETWORKPROXY QNetworkProxy proxy; QNetworkProxyFactory *proxyFactory; @@ -109,8 +111,12 @@ public: bool cookieJarCreated; - static inline QNetworkAccessCache *getCache(QNetworkAccessBackend *backend) - { return &backend->manager->cache; } + + // this cache can be used by individual backends to cache e.g. their TCP connections to a server + // and use the connections for multiple requests. + QNetworkAccessCache objectCache; + static inline QNetworkAccessCache *getObjectCache(QNetworkAccessBackend *backend) + { return &backend->manager->objectCache; } Q_AUTOTEST_EXPORT static void clearCache(QNetworkAccessManager *manager); Q_DECLARE_PUBLIC(QNetworkAccessManager) -- cgit v0.12 From de0b9a76f8903448caa8e8995084b4d153f5c888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 16:00:11 +0200 Subject: Remove two work-arounds in QGraphicsView::paintEvent. The accelerate scrolling work-around is fixed by: 8ebe882b077fffedc3ff80fb80d2e181d5e56ab8 The other case was trying to avoid doing expensive QRegion calculations when everything must be repainted anyways. However, it was not entirely correct to assume all paintEvents are triggered by GV itself. Anyways, we don't need it anymore :-) Reviewed-by: Andreas --- src/gui/graphicsview/qgraphicsview.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 715bf37..d354b49 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3233,10 +3233,6 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Determine the exposed region d->exposedRegion = event->region(); - if (!d->accelerateScrolling) - d->exposedRegion = viewport()->rect(); - else if (d->viewportUpdateMode == BoundingRectViewportUpdate) - d->exposedRegion = event->rect(); QRectF exposedSceneRect = mapToScene(d->exposedRegion.boundingRect()).boundingRect(); // Set up the painter -- cgit v0.12 From 85f811b849f3b0e0b79e0f1b7bf41512d7f53414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 16:49:57 +0200 Subject: Reduce QTransform operations in QGraphicsView::paintEvent. The view is usually untransformed, and in that case there's no need to call QGraphicsView::viewportTransform() and QPainter::setWorldTransform(). Reviewed-by: Andreas --- src/gui/graphicsview/qgraphicsview.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index d354b49..5ed3a11 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3246,8 +3246,9 @@ void QGraphicsView::paintEvent(QPaintEvent *event) painter.setRenderHints(d->renderHints, true); // Set up viewport transform - const QTransform viewTransform = viewportTransform(); - painter.setWorldTransform(viewTransform); + const bool viewTransformed = isTransformed(); + if (viewTransformed) + painter.setWorldTransform(viewportTransform()); // Draw background if ((d->cacheMode & CacheBackground) @@ -3272,16 +3273,22 @@ void QGraphicsView::paintEvent(QPaintEvent *event) if (!d->backgroundPixmapExposed.isEmpty()) { QPainter backgroundPainter(&d->backgroundPixmap); backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip); - backgroundPainter.setTransform(viewportTransform()); + if (viewTransformed) + backgroundPainter.setTransform(painter.worldTransform()); backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source); drawBackground(&backgroundPainter, exposedSceneRect); d->backgroundPixmapExposed = QRegion(); } // Blit the background from the background pixmap - painter.setWorldTransform(QTransform()); - painter.drawPixmap(QPoint(), d->backgroundPixmap); - painter.setWorldTransform(viewTransform); + if (viewTransformed) { + const QTransform viewTransform = painter.worldTransform(); + painter.setWorldTransform(QTransform()); + painter.drawPixmap(QPoint(), d->backgroundPixmap); + painter.setWorldTransform(viewTransform); + } else { + painter.drawPixmap(QPoint(), d->backgroundPixmap); + } } else { if (!(d->optimizationFlags & DontSavePainterState)) painter.save(); @@ -3292,7 +3299,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Items if (!(d->optimizationFlags & IndirectPainting)) { - d->scene->d_func()->drawSubtreeRecursive(0, &painter, viewTransform, &d->exposedRegion, + d->scene->d_func()->drawSubtreeRecursive(0, &painter, painter.worldTransform(), &d->exposedRegion, viewport(), 0); } else { // Find all exposed items @@ -3304,8 +3311,10 @@ void QGraphicsView::paintEvent(QPaintEvent *event) const int numItems = itemList.size(); QGraphicsItem **itemArray = &itemList[0]; // Relies on QList internals, but is perfectly valid. QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems); - for (int i = 0; i < numItems; ++i) - itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], viewTransform, d->exposedRegion, allItems); + for (int i = 0; i < numItems; ++i) { + itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painter.worldTransform(), + d->exposedRegion, allItems); + } // Draw the items. drawItems(&painter, numItems, itemArray, styleOptionArray); d->freeStyleOptionsArray(styleOptionArray); -- cgit v0.12 From 2b7765b82720e844ec815d3f4fe84cd59624576e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 18:03:43 +0200 Subject: Sometimes broken transforms in GV. Broken after: 85f811b849f3b0e0b79e0f1b7bf41512d7f53414 QPainter::worldTransform returns a const reference(!) so we have to make a copy. --- src/gui/graphicsview/qgraphicsview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 5ed3a11..fb1a822 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3249,6 +3249,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) const bool viewTransformed = isTransformed(); if (viewTransformed) painter.setWorldTransform(viewportTransform()); + const QTransform viewTransform = painter.worldTransform(); // Draw background if ((d->cacheMode & CacheBackground) @@ -3274,7 +3275,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) QPainter backgroundPainter(&d->backgroundPixmap); backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip); if (viewTransformed) - backgroundPainter.setTransform(painter.worldTransform()); + backgroundPainter.setTransform(viewTransform); backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source); drawBackground(&backgroundPainter, exposedSceneRect); d->backgroundPixmapExposed = QRegion(); @@ -3282,7 +3283,6 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Blit the background from the background pixmap if (viewTransformed) { - const QTransform viewTransform = painter.worldTransform(); painter.setWorldTransform(QTransform()); painter.drawPixmap(QPoint(), d->backgroundPixmap); painter.setWorldTransform(viewTransform); @@ -3299,7 +3299,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Items if (!(d->optimizationFlags & IndirectPainting)) { - d->scene->d_func()->drawSubtreeRecursive(0, &painter, painter.worldTransform(), &d->exposedRegion, + d->scene->d_func()->drawSubtreeRecursive(0, &painter, viewTransform, &d->exposedRegion, viewport(), 0); } else { // Find all exposed items @@ -3312,7 +3312,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) QGraphicsItem **itemArray = &itemList[0]; // Relies on QList internals, but is perfectly valid. QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems); for (int i = 0; i < numItems; ++i) { - itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painter.worldTransform(), + itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], viewTransform, d->exposedRegion, allItems); } // Draw the items. -- cgit v0.12 From 08c80cc1bc50f9f2990f0fc459f09d2b554bce08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 20:35:25 +0200 Subject: Speedup QGraphicsScenePrivate::processDirtyItemsRecursive Don't calculate dirty scene transforms for invisible items. --- src/gui/graphicsview/qgraphicsscene.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e89d80f..7dbe6d9 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5307,24 +5307,27 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool { Q_Q(QGraphicsScene); - // Calculate the full scene transform for this item. - bool wasDirtyParentSceneTransform = false; - if (item && item->d_ptr->dirtySceneTransform && !item->d_ptr->itemIsUntransformable()) { - item->d_ptr->sceneTransform = item->d_ptr->parent ? item->d_ptr->parent->d_ptr->sceneTransform - : QTransform(); - item->d_ptr->combineTransformFromParent(&item->d_ptr->sceneTransform); - item->d_ptr->dirtySceneTransform = 0; - wasDirtyParentSceneTransform = true; - } - bool wasDirtyParentViewBoundingRects = false; + bool wasDirtyParentSceneTransform = false; qreal opacity = parentOpacity; + if (item) { wasDirtyParentViewBoundingRects = item->d_ptr->paintedViewBoundingRectsNeedRepaint; opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); - if ((!item->d_ptr->ignoreVisible && !item->d_ptr->visible) - || (!item->d_ptr->ignoreOpacity && opacity == 0.0) - || (item->d_ptr->flags & QGraphicsItem::ItemHasNoContents)) { + const bool itemIsHidden = !item->d_ptr->ignoreVisible && !item->d_ptr->visible; + const bool itemIsFullyTransparent = !item->d_ptr->ignoreOpacity && opacity == 0.0; + + if (item->d_ptr->dirtySceneTransform && !itemIsHidden && !item->d_ptr->itemIsUntransformable() + && !(itemIsFullyTransparent && item->d_ptr->childrenCombineOpacity())) { + // Calculate the full scene transform for this item. + item->d_ptr->sceneTransform = item->d_ptr->parent ? item->d_ptr->parent->d_ptr->sceneTransform + : QTransform(); + item->d_ptr->combineTransformFromParent(&item->d_ptr->sceneTransform); + item->d_ptr->dirtySceneTransform = 0; + wasDirtyParentSceneTransform = true; + } + + if (itemIsHidden || itemIsFullyTransparent || (item->d_ptr->flags & QGraphicsItem::ItemHasNoContents)) { // Make sure we don't process invisible items or items with no content. item->d_ptr->dirty = 0; item->d_ptr->paintedViewBoundingRectsNeedRepaint = 0; -- cgit v0.12 From e920c83084b48db7fe1925c7b98e34794eec6d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 21:34:59 +0200 Subject: Speedup QGraphicsScenePrivate::processDirtyItemsRecursive Avoid QTransform copy in common case. --- src/gui/graphicsview/qgraphicsitem_p.h | 9 +++++++++ src/gui/graphicsview/qgraphicsscene.cpp | 24 +++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index ce74b4f..b7fb122 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -55,6 +55,7 @@ #include "qgraphicsitem.h" #include "qpixmapcache.h" +#include "qgraphicsview_p.h" #include @@ -365,6 +366,14 @@ public: || (childrenCombineOpacity() && isFullyTransparent()); } + inline bool updateHelper(QGraphicsViewPrivate *view, const QRectF &rect, const QTransform &xform) const + { + Q_ASSERT(view); + if (hasBoundingRegionGranularity) + return view->updateRegion(xform.map(QRegion(rect.toRect()))); + return view->updateRect(xform.mapRect(rect).toRect()); + } + inline QTransform transformToParent() const; QPainterPath cachedClipPath; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 7dbe6d9..3f4bdde 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5395,21 +5395,19 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool if (dirtyRect.isEmpty()) continue; // Discard updates outside the bounding rect. - QTransform deviceTransform = item->d_ptr->sceneTransform; - if (view->isTransformed()) { - if (!untransformableItem) - deviceTransform *= view->viewportTransform(); - else - deviceTransform = item->deviceTransform(view->viewportTransform()); - } - - if (item->d_ptr->hasBoundingRegionGranularity) { - if (!viewPrivate->updateRegion(deviceTransform.map(QRegion(dirtyRect.toRect())))) - paintedViewBoundingRect = QRect(); + bool valid = false; + if (untransformableItem) { + valid = item->d_ptr->updateHelper(viewPrivate, dirtyRect, + item->deviceTransform(view->viewportTransform())); + } else if (!view->isTransformed()) { + valid = item->d_ptr->updateHelper(viewPrivate, dirtyRect, item->d_ptr->sceneTransform); } else { - if (!viewPrivate->updateRect(deviceTransform.mapRect(dirtyRect).toRect())) - paintedViewBoundingRect = QRect(); + QTransform deviceTransform = item->d_ptr->sceneTransform; + deviceTransform *= view->viewportTransform(); + valid = !item->d_ptr->updateHelper(viewPrivate, dirtyRect, deviceTransform); } + if (!valid) + paintedViewBoundingRect = QRect(); } } } -- cgit v0.12 From f5d119bf15e248634ef02437ffd9b77755262f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 17 Jun 2009 22:05:28 +0200 Subject: Small optimization to QGraphicsScenePrivate::drawSubtreeRecursive. We save three function calls by calling item->paint() directly. --- src/gui/graphicsview/qgraphicsscene.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 3f4bdde..71a4f08 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5206,7 +5206,11 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (clipsToShape) painter->setClipPath(item->shape(), Qt::IntersectClip); painter->setOpacity(opacity); - drawItemHelper(item, painter, &styleOptionTmp, widget, painterStateProtection); + + if (!item->d_ptr->cacheMode && !item->d_ptr->isWidget) + item->paint(painter, &styleOptionTmp, widget); + else + drawItemHelper(item, painter, &styleOptionTmp, widget, painterStateProtection); if (savePainter) painter->restore(); -- cgit v0.12 From 7d6da125cb94f70f2b14b60c87ded71876e28149 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 17 Jun 2009 17:31:23 -0700 Subject: Fix a couple of issues after QPixmapData optims Make sure we always set w, h and d. See fa8030a935acaacee570eee320e7510a4cfdc853 Reviewed-by: TrustMe --- .../gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 10 +++------ .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 25 +++++++++++++--------- .../gfxdrivers/directfb/qdirectfbscreen.cpp | 7 +----- src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 1 + 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 52f6a37..905fec3 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -129,18 +129,14 @@ int QDirectFBPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const if (!dfbSurface) return 0; - int w, h; - dfbSurface->GetSize(dfbSurface, &w, &h); - switch (metric) { case QPaintDevice::PdmWidth: - return w; case QPaintDevice::PdmHeight: - return h; + return (metric == PdmWidth ? size().width() : size().height()); case QPaintDevice::PdmWidthMM: - return (w * 1000) / dotsPerMeterX(); + return (size().width() * 1000) / dotsPerMeterX(); case QPaintDevice::PdmHeightMM: - return (h * 1000) / dotsPerMeterY(); + return (size().height() * 1000) / dotsPerMeterY(); case QPaintDevice::PdmPhysicalDpiX: case QPaintDevice::PdmDpiX: return (dotsPerMeterX() * 254) / 10000; // 0.0254 meters-per-inch diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index c239248..1c86466 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -72,9 +72,10 @@ void QDirectFBPixmapData::resize(int width, int height) } format = screen->pixelFormat(); - dfbSurface = QDirectFBScreen::instance()->createDFBSurface(QSize(width, height), - format, - QDirectFBScreen::TrackSurface); + dfbSurface = screen->createDFBSurface(QSize(width, height), + format, + QDirectFBScreen::TrackSurface); + d = screen->depth(); alpha = false; if (!dfbSurface) { invalidate(); @@ -195,8 +196,8 @@ void QDirectFBPixmapData::fromImage(const QImage &i, invalidate(); return; } - w = metric(QPaintDevice::PdmWidth); - h = metric(QPaintDevice::PdmHeight); + w = img.width(); + h = img.height(); is_null = (w <= 0 || h <= 0); d = metric(QPaintDevice::PdmDepth); setSerialNumber(++global_ser_no); @@ -209,7 +210,8 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) return; } - IDirectFBSurface *src = static_cast(data)->directFBSurface(); + const QDirectFBPixmapData *otherData = static_cast(data); + IDirectFBSurface *src = otherData->directFBSurface(); alpha = data->hasAlphaChannel(); format = (alpha ? QDirectFBScreen::instance()->alphaPixmapFormat() @@ -232,6 +234,9 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) } const DFBRectangle blitRect = { rect.x(), rect.y(), rect.width(), rect.height() }; + w = rect.width(); + h = rect.height(); + d = otherData->d; DFBResult result = dfbSurface->Blit(dfbSurface, src, &blitRect, 0, 0); #if (Q_DIRECTFB_VERSION >= 0x010000) dfbSurface->ReleaseSource(dfbSurface); @@ -303,9 +308,6 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform, return QPixmap(data); } - int w, h; - dfbSurface->GetSize(dfbSurface, &w, &h); - const QSize size = transform.mapRect(QRect(0, 0, w, h)).size(); if (size.isEmpty()) return QPixmap(); @@ -326,6 +328,8 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform, const DFBRectangle destRect = { 0, 0, size.width(), size.height() }; data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect); + data->w = size.width(); + data->h = size.height(); #if (Q_DIRECTFB_VERSION >= 0x010000) data->dfbSurface->ReleaseSource(data->dfbSurface); #endif @@ -338,7 +342,7 @@ QImage QDirectFBPixmapData::toImage() const return QImage(); #ifndef QT_NO_DIRECTFB_PREALLOCATED - QImage ret(size(), QDirectFBScreen::getImageFormat(dfbSurface)); + QImage ret(w, h, QDirectFBScreen::getImageFormat(dfbSurface)); if (IDirectFBSurface *imgSurface = screen->createDFBSurface(ret, QDirectFBScreen::DontTrackSurface)) { if (hasAlphaChannel()) { imgSurface->SetBlittingFlags(imgSurface, DSBLIT_BLEND_ALPHACHANNEL); @@ -387,6 +391,7 @@ void QDirectFBPixmapData::invalidate() { setSerialNumber(0); alpha = false; + d = w = h = 0; format = QImage::Format_Invalid; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 5d89994..62fef5b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -751,12 +751,7 @@ QPixmapData *QDirectFBScreenPrivate::createPixmapData(QPixmapData::PixelType typ return new QDirectFBPixmapData(type); } -#ifdef QT_NO_DEBUG -struct FlagDescription; -static const FlagDescription *accelerationDescriptions = 0; -static const FlagDescription *blitDescriptions = 0; -static const FlagDescription *drawDescriptions = 0; -#else +#ifndef QT_NO_DEBUG struct FlagDescription { const char *name; uint flag; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index c2c9a59..4239156 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -118,6 +118,7 @@ public: SurfaceCreationOptions options); void releaseDFBSurface(IDirectFBSurface *surface); + using QScreen::depth; static int depth(DFBSurfacePixelFormat format); static DFBSurfacePixelFormat getSurfacePixelFormat(QImage::Format format); -- cgit v0.12 From 75e8aaae5e8a0cbaa62fd4cd2a8235544f974a73 Mon Sep 17 00:00:00 2001 From: Stian Sandvik Thomassen Date: Thu, 18 Jun 2009 14:53:03 +1000 Subject: Made QInputDialog::getText() return null QString when rejected This reverts a behavior change introduced with Qt 4.5.0 where QInputDialog::getText() returned the line edit's text when the dialog was rejected. However, the behavior since Qt 4.0 has been to return a null QString when the dialog is rejected. Task-number: 256299 Reviewed-by: Andy Shaw --- src/gui/dialogs/qinputdialog.cpp | 6 +++--- tests/auto/qinputdialog/tst_qinputdialog.cpp | 25 +++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 7f21d3d..d94d8fe 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -1129,8 +1129,8 @@ void QInputDialog::done(int result) is \a parent. The dialog will be modal and uses the specified widget \a flags. - This function returns the text which has been entered in the line - edit. It will not return an empty string. + If the dialog is accepted, this function returns the text in the dialog's + line edit. If the dialog is rejected, a null QString is returned. Use this static function like this: @@ -1159,7 +1159,7 @@ QString QInputDialog::getText(QWidget *parent, const QString &title, const QStri if (ret) { return dialog.textValue(); } else { - return text; + return QString(); } } diff --git a/tests/auto/qinputdialog/tst_qinputdialog.cpp b/tests/auto/qinputdialog/tst_qinputdialog.cpp index a658aeb..7e4b828 100644 --- a/tests/auto/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/qinputdialog/tst_qinputdialog.cpp @@ -56,6 +56,7 @@ class tst_QInputDialog : public QObject { Q_OBJECT QWidget *parent; + QDialog::DialogCode doneCode; void (*testFunc)(QInputDialog *); static void testFuncGetInteger(QInputDialog *dialog); static void testFuncGetDouble(QInputDialog *dialog); @@ -72,6 +73,7 @@ private slots: void getText(); void getItem_data(); void getItem(); + void task256299_getTextReturnNullStringOnRejected(); }; QString stripFraction(const QString &s) @@ -245,8 +247,9 @@ void tst_QInputDialog::timerEvent(QTimerEvent *event) killTimer(event->timerId()); QInputDialog *dialog = qFindChild(parent); Q_ASSERT(dialog); - testFunc(dialog); - dialog->done(QDialog::Accepted); // cause static function call to return + if (testFunc) + testFunc(dialog); + dialog->done(doneCode); // cause static function call to return } void tst_QInputDialog::getInteger_data() @@ -266,6 +269,7 @@ void tst_QInputDialog::getInteger() QFETCH(int, max); Q_ASSERT(min < max); parent = new QWidget; + doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetInteger; startTimer(0); bool ok = false; @@ -305,6 +309,7 @@ void tst_QInputDialog::getDouble() QFETCH(int, decimals); Q_ASSERT(min < max && decimals >= 0 && decimals <= 13); parent = new QWidget; + doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetDouble; startTimer(0); bool ok = false; @@ -322,6 +327,7 @@ void tst_QInputDialog::getDouble() void tst_QInputDialog::task255502getDouble() { parent = new QWidget; + doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetDouble; startTimer(0); bool ok = false; @@ -347,6 +353,7 @@ void tst_QInputDialog::getText() { QFETCH(QString, text); parent = new QWidget; + doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetText; startTimer(0); bool ok = false; @@ -356,6 +363,19 @@ void tst_QInputDialog::getText() delete parent; } +void tst_QInputDialog::task256299_getTextReturnNullStringOnRejected() +{ + parent = new QWidget; + doneCode = QDialog::Rejected; + testFunc = 0; + startTimer(0); + bool ok = true; + const QString result = QInputDialog::getText(parent, "", "", QLineEdit::Normal, "foobar", &ok); + QVERIFY(!ok); + QVERIFY(result.isNull()); + delete parent; +} + void tst_QInputDialog::getItem_data() { QTest::addColumn("items"); @@ -373,6 +393,7 @@ void tst_QInputDialog::getItem() QFETCH(QStringList, items); QFETCH(bool, editable); parent = new QWidget; + doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetItem; startTimer(0); bool ok = false; -- cgit v0.12 From 7e8008cdd707d4ea3504df4ad02a4589c7b16510 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 18 Jun 2009 08:27:37 +0200 Subject: Fix nasty qt3-qt4 porting trap: for a QStringList, lst.remove(lst.at(idx)) used to only remove one item in Qt3, while it removes all occurrences of the item in Qt4 (remove==removeAll). To catch it I commented out remove(T) in my qlist.h, which caught this. Reviewed-by: Friedemann Kleint --- tools/qtconfig/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index eabaec6..a59f790 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -829,7 +829,7 @@ void MainWindow::removeSubstitute() int item = sublistbox->currentItem(); QStringList subs = QFont::substitutes(familysubcombo->currentText()); - subs.remove(subs.at(sublistbox->currentItem())); + subs.removeAt(sublistbox->currentItem()); sublistbox->clear(); sublistbox->insertStringList(subs); if (uint(item) > sublistbox->count()) @@ -909,7 +909,7 @@ void MainWindow::removeFontpath() return; int item = fontpathlistbox->currentItem(); - fontpaths.remove(fontpaths.at(fontpathlistbox->currentItem())); + fontpaths.removeAt(fontpathlistbox->currentItem()); fontpathlistbox->clear(); fontpathlistbox->insertStringList(fontpaths); if (uint(item) > fontpathlistbox->count()) -- cgit v0.12 From 578dd524b62b0f76fdd205e30102b374c48f21e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Thu, 18 Jun 2009 11:07:55 +0200 Subject: Use the unified toolbar on Mac. --- examples/graphicsview/diagramscene/mainwindow.cpp | 1 + examples/webkit/fancybrowser/mainwindow.cpp | 1 + examples/webkit/formextractor/mainwindow.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/examples/graphicsview/diagramscene/mainwindow.cpp b/examples/graphicsview/diagramscene/mainwindow.cpp index ad8006e..4783280 100644 --- a/examples/graphicsview/diagramscene/mainwindow.cpp +++ b/examples/graphicsview/diagramscene/mainwindow.cpp @@ -76,6 +76,7 @@ MainWindow::MainWindow() setCentralWidget(widget); setWindowTitle(tr("Diagramscene")); + setUnifiedTitleAndToolBarOnMac(true); } //! [0] diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp index 9f899b4..6d477db 100644 --- a/examples/webkit/fancybrowser/mainwindow.cpp +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -94,6 +94,7 @@ MainWindow::MainWindow() toolsMenu->addAction(tr("Remove all embedded elements"), this, SLOT(removeEmbeddedElements())); setCentralWidget(view); + setUnifiedTitleAndToolBarOnMac(true); } //! [3] diff --git a/examples/webkit/formextractor/mainwindow.cpp b/examples/webkit/formextractor/mainwindow.cpp index bc92f85..f774737 100644 --- a/examples/webkit/formextractor/mainwindow.cpp +++ b/examples/webkit/formextractor/mainwindow.cpp @@ -48,6 +48,7 @@ MainWindow::MainWindow() createMenus(); centralWidget = new FormExtractor(this); setCentralWidget(centralWidget); + setUnifiedTitleAndToolBarOnMac(true); } void MainWindow::createActions() -- cgit v0.12 From a22578e1fe0070442d4f7f5eae5187e32bc58ecd Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 18 Jun 2009 11:13:13 +0200 Subject: Doc: Resolved merge conflict in state machine overview Reviewed-by: Trust Me --- doc/src/statemachine.qdoc | 141 ++++++---------------------------------------- 1 file changed, 16 insertions(+), 125 deletions(-) diff --git a/doc/src/statemachine.qdoc b/doc/src/statemachine.qdoc index c017827..d2b508d 100644 --- a/doc/src/statemachine.qdoc +++ b/doc/src/statemachine.qdoc @@ -85,36 +85,20 @@ The following snippet shows the code needed to create such a state machine. First, we create the state machine and states: - \code - QStateMachine machine; - QState *s1 = new QState(); - QState *s2 = new QState(); - QState *s3 = new QState(); - \endcode + \snippet doc/src/snippets/statemachine/main.cpp 0 Then, we create the transitions by using the QState::addTransition() function: - \code - s1->addTransition(button, SIGNAL(clicked()), s2); - s2->addTransition(button, SIGNAL(clicked()), s3); - s3->addTransition(button, SIGNAL(clicked()), s1); - \endcode + \snippet doc/src/snippets/statemachine/main.cpp 1 Next, we add the states to the machine and set the machine's initial state: - \code - machine.addState(s1); - machine.addState(s2); - machine.addState(s3); - machine.setInitialState(s1); - \endcode + \snippet doc/src/snippets/statemachine/main.cpp 2 Finally, we start the state machine: - \code - machine.start(); - \endcode + \snippet doc/src/snippets/statemachine/main.cpp 3 The state machine executes asynchronously, i.e. it becomes part of your application's event loop. @@ -127,11 +111,7 @@ entered. In the following snippet, the value that should be assigned to a QLabel's text property is specified for each state: - \code - s1->assignProperty(label, "text", "In state s1"); - s2->assignProperty(label, "text", "In state s2"); - s3->assignProperty(label, "text", "In state s3"); - \endcode + \snippet doc/src/snippets/statemachine/main.cpp 4 When any of the states is entered, the label's text will be changed accordingly. @@ -142,10 +122,7 @@ state \c s3 is entered, and the button's showMinimized() slot will be called when \c s3 is exited: - \code - QObject::connect(s3, SIGNAL(entered()), button, SLOT(showMaximized())); - QObject::connect(s3, SIGNAL(exited()), button, SLOT(showMinimized())); - \endcode + \snippet doc/src/snippets/statemachine/main.cpp 5 Custom states can reimplement QAbstractState::onEntry() and QAbstractState::onExit(). @@ -194,22 +171,9 @@ initial one (i.e. which child state the state machine should enter when the parent state is the target of a transition). - \code - QState *s1 = new QState(); - QState *s11 = new QState(s1); - QState *s12 = new QState(s1); - QState *s13 = new QState(s1); - s1->setInitialState(s11); - machine.addState(s1); - \endcode + \snippet doc/src/snippets/statemachine/main2.cpp 0 - \code - QFinalState *s2 = new QFinalState(); - s1->addTransition(quitButton, SIGNAL(clicked()), s2); - machine.addState(s2); - - QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit())); - \endcode + \snippet doc/src/snippets/statemachine/main2.cpp 1 In this case we want the application to quit when the state machine is finished, so the machine's finished() signal is connected to the @@ -219,9 +183,7 @@ following code adds a transition that effectively causes the Quit button to be ignored when the state machine is in state \c s12. - \code - s12>addTransition(quitButton, SIGNAL(clicked()), s12); - \endcode + \snippet doc/src/snippets/statemachine/main2.cpp 2 A transition can have any state as its target, i.e. the target state does not have to be on the same level in the state hierarchy as the source state. @@ -259,21 +221,7 @@ simply display a message box when \c s3 is entered, then immediately return to the previous child state of \c s1 via the history state. - \code - QHistoryState *s1h = s1->addHistoryState(); - - QState *s3 = new QState(); - s3->assignProperty(label, "text", "In s3"); - QMessageBox mbox; - mbox.addButton(QMessageBox::Ok); - mbox.setText("Interrupted!"); - mbox.setIcon(QMessageBox::Information); - QObject::connect(s3, SIGNAL(entered()), &mbox, SLOT(exec())); - s3->addTransition(s1h); - machine.addState(s3); - - s1->addTransition(interruptButton, SIGNAL(clicked()), s3); - \endcode + \snippet doc/src/snippets/statemachine/main2.cpp 3 \section1 Using Parallel States to Avoid a Combinatorial Explosion of States @@ -305,12 +253,7 @@ To create a parallel state group, pass QState::ParallelStates to the QState constructor. - \code - QState *s1 = new QState(QState::ParallelStates); - // s11 and s12 will be entered in parallel - QState *s11 = new QState(s1); - QState *s12 = new QState(s1); - \endcode + \snippet doc/src/snippets/statemachine/main3.cpp 0 When a parallel state group is entered, all its child states will be simultaneously entered. Transitions within the individual child states @@ -334,9 +277,7 @@ finished(). We use a signal transition to cause this event to trigger a state change: - \code - s1->addTransition(s1, SIGNAL(finished()), s2); - \endcode + \snippet doc/src/snippets/statemachine/main3.cpp 1 Using final states in composite states is useful when you want to hide the internal details of a composite state; i.e. the only thing the outside world @@ -372,42 +313,12 @@ Here we define our own custom event type, \c StringEvent, for posting strings to the state machine: - \code - struct StringEvent : public QEvent - { - StringEvent(const QString &val) - : QEvent(QEvent::Type(QEvent::User+1)), - value(val) {} - - QString value; - }; - \endcode + \snippet doc/src/snippets/statemachine/main4.cpp 0 Next, we define a transition that only triggers when the event's string matches a particular string (a \e guarded transition): - \code - class StringTransition : public QAbstractTransition - { - public: - StringTransition(const QString &value) - : m_value(value) {} - - protected: - virtual bool eventTest(QEvent *e) const - { - if (e->type() != QEvent::Type(QEvent::User+1)) // StringEvent - return false; - StringEvent *se = static_cast(e); - return (m_value == se->value); - } - - virtual void onTransition(QEvent *) {} - - private: - QString m_value; - }; - \endcode + \snippet doc/src/snippets/statemachine/main4.cpp 1 In the eventTest() reimplementation, we first check if the event type is the desired one; if so, we cast the event to a StringEvent and perform the @@ -422,31 +333,11 @@ Here's what the implementation of the statechart looks like: - \code - QStateMachine machine; - QState *s1 = new QState(); - QState *s2 = new QState(); - QFinalState *done = new QFinalState(); - - StringTransition *t1 = new StringTransition("Hello"); - t1->setTargetState(s2); - s1->addTransition(t1); - StringTransition *t2 = new StringTransition("world"); - t2->setTargetState(done); - s2->addTransition(t2); - - machine.addState(s1); - machine.addState(s2); - machine.addState(done); - machine.setInitialState(s1); - \endcode + \snippet doc/src/snippets/statemachine/main4.cpp 2 Once the machine is started, we can post events to it. - \code - machine.postEvent(new StringEvent("Hello")); - machine.postEvent(new StringEvent("world")); - \endcode + \snippet doc/src/snippets/statemachine/main4.cpp 3 An event that is not handled by any relevant transition will be silently consumed by the state machine. It can be useful to group states and provide -- cgit v0.12 From 3af96d2fc56dffc5891f162de5daa3a804d9a91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 18 Jun 2009 11:15:03 +0200 Subject: Remove wrong negation. I changed the logic in e920c83084b48db7fe1925c7b98e34794eec6d55 and this negation incidentally snuck in. --- src/gui/graphicsview/qgraphicsscene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 71a4f08..15e8742 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5408,7 +5408,7 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool } else { QTransform deviceTransform = item->d_ptr->sceneTransform; deviceTransform *= view->viewportTransform(); - valid = !item->d_ptr->updateHelper(viewPrivate, dirtyRect, deviceTransform); + valid = item->d_ptr->updateHelper(viewPrivate, dirtyRect, deviceTransform); } if (!valid) paintedViewBoundingRect = QRect(); -- cgit v0.12 From de3093495ed17c3d6353dc413accc77ba54e51d4 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 18 Jun 2009 11:30:23 +0200 Subject: Doc: Removed mention of QItemAnimation from animation docs and set QPropertyAnimation as a main class. Reviewed-by: Trust Me --- doc/src/animation.qdoc | 6 ------ src/corelib/animation/qpropertyanimation.cpp | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/doc/src/animation.qdoc b/doc/src/animation.qdoc index 843e0aa..da9b401 100644 --- a/doc/src/animation.qdoc +++ b/doc/src/animation.qdoc @@ -208,12 +208,6 @@ Note that QObject must be the first class inherited as the meta-object system demands this. - \warning The QItemAnimation class, which was initially intended - for animating \l{QGraphicsItem}s may be deprecated or removed from - the animation framework. - - \omit (need something about the list of animations). \endomit - \section1 Easing Curves As mentioned, QPropertyAnimation performs an interpolation between diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index a68301c..7526a81 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -43,6 +43,7 @@ \class QPropertyAnimation \brief The QPropertyAnimation class animates Qt properties \since 4.6 + \mainclass \ingroup animation QPropertyAnimation interpolates over \l{Qt's Property System}{Qt -- cgit v0.12 From e9247f1da01f20ecd9e70b47286e7eb68bae892a Mon Sep 17 00:00:00 2001 From: mae Date: Thu, 18 Jun 2009 11:52:54 +0200 Subject: Fix accidental selection of popup items under the mouse in QComboBox If the widget under mouse is hidden, Qt can generate a synthetic mouse move event which gets delivered to the already hidden widget. This can then result in the wrong item being selected. Workaround: in QListView, ignore mouse move events when the widget is hidden. Reviewed-by: Denis --- src/gui/itemviews/qlistview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index 9b25730..f1b0d19 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -827,6 +827,8 @@ void QListView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e */ void QListView::mouseMoveEvent(QMouseEvent *e) { + if (!isVisible()) + return; Q_D(QListView); QAbstractItemView::mouseMoveEvent(e); if (state() == DragSelectingState -- cgit v0.12 From a9e11b46bdcbc93d89078f0fcca1e7ac91975ffc Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 18 Jun 2009 12:08:45 +0200 Subject: doc: Added explanation of QStringBuilder in QString The QStringBuilder class documentation is marked \internal. A section has been added to the documentation for QString that explains how to use the reimplemented '%' operator of QStringBuilder to obtain more efficient string concatenation operations. --- doc/src/snippets/qstring/stringbuilder.cpp | 28 ++++++++++++ src/corelib/tools/qstring.cpp | 68 ++++++++++++++++++++++++++++++ src/corelib/tools/qstringbuilder.cpp | 2 + 3 files changed, 98 insertions(+) create mode 100644 doc/src/snippets/qstring/stringbuilder.cpp diff --git a/doc/src/snippets/qstring/stringbuilder.cpp b/doc/src/snippets/qstring/stringbuilder.cpp new file mode 100644 index 0000000..90803e2 --- /dev/null +++ b/doc/src/snippets/qstring/stringbuilder.cpp @@ -0,0 +1,28 @@ + +//! [0] + QString foo; + QString type = "long"; + + foo->setText(QLatin1String("vector<") + type + QLatin1String(">::iterator")); + + if (foo.startsWith("(" + type + ") 0x")) + ... +//! [0] + +//! [3] + #define QT_USE_FAST_CONCATENATION +//! [3] + +//! [4] + #define QT_USE_FAST_CONCATENATION + #define QT_USE_FAST_OPERATOR_PLUS +//! [4] + +//! [5] + #include + + QString hello("hello"); + QStringRef el(&hello, 2, 3); + QLatin1String world("world"); + QString message = hello % el % world % QChar('!'); +//! [5] diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index ced6dd5..3b70f44 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -663,6 +663,74 @@ const QString::Null QString::null = { }; formats, the \e precision represents the maximum number of significant digits (trailing zeroes are omitted). + \section1 More Efficient String Construction + + Using the QString \c{'+'} operator, it is easy to construct a + complex string from multiple substrings. You will often write code + like this: + + \snippet doc/src/snippets/qstring/stringbuilder.cpp 0 + + There is nothing wrong with either of these string constructions, + but there are a few hidden inefficiencies. Beginning with Qt 4.6, + you can eliminate them. + + First, multiple uses of the \c{'+'} operator usually means + multiple memory allocations. When concatenating \e{n} substrings, + where \e{n > 2}, there can be as many as \e{n - 1} calls to the + memory allocator. + + Second, QLatin1String does not store its length internally but + calls qstrlen() when it needs to know its length. + + In 4.6, an internal template class \c{QStringBuilder} has been + added along with a few helper functions. This class is marked + internal and does not appear in the documentation, because you + aren't meant to instantiate it in your code. Its use will be + automatic, as described below. The class is found in + \c {src/corelib/tools/qstringbuilder.cpp} if you want to have a + look at it. + + \c{QStringBuilder} uses expression templates and reimplements the + \c{'%'} operator so that when you use \c{'%'} for string + concatenation instead of \c{'+'}, multiple substring + concatenations will be postponed until the final result is about + to be assigned to a QString. At this point, the amount of memory + required for the final result is known. The memory allocator is + then called \e{once} to get the required space, and the substrings + are copied into it one by one. + + \c{QLatin1Literal} is a second internal class that can replace + QLatin1String, which can't be changed for compatibility reasons. + \c{QLatin1Literal} stores its length, thereby saving time when + \c{QStringBuilder} computes the amount of memory required for the + final string. + + Additional efficiency is gained by inlining and reduced reference + counting (the QString created from a \c{QStringBuilder} typically + has a ref count of 1, whereas QString::append() needs an extra + test). + + There are three ways you can access this improved method of string + construction. The straightforward way is to include + \c{QStringBuilder} wherever you want to use it, and use the + \c{'%'} operator instead of \c{'+'} when concatenating strings: + + \snippet doc/src/snippets/qstring/stringbuilder.cpp 5 + + A more global approach is to include this define: + + \snippet doc/src/snippets/qstring/stringbuilder.cpp 3 + + and use \c{'%'} instead of \c{'+'} for string concatenation + everywhere. The third approach, which is the most convenient but + not entirely source compatible, is to include two defines: + + \snippet doc/src/snippets/qstring/stringbuilder.cpp 4 + + and the \c{'+'} will automatically be performed as the + \c{QStringBuilder} \c{'%'} everywhere. + \sa fromRawData(), QChar, QLatin1String, QByteArray, QStringRef */ diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 17e2cec..fbb784e 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -43,6 +43,7 @@ /*! \class QLatin1Literal + \internal \reentrant \since 4.6 @@ -83,6 +84,7 @@ /*! \class QStringBuilder + \internal \reentrant \since 4.6 -- cgit v0.12 From c38ece31d036cf2216392dda9c96736eabcb0f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 18 Jun 2009 12:13:44 +0200 Subject: Compile on MSVC. The QtSVG module failed to link because it includes qgraphicsitem_p.h, which had an inlined function (updateHelper) that called an undeclared function (QGraphicViewPrivate::update(Region|Rect))...Resulting in unresolved symbols. Reviewed-by: MariusSO --- src/gui/graphicsview/qgraphicsitem_p.h | 8 -------- src/gui/graphicsview/qgraphicsscene.cpp | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index b7fb122..b9e7041 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -366,14 +366,6 @@ public: || (childrenCombineOpacity() && isFullyTransparent()); } - inline bool updateHelper(QGraphicsViewPrivate *view, const QRectF &rect, const QTransform &xform) const - { - Q_ASSERT(view); - if (hasBoundingRegionGranularity) - return view->updateRegion(xform.map(QRegion(rect.toRect()))); - return view->updateRect(xform.mapRect(rect).toRect()); - } - inline QTransform transformToParent() const; QPainterPath cachedClipPath; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 15e8742..d9d31ef 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5306,6 +5306,16 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b } } +static inline bool updateHelper(QGraphicsViewPrivate *view, QGraphicsItemPrivate *item, + const QRectF &rect, const QTransform &xform) +{ + Q_ASSERT(view); + Q_ASSERT(item); + if (item->hasBoundingRegionGranularity) + return view->updateRegion(xform.map(QRegion(rect.toRect()))); + return view->updateRect(xform.mapRect(rect).toRect()); +} + void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren, qreal parentOpacity) { @@ -5401,14 +5411,14 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool bool valid = false; if (untransformableItem) { - valid = item->d_ptr->updateHelper(viewPrivate, dirtyRect, - item->deviceTransform(view->viewportTransform())); + valid = updateHelper(viewPrivate, item->d_ptr, dirtyRect, + item->deviceTransform(view->viewportTransform())); } else if (!view->isTransformed()) { - valid = item->d_ptr->updateHelper(viewPrivate, dirtyRect, item->d_ptr->sceneTransform); + valid = updateHelper(viewPrivate, item->d_ptr, dirtyRect, item->d_ptr->sceneTransform); } else { QTransform deviceTransform = item->d_ptr->sceneTransform; deviceTransform *= view->viewportTransform(); - valid = item->d_ptr->updateHelper(viewPrivate, dirtyRect, deviceTransform); + valid = updateHelper(viewPrivate, item->d_ptr, dirtyRect, deviceTransform); } if (!valid) paintedViewBoundingRect = QRect(); -- cgit v0.12 From cab70bbf1d29a7cdf81d561fdd74e16f7280c689 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 18 Jun 2009 11:23:24 +0200 Subject: Autotests: fix compile issue on hpux --- tests/auto/modeltest/modeltest.cpp | 4 ++-- tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro | 1 + tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro | 1 + tests/auto/qstatemachine/tst_qstatemachine.cpp | 10 +++++----- tests/auto/qtabbar/tst_qtabbar.cpp | 2 +- tests/auto/windowsmobile/test/tst_windowsmobile.cpp | 2 ++ 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/auto/modeltest/modeltest.cpp b/tests/auto/modeltest/modeltest.cpp index 68b723f..c4cc820 100644 --- a/tests/auto/modeltest/modeltest.cpp +++ b/tests/auto/modeltest/modeltest.cpp @@ -475,7 +475,7 @@ void ModelTest::data() void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, int end ) { // Q_UNUSED(end); - qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).value() + qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString() << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) ); // qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) ); Changing c; @@ -496,7 +496,7 @@ void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end ) Changing c = insert.pop(); Q_ASSERT ( c.parent == parent ); qDebug() << "rowsInserted" << "start=" << start << "end=" << end << "oldsize=" << c.oldSize - << "parent=" << model->data ( parent ).value() << "current rowcount of parent=" << model->rowCount ( parent ); + << "parent=" << model->data ( parent ).toString() << "current rowcount of parent=" << model->rowCount ( parent ); for (int ii=start; ii <= end; ii++) { diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro index bc750c5..3283873 100644 --- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -1,4 +1,5 @@ load(qttest_p4) SOURCES += tst_qhttpnetworkconnection.cpp +INCLUDEPATH += $$(QTDIR)/src/3rdparty/zlib QT = core network diff --git a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro index 9593c55..0755055 100644 --- a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro +++ b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro @@ -1,4 +1,5 @@ load(qttest_p4) SOURCES += tst_qhttpnetworkreply.cpp +INCLUDEPATH += $$(QTDIR)/src/3rdparty/zlib QT = core network diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 6040abd..b39f0a1 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -413,7 +413,7 @@ void tst_QStateMachine::customGlobalErrorState() machine.start(); QCoreApplication::processEvents(); - QCOMPARE(machine.errorState(), customErrorState); + QCOMPARE(machine.errorState(), static_cast(customErrorState)); QCOMPARE(machine.configuration().count(), 1); QVERIFY(machine.configuration().contains(initialState)); @@ -1724,18 +1724,18 @@ void tst_QStateMachine::signalTransitions() QStateMachine machine; QState *s0 = new QState(machine.rootState()); QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: sender cannot be null"); - QCOMPARE(s0->addTransition(0, SIGNAL(noSuchSignal()), 0), (QAbstractTransition*)0); + QCOMPARE(s0->addTransition(0, SIGNAL(noSuchSignal()), 0), (QSignalTransition*)0); SignalEmitter emitter; QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: signal cannot be null"); - QCOMPARE(s0->addTransition(&emitter, 0, 0), (QAbstractTransition*)0); + QCOMPARE(s0->addTransition(&emitter, 0, 0), (QSignalTransition*)0); QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: cannot add transition to null state"); - QCOMPARE(s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), 0), (QAbstractTransition*)0); + QCOMPARE(s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), 0), (QSignalTransition*)0); QFinalState *s1 = new QFinalState(machine.rootState()); QTest::ignoreMessage(QtWarningMsg, "QState::addTransition: no such signal SignalEmitter::noSuchSignal()"); - QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QAbstractTransition*)0); + QCOMPARE(s0->addTransition(&emitter, SIGNAL(noSuchSignal()), s1), (QSignalTransition*)0); QSignalTransition *trans = s0->addTransition(&emitter, SIGNAL(signalWithNoArg()), s1); QVERIFY(trans != 0); diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp index 29f42df..f908d3f 100644 --- a/tests/auto/qtabbar/tst_qtabbar.cpp +++ b/tests/auto/qtabbar/tst_qtabbar.cpp @@ -370,7 +370,7 @@ void tst_QTabBar::tabButton() tabbar.setTabButton(0, position, button); - QCOMPARE(tabbar.tabButton(0, position), static_cast(button)); + QCOMPARE(tabbar.tabButton(0, position), static_cast(button)); QTRY_VERIFY(!button->isHidden()); QVERIFY(tabbar.tabButton(0, otherSide) == 0); QCOMPARE(button->parent(), static_cast(&tabbar)); diff --git a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp index 843974d..8c7c021 100644 --- a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp +++ b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp @@ -44,8 +44,10 @@ #include #include #include +#ifdef Q_OS_WINCE_WM #include #include +#endif -- cgit v0.12 From cc08a4d04894eace196631029731a3af37547b7f Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 18 Jun 2009 12:39:46 +0200 Subject: QMenuBar: fixed highlight problem on actions without menu An item without menu could stay highlighted even when the mouse left the menu bar. Task-number: 256322 Reviewed-by: alexis --- src/gui/widgets/qmenubar.cpp | 3 ++- tests/auto/qmenubar/tst_qmenubar.cpp | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 3857e30..34de252 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1253,7 +1253,8 @@ void QMenuBar::mouseMoveEvent(QMouseEvent *e) void QMenuBar::leaveEvent(QEvent *) { Q_D(QMenuBar); - if(!hasFocus() && !d->popupState) + if((!hasFocus() && !d->popupState) || + (d->currentAction && d->currentAction->menu() == 0)) d->setCurrentAction(0); } diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 5404d46..8a38782 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -149,6 +149,7 @@ private slots: void check_shortcutPress(); void check_menuPosition(); void task223138_triggered(); + void task256322_highlight(); #if defined(QT3_SUPPORT) void indexBasedInsertion_data(); @@ -1520,6 +1521,41 @@ void tst_QMenuBar::task223138_triggered() QCOMPARE(submenuSpy.count(), 1); } +void tst_QMenuBar::task256322_highlight() +{ + QMainWindow win; + QMenu menu; + QAction *file = win.menuBar()->addMenu(&menu); + file->setText("file"); + QMenu menu2; + QAction *file2 = win.menuBar()->addMenu(&menu2); + file2->setText("file2"); + QAction *nothing = win.menuBar()->addAction("nothing"); + + win.show(); + + QTest::mouseClick(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center()); + QVERIFY(menu.isVisible()); + QVERIFY(!menu2.isVisible()); + QCOMPARE(win.menuBar()->activeAction(), file); + + QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file2).center()); + QVERIFY(!menu.isVisible()); + QVERIFY(menu2.isVisible()); + QCOMPARE(win.menuBar()->activeAction(), file2); + + QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(nothing).center()); + QVERIFY(!menu.isVisible()); + QVERIFY(!menu2.isVisible()); + QCOMPARE(win.menuBar()->activeAction(), nothing); + + QTest::mouseMove(&win, win.menuBar()->geometry().bottomLeft() + QPoint(1,1)); + + QVERIFY(!menu.isVisible()); + QVERIFY(!menu2.isVisible()); + QVERIFY(!win.menuBar()->activeAction()); +} + #if defined(QT3_SUPPORT) void tst_QMenuBar::indexBasedInsertion_data() -- cgit v0.12 From 472ab7c60a6ede66565166fa21d6642a918f7403 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 18 Jun 2009 12:56:54 +0200 Subject: Cleanup. Reviewed-by: kh --- .../assistant/tools/assistant/bookmarkmanager.cpp | 200 ++++++++++----------- tools/assistant/tools/assistant/bookmarkmanager.h | 16 +- 2 files changed, 99 insertions(+), 117 deletions(-) diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index fbd9923..336c856 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, - const QString &url, QWidget *parent) + const QString &url, QWidget *parent) : QDialog(parent) , m_url(url) , m_title(title) @@ -95,21 +95,21 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(addAccepted())); connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addNewFolder())); connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); - connect(ui.bookmarkEdit, SIGNAL(textChanged(const QString&)), this, - SLOT(textChanged(const QString&))); + connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); - connect(bookmarkManager->treeBookmarkModel(), SIGNAL(itemChanged(QStandardItem*)), + connect(bookmarkManager->treeBookmarkModel(), + SIGNAL(itemChanged(QStandardItem*)), this, SLOT(itemChanged(QStandardItem*))); - connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(const QString&)), this, - SLOT(selectBookmarkFolder(const QString&))); + connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(QString)), this, + SLOT(selectBookmarkFolder(QString))); - connect(ui.treeView, SIGNAL(customContextMenuRequested(const QPoint&)), this, - SLOT(customContextMenuRequested(const QPoint&))); + connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); - connect(ui.treeView->selectionModel(), - SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), - this, SLOT(currentChanged(const QModelIndex&, const QModelIndex&))); + connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, + QModelIndex)), this, SLOT(currentChanged(QModelIndex))); } BookmarkDialog::~BookmarkDialog() @@ -118,8 +118,8 @@ BookmarkDialog::~BookmarkDialog() void BookmarkDialog::addAccepted() { - const QItemSelection selection = ui.treeView->selectionModel()->selection(); - const QModelIndexList list = selection.indexes(); + QItemSelectionModel *model = ui.treeView->selectionModel(); + const QModelIndexList &list = model->selection().indexes(); QModelIndex index; if (!list.isEmpty()) @@ -131,8 +131,8 @@ void BookmarkDialog::addAccepted() void BookmarkDialog::addNewFolder() { - const QItemSelection selection = ui.treeView->selectionModel()->selection(); - const QModelIndexList list = selection.indexes(); + QItemSelectionModel *model = ui.treeView->selectionModel(); + const QModelIndexList &list = model->selection().indexes(); QModelIndex index; if (!list.isEmpty()) @@ -143,13 +143,12 @@ void BookmarkDialog::addNewFolder() if (newFolder.isValid()) { ui.treeView->expand(index); const QModelIndex &index = proxyModel->mapFromSource(newFolder); - ui.treeView->selectionModel()->setCurrentIndex(index, - QItemSelectionModel::ClearAndSelect); + model->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); ui.bookmarkFolders->clear(); ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - const QString name = index.data().toString(); + const QString &name = index.data().toString(); ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); } ui.treeView->setFocus(); @@ -183,14 +182,14 @@ void BookmarkDialog::itemChanged(QStandardItem *item) ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); QString name = tr("Bookmarks"); - const QModelIndex& index = ui.treeView->currentIndex(); + const QModelIndex &index = ui.treeView->currentIndex(); if (index.isValid()) name = index.data().toString(); ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); } } -void BookmarkDialog::textChanged(const QString& string) +void BookmarkDialog::textChanged(const QString &string) { ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); } @@ -209,9 +208,12 @@ void BookmarkDialog::selectBookmarkFolder(const QString &folderName) QList list = model->findItems(folderName, Qt::MatchCaseSensitive | Qt::MatchRecursive, 0); if (!list.isEmpty()) { - QModelIndex index = model->indexFromItem(list.at(0)); - ui.treeView->selectionModel()->setCurrentIndex( - proxyModel->mapFromSource(index), QItemSelectionModel::ClearAndSelect); + const QModelIndex &index = model->indexFromItem(list.at(0)); + QItemSelectionModel *model = ui.treeView->selectionModel(); + if (model) { + model->setCurrentIndex(proxyModel->mapFromSource(index), + QItemSelectionModel::ClearAndSelect); + } } } @@ -226,13 +228,13 @@ void BookmarkDialog::customContextMenuRequested(const QPoint &point) QAction *removeItem = menu.addAction(tr("Delete Folder")); QAction *renameItem = menu.addAction(tr("Rename Folder")); - QAction *picked_action = menu.exec(ui.treeView->mapToGlobal(point)); - if (!picked_action) + QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); + if (!picked) return; - if (picked_action == removeItem) { - bookmarkManager->removeBookmarkItem(ui.treeView, - proxyModel->mapToSource(index)); + const QModelIndex &proxyIndex = proxyModel->mapToSource(index); + if (picked == removeItem) { + bookmarkManager->removeBookmarkItem(ui.treeView, proxyIndex); ui.bookmarkFolders->clear(); ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); @@ -242,10 +244,9 @@ void BookmarkDialog::customContextMenuRequested(const QPoint &point) name = index.data().toString(); ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); } - else if (picked_action == renameItem) { - QStandardItem *item = bookmarkManager->treeBookmarkModel()-> - itemFromIndex(proxyModel->mapToSource(index)); - if (item) { + else if (picked == renameItem) { + BookmarkModel *model = bookmarkManager->treeBookmarkModel(); + if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { item->setEditable(true); ui.treeView->edit(index); item->setEditable(false); @@ -253,19 +254,12 @@ void BookmarkDialog::customContextMenuRequested(const QPoint &point) } } -void BookmarkDialog::currentChanged(const QModelIndex& current, - const QModelIndex& previous) +void BookmarkDialog::currentChanged(const QModelIndex ¤t) { - Q_UNUSED(previous) - - if (!current.isValid()) { - ui.bookmarkFolders->setCurrentIndex( - ui.bookmarkFolders->findText(tr("Bookmarks"))); - return; - } - - ui.bookmarkFolders->setCurrentIndex( - ui.bookmarkFolders->findText(current.data().toString())); + QString text = tr("Bookmarks"); + if (current.isValid()) + text = current.data().toString(); + ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(text)); } bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) @@ -276,7 +270,7 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) QModelIndex index = ui.treeView->currentIndex(); switch (ke->key()) { case Qt::Key_F2: { - const QModelIndex& source = proxyModel->mapToSource(index); + const QModelIndex &source = proxyModel->mapToSource(index); QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source); if (item) { @@ -307,10 +301,11 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) } +// #pragma mark -- BookmarkWidget BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, - bool showButtons) + bool showButtons) : QWidget(parent) , addButton(0) , removeButton(0) @@ -326,7 +321,7 @@ BookmarkWidget::~BookmarkWidget() void BookmarkWidget::removeClicked() { - const QModelIndex& index = treeView->currentIndex(); + const QModelIndex &index = treeView->currentIndex(); if (searchField->text().isEmpty()) { bookmarkManager->removeBookmarkItem(treeView, filterBookmarkModel->mapToSource(index)); @@ -360,10 +355,11 @@ void BookmarkWidget::filterChanged() expandItems(); } -void BookmarkWidget::expand(const QModelIndex& index) +void BookmarkWidget::expand(const QModelIndex &index) { - const QModelIndex& source = filterBookmarkModel->mapToSource(index); - QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source); + const QModelIndex &source = filterBookmarkModel->mapToSource(index); + QStandardItem *item = + bookmarkManager->treeBookmarkModel()->itemFromIndex(source); if (item) item->setData(treeView->isExpanded(index), Qt::UserRole + 11); } @@ -404,22 +400,22 @@ void BookmarkWidget::customContextMenuRequested(const QPoint &point) } } - QAction *picked_action = menu.exec(treeView->mapToGlobal(point)); - if (!picked_action) + QAction *pickedAction = menu.exec(treeView->mapToGlobal(point)); + if (!pickedAction) return; - if (picked_action == showItem) { + if (pickedAction == showItem) { emit requestShowLink(data); } - else if (picked_action == showItemNewTab) { + else if (pickedAction == showItemNewTab) { CentralWidget::instance()->setSourceInNewTab(data); } - else if (picked_action == removeItem) { + else if (pickedAction == removeItem) { bookmarkManager->removeBookmarkItem(treeView, filterBookmarkModel->mapToSource(index)); } - else if (picked_action == renameItem) { - const QModelIndex& source = filterBookmarkModel->mapToSource(index); + else if (pickedAction == renameItem) { + const QModelIndex &source = filterBookmarkModel->mapToSource(index); QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source); if (item) { @@ -443,7 +439,7 @@ void BookmarkWidget::setup(bool showButtons) searchField = new QLineEdit(this); vlayout->addWidget(searchField); - connect(searchField, SIGNAL(textChanged(const QString &)), this, + connect(searchField, SIGNAL(textChanged(QString)), this, SLOT(filterChanged())); treeView = new TreeView(this); @@ -490,17 +486,14 @@ void BookmarkWidget::setup(bool showButtons) treeView->viewport()->installEventFilter(this); treeView->setContextMenuPolicy(Qt::CustomContextMenu); - connect(treeView, SIGNAL(expanded(const QModelIndex&)), this, - SLOT(expand(const QModelIndex&))); - - connect(treeView, SIGNAL(collapsed(const QModelIndex&)), this, - SLOT(expand(const QModelIndex&))); - - connect(treeView, SIGNAL(activated(const QModelIndex&)), this, - SLOT(activated(const QModelIndex&))); - - connect(treeView, SIGNAL(customContextMenuRequested(const QPoint&)), - this, SLOT(customContextMenuRequested(const QPoint&))); + connect(treeView, SIGNAL(expanded(QModelIndex)), this, + SLOT(expand(QModelIndex))); + connect(treeView, SIGNAL(collapsed(QModelIndex)), this, + SLOT(expand(QModelIndex))); + connect(treeView, SIGNAL(activated(QModelIndex)), this, + SLOT(activated(QModelIndex))); + connect(treeView, SIGNAL(customContextMenuRequested(QPoint)), + this, SLOT(customContextMenuRequested(QPoint))); filterBookmarkModel->setFilterKeyColumn(0); filterBookmarkModel->setDynamicSortFilter(true); @@ -514,8 +507,8 @@ void BookmarkWidget::expandItems() QStandardItemModel *model = bookmarkManager->treeBookmarkModel(); QListlist = model->findItems(QLatin1String("*"), Qt::MatchWildcard | Qt::MatchRecursive, 0); - foreach (const QStandardItem* item, list) { - const QModelIndex& index = model->indexFromItem(item); + foreach (const QStandardItem *item, list) { + const QModelIndex &index = model->indexFromItem(item); treeView->setExpanded(filterBookmarkModel->mapFromSource(index), item->data(Qt::UserRole + 11).toBool()); } @@ -541,17 +534,17 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) if (e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast(e); if (index.isValid() && searchField->text().isEmpty()) { + const QModelIndex &src = filterBookmarkModel->mapToSource(index); if (ke->key() == Qt::Key_F2) { - QStandardItem *item = bookmarkManager->treeBookmarkModel() - ->itemFromIndex(filterBookmarkModel->mapToSource(index)); + QStandardItem *item = + bookmarkManager->treeBookmarkModel()->itemFromIndex(src); if (item) { item->setEditable(true); treeView->edit(index); item->setEditable(false); } } else if (ke->key() == Qt::Key_Delete) { - bookmarkManager->removeBookmarkItem(treeView, - filterBookmarkModel->mapToSource(index)); + bookmarkManager->removeBookmarkItem(treeView, src); } } @@ -559,7 +552,7 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) default: break; case Qt::Key_Up: { case Qt::Key_Down: - treeView->subclassKeyPressEvent(ke); + treeView->subclassKeyPressEvent(ke); } break; case Qt::Key_Enter: { @@ -593,9 +586,10 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) } +// #pragma mark -- BookmarkModel -BookmarkModel::BookmarkModel(int rows, int columns, QObject * parent) +BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent) : QStandardItemModel(rows, columns, parent) { } @@ -619,16 +613,15 @@ Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const } +// #pragma mark -- BookmarkManager -BookmarkManager::BookmarkManager(QHelpEngineCore* _helpEngine) +BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine) : treeModel(new BookmarkModel(0, 1, this)) , listModel(new BookmarkModel(0, 1, this)) , helpEngine(_helpEngine) { folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); - treeModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Bookmark")); - listModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Bookmark")); connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(itemChanged(QStandardItem*))); @@ -652,22 +645,10 @@ BookmarkModel* BookmarkManager::listBookmarkModel() void BookmarkManager::saveBookmarks() { - qint32 depth = 0; QByteArray bookmarks; QDataStream stream(&bookmarks, QIODevice::WriteOnly); - QStandardItem *root = treeModel->invisibleRootItem(); - - for (int i = 0; i < root->rowCount(); ++i) { - const QStandardItem *item = root->child(i); - stream << depth; // root - stream << item->data(Qt::DisplayRole).toString(); - stream << item->data(Qt::UserRole + 10).toString(); - stream << item->data(Qt::UserRole + 11).toBool(); - if (item->rowCount() > 0) { - readBookmarksRecursive(item, stream, (depth +1)); - } - } + readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks); } @@ -687,7 +668,7 @@ QStringList BookmarkManager::bookmarkFolders() const return folders; } -QModelIndex BookmarkManager::addNewFolder(const QModelIndex& index) +QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index) { QStandardItem *item = new QStandardItem(uniqueFolderName()); item->setEditable(false); @@ -703,16 +684,17 @@ QModelIndex BookmarkManager::addNewFolder(const QModelIndex& index) return treeModel->indexFromItem(item); } -void BookmarkManager::removeBookmarkItem(QTreeView *treeView, const QModelIndex& index) +void BookmarkManager::removeBookmarkItem(QTreeView *treeView, + const QModelIndex &index) { QStandardItem *item = treeModel->itemFromIndex(index); if (item) { QString data = index.data(Qt::UserRole + 10).toString(); if (data == QLatin1String("Folder") && item->rowCount() > 0) { int value = QMessageBox::question(treeView, tr("Remove"), - tr("You are going to delete a Folder, this will also
" - "remove it's content. Are you sure to continue?"), - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); + tr("You are going to delete a Folder, this will also
" + "remove it's content. Are you sure to continue?"), + QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); if (value == QMessageBox::Cancel) return; @@ -733,28 +715,26 @@ void BookmarkManager::removeBookmarkItem(QTreeView *treeView, const QModelIndex& } } -void BookmarkManager::showBookmarkDialog(QWidget* parent, const QString &name, - const QString &url) +void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name, + const QString &url) { BookmarkDialog dialog(this, name, url, parent); dialog.exec(); } -void BookmarkManager::addNewBookmark(const QModelIndex& index, - const QString &name, const QString &url) +void BookmarkManager::addNewBookmark(const QModelIndex &index, + const QString &name, const QString &url) { QStandardItem *item = new QStandardItem(name); item->setEditable(false); item->setData(false, Qt::UserRole + 11); item->setData(url, Qt::UserRole + 10); - if (index.isValid()) { + if (index.isValid()) treeModel->itemFromIndex(index)->appendRow(item); - listModel->appendRow(item->clone()); - } else { + else treeModel->appendRow(item); - listModel->appendRow(item->clone()); - } + listModel->appendRow(item->clone()); } void BookmarkManager::itemChanged(QStandardItem *item) @@ -785,7 +765,8 @@ void BookmarkManager::setupBookmarkModels() QList lastDepths; QList parents; - QByteArray ba = helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray(); + QByteArray ba = + helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray(); QDataStream stream(ba); while (!stream.atEnd()) { stream >> depth >> name >> type >> expanded; @@ -855,8 +836,7 @@ void BookmarkManager::removeBookmarkFolderItems(QStandardItem *item) } void BookmarkManager::readBookmarksRecursive(const QStandardItem *item, - QDataStream &stream, - const qint32 depth) const + QDataStream &stream, const qint32 depth) const { for (int j = 0; j < item->rowCount(); ++j) { const QStandardItem *child = item->child(j); diff --git a/tools/assistant/tools/assistant/bookmarkmanager.h b/tools/assistant/tools/assistant/bookmarkmanager.h index 29da5f3..bf7af41 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.h +++ b/tools/assistant/tools/assistant/bookmarkmanager.h @@ -74,7 +74,7 @@ class BookmarkDialog : public QDialog Q_OBJECT public: - BookmarkDialog(BookmarkManager *manager, const QString &title, + BookmarkDialog(BookmarkManager *manager, const QString &title, const QString &url, QWidget *parent = 0); ~BookmarkDialog(); @@ -86,8 +86,8 @@ private slots: void textChanged(const QString& string); void selectBookmarkFolder(const QString &folderName); void customContextMenuRequested(const QPoint &point); - void currentChanged(const QModelIndex& current, const QModelIndex& previous); - + void currentChanged(const QModelIndex& current); + private: bool eventFilter(QObject *object, QEvent *e); @@ -177,14 +177,16 @@ public: QStringList bookmarkFolders() const; QModelIndex addNewFolder(const QModelIndex& index); void removeBookmarkItem(QTreeView *treeView, const QModelIndex& index); - void showBookmarkDialog(QWidget* parent, const QString &name, const QString &url); - void addNewBookmark(const QModelIndex& index, const QString &name, const QString &url); + void showBookmarkDialog(QWidget* parent, const QString &name, + const QString &url); + void addNewBookmark(const QModelIndex& index, const QString &name, + const QString &url); void setupBookmarkModels(); private slots: void itemChanged(QStandardItem *item); -private: +private: QString uniqueFolderName() const; void removeBookmarkFolderItems(QStandardItem *item); void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream, @@ -193,7 +195,7 @@ private: private: QString oldText; QIcon folderIcon; - + BookmarkModel *treeModel; BookmarkModel *listModel; QStandardItem *renameItem; -- cgit v0.12 From 88130cb56b0b1b7332430d6045946635ca1c8c75 Mon Sep 17 00:00:00 2001 From: kh Date: Thu, 18 Jun 2009 13:15:41 +0200 Subject: Make it possible to drag bookmarks to the root item. Reviewed-by: kh --- tools/assistant/tools/assistant/bookmarkmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 336c856..3bca573 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -606,7 +606,8 @@ Qt::DropActions BookmarkModel::supportedDropActions() const Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const { Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); - if (index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) + if ((!index.isValid()) // can only happen for the invisible root item + || index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) return (Qt::ItemIsDropEnabled | defaultFlags) &~ Qt::ItemIsDragEnabled; return (Qt::ItemIsDragEnabled | defaultFlags) &~ Qt::ItemIsDropEnabled; -- cgit v0.12 From b11eb293ca873691e4a84afdf4e89ecf16ed03b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 18 Jun 2009 11:54:23 +0200 Subject: Added save state detection in OpenGL engine to avoid dirtying state. When setState() is called right after createState() it means that none of the OpenGL state needs changing, so we can simply return. Task-number: 254658 Reviewed-by: Trond --- src/opengl/qpaintengine_opengl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 84ad4d5..044090b 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -662,6 +662,7 @@ public: , txop(QTransform::TxNone) , inverseScale(1) , moveToCount(0) + , last_created_state(0) , shader_ctx(0) , grad_palette(0) , drawable_texture(0) @@ -788,6 +789,8 @@ public: void updateGLMatrix() const; + mutable QPainterState *last_created_state; + QGLContext *shader_ctx; GLuint grad_palette; @@ -5502,6 +5505,13 @@ void QOpenGLPaintEngine::setState(QPainterState *s) { Q_D(QOpenGLPaintEngine); QPaintEngineEx::setState(s); + + // are we in a save() ? + if (s == d->last_created_state) { + d->last_created_state = 0; + return; + } + if (isActive()) { d->updateDepthClip(); penChanged(); @@ -5515,12 +5525,15 @@ void QOpenGLPaintEngine::setState(QPainterState *s) QPainterState *QOpenGLPaintEngine::createState(QPainterState *orig) const { + const Q_D(QOpenGLPaintEngine); + QOpenGLPaintEngineState *s; if (!orig) s = new QOpenGLPaintEngineState(); else s = new QOpenGLPaintEngineState(*static_cast(orig)); + d->last_created_state = s; return s; } -- cgit v0.12 From c23d4d6644bff2195fbb6aa84d3425dc2d31491a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 18 Jun 2009 12:10:12 +0200 Subject: Prevented unnecessary depth clip updates in OpenGL paint engine. Keep track of whether the depth clip has actually changed between states, so that when QPainter::restore() is called we don't call the potentially expensive updateDepthClip() function when not needed. Task-number: 254658 Reviewed-by: Trond --- src/opengl/qpaintengine_opengl.cpp | 10 +++++++++- src/opengl/qpaintengine_opengl_p.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 044090b..b594f5b 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -2222,6 +2222,8 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() { Q_Q(QOpenGLPaintEngine); + ++q->state()->depthClipId; + glDisable(GL_DEPTH_TEST); glDisable(GL_SCISSOR_TEST); @@ -5504,6 +5506,9 @@ void QOpenGLPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) void QOpenGLPaintEngine::setState(QPainterState *s) { Q_D(QOpenGLPaintEngine); + QOpenGLPaintEngineState *new_state = static_cast(s); + QOpenGLPaintEngineState *old_state = state(); + QPaintEngineEx::setState(s); // are we in a save() ? @@ -5513,7 +5518,8 @@ void QOpenGLPaintEngine::setState(QPainterState *s) } if (isActive()) { - d->updateDepthClip(); + if (old_state->depthClipId != new_state->depthClipId) + d->updateDepthClip(); penChanged(); brushChanged(); opacityChanged(); @@ -5547,11 +5553,13 @@ QOpenGLPaintEngineState::QOpenGLPaintEngineState(QOpenGLPaintEngineState &other) clipRegion = other.clipRegion; hasClipping = other.hasClipping; fastClip = other.fastClip; + depthClipId = other.depthClipId; } QOpenGLPaintEngineState::QOpenGLPaintEngineState() { hasClipping = false; + depthClipId = 0; } QOpenGLPaintEngineState::~QOpenGLPaintEngineState() diff --git a/src/opengl/qpaintengine_opengl_p.h b/src/opengl/qpaintengine_opengl_p.h index 891cbd6..439782b 100644 --- a/src/opengl/qpaintengine_opengl_p.h +++ b/src/opengl/qpaintengine_opengl_p.h @@ -69,6 +69,7 @@ public: QRegion clipRegion; bool hasClipping; QRect fastClip; + uint depthClipId; }; class QOpenGLPaintEngine : public QPaintEngineEx -- cgit v0.12 From 747c7a9a060267dee9622c96bf0e2a54147dacfa Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 18 Jun 2009 13:38:10 +0200 Subject: QItemEditorFactory: made sure the ownership is taken on the QItemEditorCreator The creators were not deleted i nthe destructor of QItemEditorFactory and they could not be safely used for more than one type. Task-number: 228255 Reviewed-by: jasplin --- src/gui/itemviews/qitemeditorfactory.cpp | 16 +++++++-- .../qitemeditorfactory/tst_qitemeditorfactory.cpp | 38 ++++++++++++++++++---- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/gui/itemviews/qitemeditorfactory.cpp b/src/gui/itemviews/qitemeditorfactory.cpp index c576e40..480a472 100644 --- a/src/gui/itemviews/qitemeditorfactory.cpp +++ b/src/gui/itemviews/qitemeditorfactory.cpp @@ -158,6 +158,10 @@ QByteArray QItemEditorFactory::valuePropertyName(QVariant::Type type) const */ QItemEditorFactory::~QItemEditorFactory() { + //we make sure we delete all the QItemEditorCreatorBase + //this has to be done only once, hence the QSet + QSet set = creatorMap.values().toSet(); + qDeleteAll(set); } /*! @@ -170,8 +174,16 @@ QItemEditorFactory::~QItemEditorFactory() */ void QItemEditorFactory::registerEditor(QVariant::Type type, QItemEditorCreatorBase *creator) { - delete creatorMap.value(type, 0); - creatorMap[type] = creator; + QHash::iterator it = creatorMap.find(type); + if (it != creatorMap.end()) { + QItemEditorCreatorBase *oldCreator = it.value(); + Q_ASSERT(oldCreator); + creatorMap.erase(it); + if (!creatorMap.values().contains(oldCreator)) + delete oldCreator; // if it is no more in use we can delete it + } + + creatorMap[type] = creator; } class QDefaultItemEditorFactory : public QItemEditorFactory diff --git a/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp b/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp index 5540b38..d9a7d56 100644 --- a/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp +++ b/tests/auto/qitemeditorfactory/tst_qitemeditorfactory.cpp @@ -61,16 +61,40 @@ void tst_QItemEditorFactory::createEditor() void tst_QItemEditorFactory::createCustomEditor() { - QItemEditorFactory editorFactory; + //we make it inherit from QObject so that we can use QPointer + class MyEditor : public QObject, public QStandardItemEditorCreator + { + }; - QItemEditorCreatorBase *creator = new QStandardItemEditorCreator(); - editorFactory.registerEditor(QVariant::Rect, creator); + QPointer creator = new MyEditor; + QPointer creator2 = new MyEditor; - QWidget parent; + { + QItemEditorFactory editorFactory; + + editorFactory.registerEditor(QVariant::Rect, creator); + editorFactory.registerEditor(QVariant::RectF, creator); + + //creator should not be deleted as a result of calling the next line + editorFactory.registerEditor(QVariant::Rect, creator2); + QVERIFY(creator); + + //this should erase creator2 + editorFactory.registerEditor(QVariant::Rect, creator); + QVERIFY(creator2.isNull()); + + + QWidget parent; + + QWidget *w = editorFactory.createEditor(QVariant::Rect, &parent); + QCOMPARE(w->metaObject()->className(), "QDoubleSpinBox"); + QCOMPARE(w->metaObject()->userProperty().type(), QVariant::Double); + } - QWidget *w = editorFactory.createEditor(QVariant::Rect, &parent); - QCOMPARE(w->metaObject()->className(), "QDoubleSpinBox"); - QCOMPARE(w->metaObject()->userProperty().type(), QVariant::Double); + //editorFactory has been deleted, so should be creator + //because editorFActory has the ownership + QVERIFY(creator.isNull()); + QVERIFY(creator2.isNull()); delete creator; } -- cgit v0.12 From 2114754f8f86e0b653b6057d9b46a30f97d51aef Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 18 Jun 2009 14:04:19 +0200 Subject: Doc: Added snippet files for state machine overview. Reviewed-by: Trust Me --- doc/src/snippets/statemachine/main.cpp | 48 +++++++++++++++ doc/src/snippets/statemachine/main2.cpp | 51 ++++++++++++++++ doc/src/snippets/statemachine/main3.cpp | 21 +++++++ doc/src/snippets/statemachine/main4.cpp | 71 ++++++++++++++++++++++ doc/src/snippets/statemachine/main5.cpp | 103 ++++++++++++++++++++++++++++++++ 5 files changed, 294 insertions(+) create mode 100644 doc/src/snippets/statemachine/main.cpp create mode 100644 doc/src/snippets/statemachine/main2.cpp create mode 100644 doc/src/snippets/statemachine/main3.cpp create mode 100644 doc/src/snippets/statemachine/main4.cpp create mode 100644 doc/src/snippets/statemachine/main5.cpp diff --git a/doc/src/snippets/statemachine/main.cpp b/doc/src/snippets/statemachine/main.cpp new file mode 100644 index 0000000..f20d245 --- /dev/null +++ b/doc/src/snippets/statemachine/main.cpp @@ -0,0 +1,48 @@ + +#include + +int main(int argv, char **args) +{ + QApplication app(argv, args); + + QLabel *label = new QLabel; + +//![0] + QStateMachine machine; + QState *s1 = new QState(); + QState *s2 = new QState(); + QState *s3 = new QState(); +//![0] + +//![4] + s1->assignProperty(label, "text", "In state s1"); + s2->assignProperty(label, "text", "In state s2"); + s3->assignProperty(label, "text", "In state s3"); +//![4] + +//![5] + QObject::connect(s3, SIGNAL(entered()), button, SLOT(showMaximized())); + QObject::connect(s3, SIGNAL(exited()), button, SLOT(showMinimized())); +//![5] + +//![1] + s1->addTransition(button, SIGNAL(clicked()), s2); + s2->addTransition(button, SIGNAL(clicked()), s3); + s3->addTransition(button, SIGNAL(clicked()), s1); +//![1] + +//![2] + machine.addState(s1); + machine.addState(s2); + machine.addState(s3); + machine.setInitialState(s1); +//![2] + +//![3] + machine.start(); +//![3] + + label->show(); + + return app.exec(); +} diff --git a/doc/src/snippets/statemachine/main2.cpp b/doc/src/snippets/statemachine/main2.cpp new file mode 100644 index 0000000..60a61e7 --- /dev/null +++ b/doc/src/snippets/statemachine/main2.cpp @@ -0,0 +1,51 @@ + +#include + +int main(int argv, char **args) +{ + QApplication app(argv, args); + + QStateMachine machine; + +//![0] + QState *s1 = new QState(); + QState *s11 = new QState(s1); + QState *s12 = new QState(s1); + QState *s13 = new QState(s1); + s1->setInitialState(s11); + machine.addState(s1); +//![0] + +//![2] + s12>addTransition(quitButton, SIGNAL(clicked()), s12); +//![2] + +//![1] + QFinalState *s2 = new QFinalState(); + s1->addTransition(quitButton, SIGNAL(clicked()), s2); + machine.addState(s2); + + QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit())); +//![1] + + QButton *interruptButton = new QPushButton("Interrupt Button"); + +//![3] + QHistoryState *s1h = s1->addHistoryState(); + + QState *s3 = new QState(); + s3->assignProperty(label, "text", "In s3"); + QMessageBox mbox; + mbox.addButton(QMessageBox::Ok); + mbox.setText("Interrupted!"); + mbox.setIcon(QMessageBox::Information); + QObject::connect(s3, SIGNAL(entered()), &mbox, SLOT(exec())); + s3->addTransition(s1h); + machine.addState(s3); + + s1->addTransition(interruptButton, SIGNAL(clicked()), s3); +//![3] + + return app.exec(); +} + diff --git a/doc/src/snippets/statemachine/main3.cpp b/doc/src/snippets/statemachine/main3.cpp new file mode 100644 index 0000000..b04b850 --- /dev/null +++ b/doc/src/snippets/statemachine/main3.cpp @@ -0,0 +1,21 @@ + +#include + +int main(int argv, char **args) +{ + QApplication app(argv, args); + +//![0] + QState *s1 = new QState(QState::ParallelStates); + // s11 and s12 will be entered in parallel + QState *s11 = new QState(s1); + QState *s12 = new QState(s1); +//![0] + +//![1] + s1->addTransition(s1, SIGNAL(finished()), s2); +//![1] + + return app.exec(); +} + diff --git a/doc/src/snippets/statemachine/main4.cpp b/doc/src/snippets/statemachine/main4.cpp new file mode 100644 index 0000000..5681bbd --- /dev/null +++ b/doc/src/snippets/statemachine/main4.cpp @@ -0,0 +1,71 @@ + +#include + + +//![0] +struct StringEvent : public QEvent +{ + StringEvent(const QString &val) + : QEvent(QEvent::Type(QEvent::User+1)), + value(val) {} + + QString value; +}; +//![0] + +//![1] +class StringTransition : public QAbstractTransition +{ +public: + StringTransition(const QString &value) + : m_value(value) {} + +protected: + virtual bool eventTest(QEvent *e) const + { + if (e->type() != QEvent::Type(QEvent::User+1)) // StringEvent + return false; + StringEvent *se = static_cast(e); + return (m_value == se->value); + } + + virtual void onTransition(QEvent *) {} + +private: + QString m_value; +}; +//![1] + +int main(int argv, char **args) +{ + QApplication app(argv, args); + +//![2] + QStateMachine machine; + QState *s1 = new QState(); + QState *s2 = new QState(); + QFinalState *done = new QFinalState(); + + StringTransition *t1 = new StringTransition("Hello"); + t1->setTargetState(s2); + s1->addTransition(t1); + StringTransition *t2 = new StringTransition("world"); + t2->setTargetState(done); + s2->addTransition(t2); + + machine.addState(s1); + machine.addState(s2); + machine.addState(done); + machine.setInitialState(s1); +//![2] + +//![3] + machine.postEvent(new StringEvent("Hello")); + machine.postEvent(new StringEvent("world")); +//![3] + + return app.exec(); +} + +#include "main4.moc" + diff --git a/doc/src/snippets/statemachine/main5.cpp b/doc/src/snippets/statemachine/main5.cpp new file mode 100644 index 0000000..90ad8c7 --- /dev/null +++ b/doc/src/snippets/statemachine/main5.cpp @@ -0,0 +1,103 @@ + +#include + +int main(int argv, char **args) +{ + QApplication app(argv, args); + + { +//![0] + QStateMachine machine; + machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); +//![0] + +//![1] + QState *s1 = new QState(); + s1->assignProperty(object, "fooBar", 1.0); + machine.addState(s1); + machine.setInitialState(s1); + + QState *s2 = new QState(); + machine.addState(s2); +//![1] + } + + { + +//![2] + QStateMachine machine; + machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); + + QState *s1 = new QState(); + s1->assignProperty(object, "fooBar", 1.0); + machine.addState(s1); + machine.setInitialState(s1); + + QState *s2 = new QState(s1); + s2->assignProperty(object, "fooBar", 2.0); + s1->setInitialState(s2); + + QState *s3 = new QState(s1); +//![2] + + } + + { +//![3] + QState *s1 = new QState(); + QState *s2 = new QState(); + + s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); + s2->assignProperty(button, "geometry", QRectF(0, 0, 100, 100)); + + s1->addTransition(button, SIGNAL(clicked()), s2); +//![3] + + } + + { +//![4] + QState *s1 = new QState(); + QState *s2 = new QState(); + + s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); + s2->assignProperty(button, "geometry", QRectF(0, 0, 100, 100)); + + QSignalTransition *transition = s1->addTransition(button, SIGNAL(clicked()), s2); + transition->addAnimation(new QPropertyAnimation(button, "geometry")); +//![4] + + } + + { + +//![5] + QState *s1 = new QState(); + s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); + + QState *s2 = new QState(); + + s1->addTransition(s1, SIGNAL(polished()), s2); +//![5] + + } + + { + +//![6] + QState *s1 = new QState(); + QState *s2 = new QState(); + + s2->assignProperty(object, "fooBar", 2.0); + s1->addTransition(s2); + + QStateMachine machine; + machine.setInitialState(s1); + machine.addDefaultAnimation(new QPropertyAnimation(object, "fooBar")); +//![6] + + } + + return app.exec(); +} + -- cgit v0.12 From 2b32e8a7504a98950b486df6ee6f2f126c162e6c Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 18 Jun 2009 14:11:26 +0200 Subject: Demo: fixed colors in the calendar when May 1st is a Friday Task-number: 255114 --- examples/widgets/calendarwidget/window.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/widgets/calendarwidget/window.cpp b/examples/widgets/calendarwidget/window.cpp index 7672a05..c31ea0c 100644 --- a/examples/widgets/calendarwidget/window.cpp +++ b/examples/widgets/calendarwidget/window.cpp @@ -167,22 +167,22 @@ void Window::reformatHeaders() //! [8] void Window::reformatCalendarPage() { - QTextCharFormat mayFirstFormat; - if (mayFirstCheckBox->isChecked()) - mayFirstFormat.setForeground(Qt::red); - - QTextCharFormat firstFridayFormat; - if (firstFridayCheckBox->isChecked()) + if (firstFridayCheckBox->isChecked()) { + QDate firstFriday(calendar->yearShown(), calendar->monthShown(), 1); + while (firstFriday.dayOfWeek() != Qt::Friday) + firstFriday = firstFriday.addDays(1); + QTextCharFormat firstFridayFormat; firstFridayFormat.setForeground(Qt::blue); + calendar->setDateTextFormat(firstFriday, firstFridayFormat); + } - QDate date(calendar->yearShown(), calendar->monthShown(), 1); - - calendar->setDateTextFormat(QDate(date.year(), 5, 1), mayFirstFormat); - - date.setDate(date.year(), date.month(), 1); - while (date.dayOfWeek() != Qt::Friday) - date = date.addDays(1); - calendar->setDateTextFormat(date, firstFridayFormat); + //May First in Red takes precedence + if (mayFirstCheckBox->isChecked()) { + const QDate mayFirst(calendar->yearShown(), 5, 1); + QTextCharFormat mayFirstFormat; + mayFirstFormat.setForeground(Qt::red); + calendar->setDateTextFormat(mayFirst, mayFirstFormat); + } } //! [8] -- cgit v0.12 From b7280820144b3cf1bbd49a26f5e532bb9b7f388d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Thu, 18 Jun 2009 14:24:22 +0200 Subject: On Mac OS X 10.4, dsable a couple of accessibility tests that hang. Ideally these should be investigated at some point. For now disable them so that the test can be completed. --- .../auto/qaccessibility_mac/tst_qaccessibility_mac.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/auto/qaccessibility_mac/tst_qaccessibility_mac.cpp b/tests/auto/qaccessibility_mac/tst_qaccessibility_mac.cpp index b81fa12..deb6c8d 100644 --- a/tests/auto/qaccessibility_mac/tst_qaccessibility_mac.cpp +++ b/tests/auto/qaccessibility_mac/tst_qaccessibility_mac.cpp @@ -833,9 +833,14 @@ void tst_accessibility_mac::testTabWidget() // Window is not reported properly on 10.5 if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5) { QVERIFY(equal(window(tabGroup), form)); - QVERIFY(equal(window(tabButton1), form)); + + // ### hangs on 10.4 +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + QVERIFY(equal(window(tabButton1), form)); +#endif } -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) +// ### hangs on 10.4 +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) QVERIFY(equal(topLevelUIElement(tabGroup), form)); QVERIFY(equal(topLevelUIElement(tabButton1), form)); #endif @@ -1423,7 +1428,6 @@ void tst_accessibility_mac::testListView() const AXUIElementRef listElement = childByRole(scrollAreaElement, "AXList"); QVERIFY(listElement); QVERIFY(equal(::parent(listElement), scrollAreaElement)); - // Window is not reported properly on 10.5 if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5) QVERIFY(equal(::window(listElement), windowElement)); @@ -1438,9 +1442,11 @@ void tst_accessibility_mac::testListView() QVERIFY(value(A) == "A"); QVERIFY(equal(::parent(A), listElement)); QVERIFY(enabled(A)); - // Window is not reported properly on 10.5 - if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5) - QVERIFY(equal(::window(A), windowElement)); + + // Window is not reported properly on 10.5, this test + // hangs on 10.4. Disable it for now. + // if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5) + // QVERIFY(equal(::window(A), windowElement)); QVERIFY(above(A, B)); QVERIFY(!above(B, A)); -- cgit v0.12 From cc4935dc0641336813925b3892ffd6695d709d19 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 18 Jun 2009 14:28:25 +0200 Subject: qdoc: Fixed crash when a compact list section was empty. --- tools/qdoc3/htmlgenerator.cpp | 51 +++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index c14b46d..8ef4f0b 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1850,8 +1850,10 @@ HtmlGenerator::generateAnnotatedList(const Node *relative, out() << "

\n"; } -void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker, - const QMap &classMap) +void +HtmlGenerator::generateCompactList(const Node *relative, + CodeMarker *marker, + const QMap &classMap) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' const int NumColumns = 4; // number of columns in the result @@ -1994,28 +1996,29 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker << " "; } out() << "\n"; - - // bad loop - QMap::Iterator it; - it = paragraph[currentParagraphNo[i]].begin(); - for (j = 0; j < currentOffsetInParagraph[i]; j++) - ++it; - - out() << ""; - // Previously, we used generateFullName() for this, but we - // require some special formatting. - out() << ""; - QStringList pieces = fullName(it.value(), relative, marker).split("::"); - out() << protect(pieces.last()); - out() << ""; - if (pieces.size() > 1) { - out() << " ("; - generateFullName(it.value()->parent(), relative, marker); - out() << ")"; - } - out() << "\n"; + + if (!paragraphName[currentParagraphNo[i]].isEmpty()) { + QMap::Iterator it; + it = paragraph[currentParagraphNo[i]].begin(); + for (j = 0; j < currentOffsetInParagraph[i]; j++) + ++it; + + out() << ""; + // Previously, we used generateFullName() for this, but we + // require some special formatting. + out() << ""; + QStringList pieces = fullName(it.value(), relative, marker).split("::"); + out() << protect(pieces.last()); + out() << ""; + if (pieces.size() > 1) { + out() << " ("; + generateFullName(it.value()->parent(), relative, marker); + out() << ")"; + } + out() << "\n"; + } currentOffset[i]++; currentOffsetInParagraph[i]++; -- cgit v0.12 From 450a9c97aba21db04df4af281312e4262529691a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 18 Jun 2009 13:28:01 +0200 Subject: Make construction of unitialized QTransform/QMatrix a no-op. These constructors are useful when you have to create a temporary uninitialized QTransform/QMatrix and later initialize it to something else. Done with Lars. Reviewed-by: samuel --- doc/src/qnamespace.qdoc | 6 ++++++ src/corelib/global/qnamespace.h | 4 ++++ src/gui/painting/qmatrix.cpp | 4 ++++ src/gui/painting/qmatrix.h | 1 + src/gui/painting/qtransform.cpp | 5 +++++ src/gui/painting/qtransform.h | 1 + 6 files changed, 21 insertions(+) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index d46236f..8a24764 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -2685,3 +2685,9 @@ \value Round Like Repeat, but scales the images down to ensure that the last image is not cropped. */ + +/*! + \enum Uninitialized + \internal +*/ + diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 46ac40b..398cd48 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1542,6 +1542,10 @@ public: BottomLeftSection, TitleBarArea // For move }; + + enum Uninitialized { + Uninitialized + }; } #ifdef Q_MOC_RUN ; diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index 7c50b80..62addd3 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -197,6 +197,10 @@ QT_BEGIN_NAMESPACE /***************************************************************************** QMatrix member functions *****************************************************************************/ +/*! + \fn QMatrix::QMatrix(Qt::Uninitialized) + \internal +*/ /*! Constructs an identity matrix. diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index e28c950..b2e5d70 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -61,6 +61,7 @@ class QVariant; class Q_GUI_EXPORT QMatrix // 2D transform matrix { public: + inline explicit QMatrix(enum Qt::Uninitialized) {} QMatrix(); QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy); diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 5b1ae07..85adb27 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -232,6 +232,11 @@ QT_BEGIN_NAMESPACE */ /*! + \fn QTransform::QTransform(Qt::Uninitialized) + \internal +*/ + +/*! Constructs an identity matrix. All elements are set to zero except \c m11 and \c m22 (specifying diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index bb04f7b..f99b0e7 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -71,6 +71,7 @@ public: TxProject = 0x10 }; + inline explicit QTransform(enum Qt::Uninitialized) : affine(Qt::Uninitialized) {} QTransform(); QTransform(qreal h11, qreal h12, qreal h13, qreal h21, qreal h22, qreal h23, -- cgit v0.12 From 45c1b4f3d48dd8f7c33b259b6f73cf628798a23d Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 18 Jun 2009 15:16:17 +0200 Subject: QFontDialog: fixed the current font not being updated This could happen when the list of styles depending on the font is different from the font you selected before. It then is not updated and the style of the font returned by the QFontDialog is wrong. Task-number: 256466 --- src/gui/dialogs/qfontdialog.cpp | 11 ----------- tests/auto/qfontdialog/tst_qfontdialog.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index 582ba9b..e258cb5 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -501,8 +501,6 @@ void QFontDialogPrivate::updateFamilies() { Q_Q(QFontDialog); - familyList->blockSignals(true); - enum match_t { MATCH_NONE = 0, MATCH_LAST_RESORT = 1, MATCH_APP = 2, MATCH_FAMILY = 3 }; QStringList familyNames = fdb.families(writingSystem); @@ -556,7 +554,6 @@ void QFontDialogPrivate::updateFamilies() && familyList->hasFocus()) familyEdit->selectAll(); - familyList->blockSignals(false); updateStyles(); } @@ -567,9 +564,6 @@ void QFontDialogPrivate::updateFamilies() void QFontDialogPrivate::updateStyles() { Q_Q(QFontDialog); - - styleList->blockSignals(true); - QStringList styles = fdb.styles(familyList->currentText()); styleList->model()->setStringList(styles); @@ -613,8 +607,6 @@ void QFontDialogPrivate::updateStyles() smoothScalable = fdb.isSmoothlyScalable(familyList->currentText(), styleList->currentText()); } - styleList->blockSignals(false); - updateSizes(); } @@ -628,8 +620,6 @@ void QFontDialogPrivate::updateSizes() { Q_Q(QFontDialog); - sizeList->blockSignals(true); - if (!familyList->currentText().isEmpty()) { QList sizes = fdb.pointSizes(familyList->currentText(), styleList->currentText()); @@ -659,7 +649,6 @@ void QFontDialogPrivate::updateSizes() sizeEdit->clear(); } - sizeList->blockSignals(false); _q_updateSample(); } diff --git a/tests/auto/qfontdialog/tst_qfontdialog.cpp b/tests/auto/qfontdialog/tst_qfontdialog.cpp index c12c229..1444ee0 100644 --- a/tests/auto/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/qfontdialog/tst_qfontdialog.cpp @@ -47,7 +47,9 @@ #include #include #include +#include #include "qfontdialog.h" +#include //TESTED_CLASS= //TESTED_FILES= @@ -74,6 +76,7 @@ public slots: private slots: void defaultOkButton(); void setFont(); + void task256466_wrongStyle(); }; tst_QFontDialog::tst_QFontDialog() @@ -151,6 +154,29 @@ void tst_QFontDialog::setFont() } +class FriendlyFontDialog : public QFontDialog +{ + friend tst_QFontDialog; + Q_DECLARE_PRIVATE(QFontDialog); +}; + +void tst_QFontDialog::task256466_wrongStyle() +{ + QFontDatabase fdb; + FriendlyFontDialog dialog; + QListView *familyList = reinterpret_cast(dialog.d_func()->familyList); + QListView *styleList = reinterpret_cast(dialog.d_func()->styleList); + QListView *sizeList = reinterpret_cast(dialog.d_func()->sizeList); + for (int i = 0; i < familyList->model()->rowCount(); ++i) { + QModelIndex currentFamily = familyList->model()->index(i, 0); + familyList->setCurrentIndex(currentFamily); + QCOMPARE(dialog.currentFont(), fdb.font(currentFamily.data().toString(), + styleList->currentIndex().data().toString(), sizeList->currentIndex().data().toInt())); + } +} + + + QTEST_MAIN(tst_QFontDialog) #include "tst_qfontdialog.moc" -- cgit v0.12 From 8675a8915d09d0ca2091c606345a2d99f642949b Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 18 Jun 2009 15:33:14 +0200 Subject: QNAM HTTP code: Do not close TCP connection in all cases This makes sure the keep-alive connections stay open even if someone deletes a QNetworkReply which will then go all the way down to removeReply(QHttpNetworkReply). Should fix http://lists.trolltech.com/pipermail/qt-interest/2009-June/007777.html Reviewed-by: Peter Hartmann --- src/network/access/qhttpnetworkconnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index f698c71..4c08794 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -937,7 +937,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) for (int i = 0; i < channelCount; ++i) { if (channels[i].reply == reply) { channels[i].reply = 0; - closeChannel(i); + if (reply->d_func()->connectionCloseEnabled()) + closeChannel(i); QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); return; } -- cgit v0.12 From d7005487b789e2bc5a1400148b4f317142a381ac Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 18 Jun 2009 15:36:05 +0200 Subject: Use enum Qt::Uninitialized instead of struct QString::Uninitialized There is no BC issue as the changed constructor was introduced recently and there is no released version of Qt using it. Reviewed-by: mariusSO --- src/corelib/tools/qstring.cpp | 2 +- src/corelib/tools/qstring.h | 3 +-- src/corelib/tools/qstringbuilder.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3b70f44..083253f 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1019,7 +1019,7 @@ QString::QString(int size, QChar ch) \internal */ -QString::QString(int size, Uninitialized) +QString::QString(int size, enum Qt::Uninitialized) { d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar)); d->ref = 1; diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 4b2ceb7..67716b8 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -579,8 +579,7 @@ public: bool isSimpleText() const { if (!d->clean) updateProperties(); return d->simpletext; } bool isRightToLeft() const { if (!d->clean) updateProperties(); return d->righttoleft; } - struct Uninitialized {}; - QString(int size, Uninitialized); + QString(int size, enum Qt::Uninitialized); private: #if defined(QT_NO_CAST_FROM_ASCII) && !defined(Q_NO_DECLARED_NOT_DEFINED) diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 19f14b4..852c072 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -80,7 +80,7 @@ public: operator QString() const { QString s(QConcatenable< QStringBuilder >::size(*this), - QString::Uninitialized()); + Qt::Uninitialized); QChar *d = s.data(); QConcatenable< QStringBuilder >::appendTo(*this, d); -- cgit v0.12 From e356eed2fa3d8e62085d6bd72caba9d11c40bacf Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 18 Jun 2009 16:02:00 +0200 Subject: Don't initialize data that will be overwritten immediately. Reviewed-by: mariusSO --- src/corelib/codecs/qsimplecodec.cpp | 3 +-- src/corelib/codecs/qutfcodec.cpp | 3 +-- src/corelib/tools/qlocale.cpp | 6 ++---- src/corelib/tools/qstring.cpp | 18 ++++++------------ 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/corelib/codecs/qsimplecodec.cpp b/src/corelib/codecs/qsimplecodec.cpp index 7a62d4e..aa7521d 100644 --- a/src/corelib/codecs/qsimplecodec.cpp +++ b/src/corelib/codecs/qsimplecodec.cpp @@ -653,8 +653,7 @@ QString QSimpleTextCodec::convertToUnicode(const char* chars, int len, Converter const unsigned char * c = (const unsigned char *)chars; - QString r; - r.resize(len); + QString r(len, Qt::Uninitialized); QChar* uc = r.data(); for (int i = 0; i < len; i++) { diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 12575f9..fe826ad 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -351,8 +351,7 @@ QString QUtf16Codec::convertToUnicode(const char *chars, int len, ConverterState if (headerdone && endian == Detect) endian = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? BE : LE; - QString result; - result.resize(len); // worst case + QString result(len, Qt::Uninitialized); // worst case QChar *qch = (QChar *)result.unicode(); while (len--) { if (half) { diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 52fb8a2..cbdd32c 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -185,8 +185,7 @@ static QString languageToCode(QLocale::Language language) const unsigned char *c = language_code_list + 3*(uint(language)); - QString code; - code.resize(c[2] == 0 ? 2 : 3); + QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized); code[0] = ushort(c[0]); code[1] = ushort(c[1]); @@ -201,8 +200,7 @@ static QString countryToCode(QLocale::Country country) if (country == QLocale::AnyCountry) return QString(); - QString code; - code.resize(2); + QString code(2, Qt::Uninitialized); const unsigned char *c = country_code_list + 2*(uint(country)); code[0] = ushort(c[0]); code[1] = ushort(c[1]); diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 083253f..dba3d2a 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3849,8 +3849,7 @@ QString QString::fromUtf8(const char *str, int size) if (size < 0) size = qstrlen(str); - QString result; - result.resize(size); // worst case + QString result(size, Qt::Uninitialized); // worst case ushort *qch = result.d->data; uint uc = 0; uint min_uc = 0; @@ -3965,8 +3964,7 @@ QString QString::fromUcs4(const uint *unicode, int size) ++size; } - QString s; - s.resize(size*2); // worst case + QString s(size * 2, Qt::Uninitialized); // worst case ushort *uc = s.d->data; for (int i = 0; i < size; ++i) { uint u = unicode[i]; @@ -4029,8 +4027,7 @@ QString QString::simplified() const { if (d->size == 0) return *this; - QString result; - result.resize(d->size); + QString result(d->size, Qt::Uninitialized); const QChar *from = (const QChar*) d->data; const QChar *fromend = (const QChar*) from+d->size; int outc=0; @@ -4882,8 +4879,7 @@ QString QString::toLower() const c = QChar::surrogateToUcs4(*(p - 1), c); const QUnicodeTables::Properties *prop = qGetProp(c); if (prop->lowerCaseDiff || prop->lowerCaseSpecial) { - QString s; - s.resize(d->size); + QString s(d->size, Qt::Uninitialized); memcpy(s.d->data, d->data, (p - d->data)*sizeof(ushort)); ushort *pp = s.d->data + (p - d->data); while (p < e) { @@ -4974,8 +4970,7 @@ QString QString::toUpper() const c = QChar::surrogateToUcs4(*(p - 1), c); const QUnicodeTables::Properties *prop = qGetProp(c); if (prop->upperCaseDiff || prop->upperCaseSpecial) { - QString s; - s.resize(d->size); + QString s(d->size, Qt::Uninitialized); memcpy(s.d->data, d->data, (p - d->data)*sizeof(ushort)); ushort *pp = s.d->data + (p - d->data); while (p < e) { @@ -6272,8 +6267,7 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f + d.locale_occurrences *qMax(abs_field_width, larg.length()); - QString result; - result.resize(result_len); + QString result(result_len, Qt::Uninitialized); QChar *result_buff = (QChar*) result.unicode(); QChar *rc = result_buff; -- cgit v0.12 From 31ed96ef2c34429d61a5d9d1c1b7fe4fc17c708b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 18 Jun 2009 16:32:06 +0200 Subject: Fixed a problem with QSvgRenderer::animationDuration(). May have returned random values for SVGs without animation tags. Task-number: 256073 Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 9aa243b..d796938 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3375,6 +3375,7 @@ void QSvgHandler::init() { m_doc = 0; m_style = 0; + m_animEnd = 0; m_defaultCoords = LT_PX; m_defaultPen = QPen(Qt::black, 1, Qt::NoPen, Qt::FlatCap, Qt::SvgMiterJoin); m_defaultPen.setMiterLimit(4); -- cgit v0.12 From f9f08de9d41fd55d9c7d01578191ef5d4099c9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 18 Jun 2009 17:04:46 +0200 Subject: Use QTransform more efficiently. Reviewed-by: Samuel --- src/gui/graphicsview/qgraphicsitem.cpp | 14 ++++++-------- src/gui/graphicsview/qgraphicsscene.cpp | 2 +- src/gui/graphicsview/qgraphicsview.cpp | 18 ++++++++---------- src/gui/image/qimage.cpp | 12 ++++-------- src/gui/image/qpixmap.cpp | 13 +++++-------- src/gui/painting/qpaintengine.cpp | 3 +-- src/gui/painting/qpaintengineex.cpp | 3 +-- src/gui/painting/qpdf.cpp | 3 +-- src/gui/painting/qprintengine_win.cpp | 6 ++---- src/gui/styles/qcleanlooksstyle.cpp | 3 +-- src/gui/styles/qcommonstyle.cpp | 3 +-- src/gui/styles/qgtkstyle.cpp | 3 +-- src/gui/styles/qplastiquestyle.cpp | 3 +-- src/gui/text/qfontengine.cpp | 9 +++------ src/gui/widgets/qplaintextedit.cpp | 3 +-- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 3 +-- src/opengl/qpaintengine_opengl.cpp | 9 +++------ 17 files changed, 41 insertions(+), 69 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 555f7b0..b2c04ca 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -989,7 +989,8 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec bool hasPos = !childd->pos.isNull(); if (hasPos || childd->transformData) { // COMBINE - QTransform matrix = childd->transformToParent() * *x; + QTransform matrix = childd->transformToParent(); + matrix *= *x; *rect |= matrix.mapRect(child->boundingRect()); if (!childd->children.isEmpty()) childd->childrenBoundingRectHelper(&matrix, rect); @@ -3204,8 +3205,7 @@ QTransform QGraphicsItem::deviceTransform(const QTransform &viewportTransform) c QPointF mappedPoint = (untransformedAncestor->sceneTransform() * viewportTransform).map(QPointF(0, 0)); // COMBINE - QTransform matrix; - matrix.translate(mappedPoint.x(), mappedPoint.y()); + QTransform matrix = QTransform::fromTranslate(mappedPoint.x(), mappedPoint.y()); if (untransformedAncestor->d_ptr->transformData) matrix = untransformedAncestor->d_ptr->transformData->computedFullTransform(&matrix); @@ -3303,9 +3303,8 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co bool cousins = other != commonAncestor && this != commonAncestor; if (cousins) { bool good = false; - QTransform thisToScene; - QTransform otherToScene; - thisToScene = itemTransform(commonAncestor, &good); + QTransform thisToScene = itemTransform(commonAncestor, &good); + QTransform otherToScene(Qt::Uninitialized); if (good) otherToScene = other->itemTransform(commonAncestor, &good); if (!good) { @@ -4150,8 +4149,7 @@ QRegion QGraphicsItem::boundingRegion(const QTransform &itemToDeviceTransform) c p.end(); // Transform QRegion back to device space - QTransform unscale; - unscale.scale(1 / granularity, 1 / granularity); + QTransform unscale = QTransform::fromScale(1 / granularity, 1 / granularity); QRegion r; QBitmap colorMask = QBitmap::fromImage(mask.createMaskFromColor(0)); foreach (const QRect &rect, QRegion( colorMask ).rects()) { diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index d9d31ef..4d4c3b4 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5073,7 +5073,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * // Calculate the full transform for this item. bool wasDirtyParentSceneTransform = false; bool dontDrawItem = true; - QTransform transform; + QTransform transform(Qt::Uninitialized); if (item) { if (item->d_ptr->itemIsUntransformable()) { transform = item->deviceTransform(viewTransform); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index fb1a822..553d71c 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1940,8 +1940,7 @@ void QGraphicsView::render(QPainter *painter, const QRectF &target, const QRect itemList.clear(); // Setup painter matrix. - QTransform moveMatrix; - moveMatrix.translate(-d->horizontalScroll(), -d->verticalScroll()); + QTransform moveMatrix = QTransform::fromTranslate(-d->horizontalScroll(), -d->verticalScroll()); QTransform painterMatrix = d->matrix * moveMatrix; painterMatrix *= QTransform() .translate(targetRect.left(), targetRect.top()) @@ -2292,9 +2291,9 @@ QPolygonF QGraphicsView::mapToScene(const QPolygon &polygon) const QPainterPath QGraphicsView::mapToScene(const QPainterPath &path) const { Q_D(const QGraphicsView); - QTransform moveMatrix; - moveMatrix.translate(d->horizontalScroll(), d->verticalScroll()); - return (moveMatrix * d->matrix.inverted()).map(path); + QTransform matrix = QTransform::fromTranslate(d->horizontalScroll(), d->verticalScroll()); + matrix *= d->matrix.inverted(); + return matrix.map(path); } /*! @@ -2388,9 +2387,9 @@ QPolygon QGraphicsView::mapFromScene(const QPolygonF &polygon) const QPainterPath QGraphicsView::mapFromScene(const QPainterPath &path) const { Q_D(const QGraphicsView); - QTransform moveMatrix; - moveMatrix.translate(-d->horizontalScroll(), -d->verticalScroll()); - return (d->matrix * moveMatrix).map(path); + QTransform matrix = d->matrix; + matrix *= QTransform::fromTranslate(-d->horizontalScroll(), -d->verticalScroll()); + return matrix.map(path); } /*! @@ -3553,8 +3552,7 @@ QTransform QGraphicsView::transform() const QTransform QGraphicsView::viewportTransform() const { Q_D(const QGraphicsView); - QTransform moveMatrix; - moveMatrix.translate(-d->horizontalScroll(), -d->verticalScroll()); + QTransform moveMatrix = QTransform::fromTranslate(-d->horizontalScroll(), -d->verticalScroll()); return d->identityMatrix ? moveMatrix : d->matrix * moveMatrix; } diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ca2b782..fa1ce29 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3951,10 +3951,8 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf if (newSize == size()) return copy(); - QImage img; - QTransform wm; - wm.scale((qreal)newSize.width() / width(), (qreal)newSize.height() / height()); - img = transformed(wm, mode); + QTransform wm = QTransform::fromScale((qreal)newSize.width() / width(), (qreal)newSize.height() / height()); + QImage img = transformed(wm, mode); return img; } @@ -3981,9 +3979,8 @@ QImage QImage::scaledToWidth(int w, Qt::TransformationMode mode) const if (w <= 0) return QImage(); - QTransform wm; qreal factor = (qreal) w / width(); - wm.scale(factor, factor); + QTransform wm = QTransform::fromScale(factor, factor); return transformed(wm, mode); } @@ -4010,9 +4007,8 @@ QImage QImage::scaledToHeight(int h, Qt::TransformationMode mode) const if (h <= 0) return QImage(); - QTransform wm; qreal factor = (qreal) h / height(); - wm.scale(factor, factor); + QTransform wm = QTransform::fromScale(factor, factor); return transformed(wm, mode); } diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 56c3a29..61be832 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1446,10 +1446,9 @@ QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Tran if (newSize == size()) return *this; - QPixmap pix; - QTransform wm; - wm.scale((qreal)newSize.width() / width(), (qreal)newSize.height() / height()); - pix = transformed(wm, mode); + QTransform wm = QTransform::fromScale((qreal)newSize.width() / width(), + (qreal)newSize.height() / height()); + QPixmap pix = transformed(wm, mode); return pix; } @@ -1476,9 +1475,8 @@ QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode) const if (w <= 0) return QPixmap(); - QTransform wm; qreal factor = (qreal) w / width(); - wm.scale(factor, factor); + QTransform wm = QTransform::fromScale(factor, factor); return transformed(wm, mode); } @@ -1505,9 +1503,8 @@ QPixmap QPixmap::scaledToHeight(int h, Qt::TransformationMode mode) const if (h <= 0) return QPixmap(); - QTransform wm; qreal factor = (qreal) h / height(); - wm.scale(factor, factor); + QTransform wm = QTransform::fromScale(factor, factor); return transformed(wm, mode); } diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 8e8485d..4fb1832 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -1008,8 +1008,7 @@ void QPaintEnginePrivate::drawBoxTextItem(const QPointF &p, const QTextItemInt & const int size = qRound(ti.fontEngine->ascent()); QVarLengthArray positions; QVarLengthArray glyphs; - QTransform matrix; - matrix.translate(p.x(), p.y() - size); + QTransform matrix = QTransform::fromTranslate(p.x(), p.y() - size); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); if (glyphs.size() == 0) return; diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 5ebca47..a4db284 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -848,8 +848,7 @@ void QPaintEngineEx::drawImage(const QPointF &pos, const QImage &image) void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) { QBrush brush(state()->pen.color(), pixmap); - QTransform xform; - xform.translate(r.x() - s.x(), r.y() - s.y()); + QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y()); brush.setTransform(xform); qreal pts[] = { r.x(), r.y(), diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index c3452e1..664751a 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1929,8 +1929,7 @@ void QPdfBaseEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &t QVarLengthArray glyphs; QVarLengthArray positions; - QTransform m; - m.translate(p.x(), p.y()); + QTransform m = QTransform::fromTranslate(p.x(), p.y()); ti.fontEngine->getGlyphPositions(ti.glyphs, m, ti.flags, glyphs, positions); if (glyphs.size() == 0) diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index 179927f..72faf7c 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -663,8 +663,7 @@ void QWin32PrintEngine::drawPixmap(const QRectF &targetRect, qreal scaleX = 1.0f; qreal scaleY = 1.0f; - QTransform scaleMatrix; - scaleMatrix.scale(r.width() / pixmap.width(), r.height() / pixmap.height()); + QTransform scaleMatrix = QTransform::fromScale(r.width() / pixmap.width(), r.height() / pixmap.height()); QTransform adapted = QPixmap::trueMatrix(d->painterMatrix * scaleMatrix, pixmap.width(), pixmap.height()); @@ -1875,8 +1874,7 @@ static void draw_text_item_win(const QPointF &_pos, const QTextItemInt &ti, HDC QVarLengthArray positions; QVarLengthArray _glyphs; - QTransform matrix; - matrix.translate(baseline_pos.x(), baseline_pos.y()); + QTransform matrix = QTransform::fromTranslate(baseline_pos.x(), baseline_pos.y()); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, _glyphs, positions); if (_glyphs.size() == 0) { diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 902ffdd..3855ba7 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -1738,8 +1738,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o // same rendering code for both orientations. if (vertical) { rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height - QTransform m; - m.translate(rect.height()-1, -1.0); + QTransform m = QTransform::fromTranslate(rect.height()-1, -1.0); m.rotate(90.0); painter->setTransform(m, true); } diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 682e00b..c5c6973 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -1963,8 +1963,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, newRot = -90; } tr.setRect(0, 0, tr.height(), tr.width()); - QTransform m; - m.translate(newX, newY); + QTransform m = QTransform::fromTranslate(newX, newY); m.rotate(newRot); p->setTransform(m, true); } diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index a4a468d..8499811 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -2848,8 +2848,7 @@ void QGtkStyle::drawControl(ControlElement element, if (vertical) { rect.translate(xt, -yt * 2); rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // Flip width and height - QTransform m; - m.translate(rect.height(), 0); + QTransform m = QTransform::fromTranslate(rect.height(), 0); m.rotate(90.0); painter->setTransform(m); } diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 3935dc1..12aa679 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -2642,8 +2642,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op // same rendering code for both orientations. if (vertical) { rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height - QTransform m; - m.translate(rect.height()-1, 0); + QTransform m = QTransform::fromTranslate(rect.height()-1, 0); m.rotate(90.0); painter->setTransform(m, true); } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 25bdfd2..05b3695 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -422,8 +422,7 @@ void QFontEngine::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QVarLengthArray positions; QVarLengthArray positioned_glyphs; - QTransform matrix; - matrix.translate(x, y); + QTransform matrix = QTransform::fromTranslate(x, y); getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions); addGlyphsToPath(positioned_glyphs.data(), positions.data(), positioned_glyphs.size(), path, flags); } @@ -1151,8 +1150,7 @@ void QFontEngineBox::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyp QVarLengthArray positions; QVarLengthArray positioned_glyphs; - QTransform matrix; - matrix.translate(x, y - _size); + QTransform matrix = QTransform::fromTranslate(x, y - _size); getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions); QSize s(_size - 3, _size - 3); @@ -1180,8 +1178,7 @@ void QFontEngineBox::draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt QVarLengthArray positions; QVarLengthArray glyphs; - QTransform matrix; - matrix.translate(x, y - _size); + QTransform matrix = QTransform::fromTranslate(x, y - _size); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); if (glyphs.size() == 0) return; diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index d1978e3..efacd00 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -1725,8 +1725,7 @@ static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, QRectF p->save(); if (brush.style() >= Qt::LinearGradientPattern && brush.style() <= Qt::ConicalGradientPattern) { if (!gradientRect.isNull()) { - QTransform m; - m.translate(gradientRect.left(), gradientRect.top()); + QTransform m = QTransform::fromTranslate(gradientRect.left(), gradientRect.top()); m.scale(gradientRect.width(), gradientRect.height()); brush.setTransform(m); const_cast(brush.gradient())->setCoordinateMode(QGradient::LogicalMode); diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 75d8a56..6ff0c53 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1063,8 +1063,7 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, const QTextIte QVarLengthArray positions; QVarLengthArray glyphs; - QTransform matrix; - matrix.translate(p.x(), p.y()); + QTransform matrix = QTransform::fromTranslate(p.x(), p.y()); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0 diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index b594f5b..e173a8d 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -4206,8 +4206,7 @@ void QOpenGLPaintEnginePrivate::drawImageAsPath(const QRectF &r, const QImage &i qreal scaleX = r.width() / sr.width(); qreal scaleY = r.height() / sr.height(); - QTransform brush_matrix; - brush_matrix.translate(r.left(), r.top()); + QTransform brush_matrix = QTransform::fromTranslate(r.left(), r.top()); brush_matrix.scale(scaleX, scaleY); brush_matrix.translate(-sr.left(), -sr.top()); @@ -4228,8 +4227,7 @@ void QOpenGLPaintEnginePrivate::drawTiledImageAsPath(const QRectF &r, const QIma QBrush old_brush = cbrush; QPointF old_brush_origin = brush_origin; - QTransform brush_matrix; - brush_matrix.translate(r.left(), r.top()); + QTransform brush_matrix = QTransform::fromTranslate(r.left(), r.top()); brush_matrix.scale(sx, sy); cbrush = QBrush(img); @@ -4871,8 +4869,7 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte // add the glyphs used to the glyph texture cache QVarLengthArray positions; QVarLengthArray glyphs; - QTransform matrix; - matrix.translate(qRound(p.x()), qRound(p.y())); + QTransform matrix = QTransform::fromTranslate(qRound(p.x()), qRound(p.y())); ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); // make sure the glyphs we want to draw are in the cache -- cgit v0.12