When appending a QVector to an existing vector the code would
unconditionally realloc the vector instead of first checking
whether we can do without. This gives a quadratic behaviour when
repeatedly appending a vector to another.
Change-Id: I2cd81253e6a8aec0bc4402e6fbda262435080966
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to Qt doc, "Network proxy is not used if the address used in
connectToHost(), bind() or listen() is equivalent to
QHostAddress::LocalHost or QHostAddress::LocalHostIPv6. This is not the
case in current implementation.
Change-Id: I6b8a40c1e8bd8aad9504d8f939b87eda6e93337c
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
-added C++ and QML language guidelines as part of QDoc Guide
-included snippets
-fixed links in the HTML template of the QDoc Guide
-compiles when the main QDoc manual is compiled
Change-Id: Iadd799712eef80e905d092396cb7a1e25a863b43
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Martin Smith <martin.smith@nokia.com>
this is preparation for adapting to a new evaluator.
Change-Id: I6fc59f5525735754a00afa6629fbfe257e84db97
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
It's closer to what we do with in QMutex than pthread_mutex_lock.
Change-Id: I86498a800b69b684bf096912e911bc5bca219727
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The .gitattributes, .gitignore, .commit-template files do not need to be
present in packaged sources, as they are for people using the Git
repository. People who download tarballs usually don't reimport into
Git -- they should just download the actual repositories.
Meanwhile, the .tag file is quite useful. Instead of making Git extract
to the useless SHA-1 of the "$Id$\n" string, ask git-archive to store
the SHA-1 of the commit being packaged.
Change-Id: I9a24a526e66f58ef2ebd9a2319bf96cf43e3e6f7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Simo Fält <simo.falt@nokia.com>
Currently, QGraphicsScene::items() and related functions only return
items that are visible. The definition of visible effectively means
any item for whom isVisible() returns false or opacity() returns 0.0.
However, this is not documented anywhere.
Also fixed some typos/grammatical errors.
Change-Id: Ia6d1f7d63024dc9412438fe97748d7a69ee8225b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
The test is now passing. Tested with intel compiler and vs2008.
Task-number: QTBUG-22285
Change-Id: I728919833d9bcbf71bef68c06baef92667ff074b
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
A couple of runaway backslashes resulted in illegal code in the
examples.
Change-Id: Ib00d4e1d792e44bb73dafdd84c3a1843dcb34e27
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This was only a problem if the qdocconf file was in the same
directory as the current directory (QDir::relativeFilePath()
returns an empty string in that case), so if the documentation was
generated with the makefile rules, this problem did not reveal itself.
Change-Id: I9c8956fdb46c4f307df7ab297dc94e8d3ef93fb4
Reviewed-by: Martin Smith <martin.smith@nokia.com>
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.
This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.
The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.
The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.
This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.
This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.
This needs to be applied in conjunction with
https://codereview.qt-project.org/#change,33548
Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
ChangeId Ia69f37343f95772e934eab1cd806bd54cbdbbe51 added two new
methods to QCursor but didn't update the fake cursor.
Qt5's build still fails with QT_NO_CURSOR somewhere in
QT_METATYPE_INTERFACE_INIT(Type), but that's another story.
Change-Id: Ib0c706faf78e547d93a1128085e440fe5d1a5e9b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
As the behaviour described in the style hint seems to
be default and working, it can be removed.
Change-Id: Ia8d47cf187597ae48b9e42c3f98ef3d4c390db34
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
That can be reproduced in Qt Creator when deleting code.
Task-number: QTBUG-27140
Change-Id: Ida7177612653f10e5d866bf9a422c71c632f4eb3
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
The test shows spurious failures in editingFinished() on some Mac
platforms (QTest::qWaitForWindowActive(testFocusWidget)).
This is apparently caused by the widget testFocusWidget (member
variable) interfering with the other tests widgets.
As it is used in one test only, instantiate it on the stack there.
Change-Id: I688cd21a2668d072660658302cf59197abe0b4d8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
This reverts commit 6b5bbc531b.
Autograbbing mouse shouldn't be done in crossplatform code, as
X11 does this automatically. Windows needs platform specific
solution.
Task-number: QTBUG-26962
Task-number: QTBUG-27039
Task-number: QTBUG-23699
Change-Id: I911df92c4a34deb50b729f50681497046657948b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
The -developer-build option in the configure shell script is right after
-force-debug-info, move it to the same place in the Windows version.
Change-Id: I9b944f8591011ce9987a4fb98f7d02d88160d9e8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This caused some headache wrt documentation, since in order to
generate the proper documentation for the qt namespace
qdoc also needed to parse the headers of gui, which breaks
cross-module linking. (This is because qdoc will actually
generate two almost identical nodes in the code tree; one
from the header files from gui and another from the index file
of gui).
The best fix would maybe be to make it part of
QAbstractTextDocumentLayout, but that will break source compat.
Change-Id: I34e94d05fa4bec3034778d1f1cc0e53d0625e1ab
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Even though I really think the change was the right thing to do, it seems
like Windows people don't like this change because of some Windows Data Types
specific rules.
This reverts parts of the commit 56d5c909af.
Change-Id: I2c67d9b1bab36fc63937ef386aef56d2a4472a04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
When 2 (February) is entered as the month for (e.g.) 31/Jan/2000 (which
is following the format: "dd/MMM/yyyy"), the day is corrected to 29 but
displayed as its numerical value instead of its short (or long) name.
Task-number: QTBUG-27036 QTBUG-19091
Change-Id: I558ee13b224707d22b26c2ec2c045f96118bd5a1
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
When a QDateEdit has its display format set to "yyyy/MM/dd", its day
set to 31 and its month set to 2, it will display 291 as the day until
the cursor is moved or the focus changed. This is because
QDateTimeParser::parse calls sectionSize() for the day section, which
will sometimes return an incorrect size. There are also other display
formats affected by this bug (e.g. long day names).
For example, (in the context of sectionSize()) when text is
"2000/01/31" and displayText() is "2000/2/31", there is a difference
between displayText() and text - text is the previous value and
displayText() is the new value. The size difference is always due to
leading zeroes.
This patch makes QDateTimeParser keep track of the quantity of zeroes
added to each section and then factors this value into the result of
sectionSize() if there is a size difference between text and
displayText().
Task-number: QTBUG-26847
Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
Or else we never hit the path where middle button click pasts selection
on X11. This is also how it worked in Qt 4.
Change-Id: Ia090c465db0e5e8cb249f5d752e0bb86951e2eb0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
this may have worked a decade ago, but now it only produces funny
Makefiles (and needs hacking main.cpp). the feature doesn't seem *too*
important, so just clean it out.
Change-Id: I50a60b0e30341f0b523e4a5731c770c9c1013f8b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
don't read the spec from scratch for every library just to get
QMAKE_LFLAGS_RPATH. we can perfectly use our current project for that
purpose.
Change-Id: I4e408b3fd5de81652181df032aa53cd8f2f8f806
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
it's a dynamic property which is something between meaningless and
misleading when used outside a project file.
also, experience from creator shows that people would consistently
abuse it (not handling it as the list it is).
Change-Id: Id52cd40da5c38c0c74535d0701fdae53dfa39cad
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
The TRUE and FALSE macros are obsolete and should be replaced with
true and false (all lower case) respectively.
Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do not compare a QString to QString(). Instead use the .isEmpty() method.
Change-Id: I8bb5e64563bf173abe7288bb9e35375bee1fe445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When QTextLayout is used in a QTextDocument, many code paths use
special caches and thus greatly outperform the raw QTextLayout version
that operates directly on a QString.
This patch brings some of these optimizations also to the raw version.
We now also use a QFormatCollection in such cases and enable the
functionality of QTextEngine::indexAdditionalFormats() and
QTextEngine::resolveAdditionalFormats(). Thanks to that, we can greatly
speed up QTextEngine::format(), which now uses an amort O(1) hash table
lookup instead of a O(N) linear search.
The added benchmark shows a gain in the order of one magnitude:
./tst_bench_QText formattedLayout:long-many
before applying the patch:
378.19 msecs per iteration (total: 37,820, iterations: 100)
after applying the patch:
25.80 msecs per iteration (total: 2,580, iterations: 100)
Note: This change is source-incompatible for applications using the private
QTextEngine API.
Task-number: QTBUG-8389
Change-Id: Ifcf7a8902a394428979ea06a6d955f886ee739c7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Implicit conversions from int to BYTE (unsigned char) result in
compile errors when compiling with the GCC -std=c++0x option.
Change-Id: Iaf8190426207bf15ab4b337300510596d70659ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
qSort has terrible performance, especially on mostly-sorted input, which is
presumably why a custom implementation was created. However, std::sort has much
better performance than qSort in many cases.
Benchmarking shows that std::sort beats out the custom sort by a very narrow
margin (21-22ms for qSort, 14-15ms for sort, 14ms for std::sort) in a simple
benchmark of sorting.
Change-Id: If7e57fdfaf98e741d1621969461537c82f9169fe
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
"Are sure you want to delete '%1'?" should be:
"Are you sure you want to delete '%1'?"
Title of the message box should be Delete, not Open.
Task-number: QTBUG-26851
Change-Id: I40933c5e1b231d3d2e3274b4d669267d26ba8cfc
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Changed:
"Returns 0 if either time is invalid."
to:
"Returns 0 if either datetime is invalid."
Change-Id: I52d291459f215c1bb7fc78e70eaac90b2498158b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
RIM is committed to supporting Qt on its platforms and the port works
well.
Change-Id: Id6bfea2dbc178800adad89d436ce31c40d3eb652
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the cached state is not dirty and the instanceCount is zero, when the
instanceCount is incremented the cached state will not be correct. To
fix this, reset the cached state to dirty if the instanceCount is
incremented from zero.
Change-Id: Ic49eef7f83b1289a939f998817b1b2b5f5a2a45f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>