Commit Graph

19013 Commits

Author SHA1 Message Date
Markus Goetz
097b641c3e QNAM: Fix previous HTTP upload CPU fix
My previous fix for CPU load issues between HTTP thread
and user thread  was fragile if the upload QIODevice
emitted readyRead() multiple times.

[ChangeLog][QtNetwork][QNetworkAccessManager] Fix behavior of upload QIODevice
that generate data on readyRead() for HTTP PUT/POST

Change-Id: Idb1c2d5a382a704d8cc08fe03c55c883bfc95aa7
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-25 17:10:54 +02:00
Giuseppe D'Angelo
5c2d7b1635 XCB: fix a memory leak
An early return didn't deallocate a xkb_state struct.

Change-Id: I158ffc67030403636aceab985cc605888a31804b
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-25 10:52:11 +02:00
Gabriel de Dietrich
b5ae9d8efe QMacStyle: Improvements to some buttons on Yosemite
Radio button, checkbox and non-editable combobox, in normal,
small and mini sizes, and only in the inactive state.

This commit amends 982b9b7ec2.

Task-number: QTBUG-40833
Change-Id: If3f2bb215e9b8966cbf15f08fa252feb92483c7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-24 15:39:40 +02:00
Andy Shaw
3b3ecb79a6 Fix compilation on OS X with macx-clang-32
Task-number: QTBUG-27335
Change-Id: I1703aee2d90e02b1a6ed386715bebddf6dedb9f5
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-09-23 17:05:36 +02:00
Gabriel de Dietrich
abde2a59c6 Cocoa: Properly remove content view from its superview in setNSWindow()
-[NSWindow setContentView:] doesn't make assupmtions about where that
view comes from, and just attaches it to the window. We need to make
sure we detach it from its previous window by calling -[NSView
removeFromSuperview], or the previous NSWindow may keep references to
the view. This can be an  issue if the view is deleted right after.

Task-number: QTBUG-39628
Change-Id: I152dedcb64ac044d8ca290c9996b388809e2477b
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-23 13:29:21 +02:00
Christian Kandeler
e66a878838 QSettings: Don't chop off trailing tabs that were actually part of a value.
This was done wrong when using the ini format.

Task-number:  QTBUG-22461
Change-Id: Ib9390460bce6138659cceac7e3cd25339ba5e9bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 11:28:58 +02:00
Thiago Macieira
3bfdacaaeb Document that default-constructed QFuture are canceled
Task-number: QTBUG-40680
Change-Id: Idee9ff75c89c8349be779b90ee9c34a899d92c0c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-09-22 19:13:31 +02:00
Giuseppe D'Angelo
0d48e774c6 Refactor some loops over EINTR
QT_CLOSE is #defined to be qt_safe_close which already performs
the EINTR loop. So there's no need of doing other loops
(either by hand or by the EINTR_LOOP macro).

Change-Id: Icca256124def5ab5d79c2ba101c6f889c85d19da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-22 18:57:23 +02:00
Giuseppe D'Angelo
bc5a1c6d3f QFile: fix undefined behavior when closing a buffered file
C11 §7.21.3.4 [Files] says that

    The value of a pointer to a FILE object is indeterminate
    after the associated file is closed

POSIX.1-2013 reinforces by saying that

    After the call to fclose(), any use of stream results
    in undefined behavior.

This means we can't call fclose() again on a FILE *,
even if fclose() returned EOF and set errno to EINTR.

Change-Id: I282f4ff926e3c134729defa290c80d42431e97ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-22 18:57:18 +02:00
Giuseppe D'Angelo
8f622fef41 Prevent a Coverity warning about a dangerous code path
Coverity warns that we may access the gray array without initializing
it. The array is initialized if d (the source image depth) is 8.

However, when doing ordered dithering, we don't check that depth
any more and just use the array. There are instead checks in place
for the other dither modes; the one for ordered has been commented
out before public history.

So, for the love of kittens, put the check back.

Change-Id: I1cc5ced8edbb626777e54e9f4e58f152c6b28ddc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-22 18:57:12 +02:00
Giuseppe D'Angelo
fb8c795302 QTransform: initialize the d member
Although never used, the d member triggers all sorts of warnings
when copying a QTransform around because it's technically
undefined behavior (reading from an uninitialized variable).

Change-Id: If06b6bea6f0ec0623c38ba330d46958b373cdc65
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-22 18:57:08 +02:00
Giuseppe D'Angelo
8c2f0ac382 QObject: fix a memory leak in moveToThread
For some reason it seems to be supported to call moveToThread(0).
That call will allocate a new QThreadData for the object. However,
if we then detect that we're calling moveToThread from a thread
which is not the one the QObject has affinity with,
we error out leaking that QThreadData object.

Change-Id: I0fe6625a2a9887535e457f3897b514d2a03d1480
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-22 18:56:50 +02:00
Giuseppe D'Angelo
d9e1a0f05b QRegion: fix a memory leak
An early return in case of errors leaked memory tracked in a variable
in scope.

Change-Id: I68cd77890608caff54df7476d38850e5541ce76e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-22 18:56:45 +02:00
Giuseppe D'Angelo
772b799a83 XCB: fix a possible array overflow leading to a crash
The QClipboard::Mode returned from modeForAtom should be checked
everywhere because values greater than Selection (i.e. FindBuffer)
aren't supported on X and should mean error conditions.

The lack of such a check did an out-of-bounds array access, which
could lead to a crash.

Change-Id: I70f70b5f713ab2f892e258d4df2f7afeb434f0c1
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2014-09-22 18:56:33 +02:00
Giuseppe D'Angelo
ebdd56c5bd XCB: fix a memory leak
An early return caused a leak of a new'd allocated object.

Change-Id: I9fbc37238dd49066d24363a2e8ee8bf35b155301
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-09-22 18:56:26 +02:00
Giuseppe D'Angelo
8259413e41 GTK syle: initialize all members of GdkColor
Coverity rightfully complains that we're copying a struct with an
uninitialized member, triggering undefined behavior.

Change-Id: I7635b859eb11e5eb9b825df8e23b453116059892
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-09-22 18:56:22 +02:00
Timur Pocheptsov
b4af1235ef OS X: File dialog does not show "Media" section.
This bug can be reproduced (AFAIK) only on 10.9. To fix it I suggest we create
NSOpenPanel/NSSavePanel
_every_ time it must be displayed. Actually, that's what I've seen in all code samples
I was able to found - nobody tries to retain this panel and re-use it.
If we re-use it, "Media" section magically disappears.
I believe this bug is not Qt's bug, but something weird in Cocoa.

Task-number: QTBUG-40655
Change-Id: Ic0e76e0a9a5444a76f336d511c0ff93f9fd05797
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-22 17:06:34 +02:00
Timur Pocheptsov
da0c74550f OS X: main window doesn't become key.
When ordering a key window out Cocoa
tries to find a new KEY window. Looks like it prefers the current MAIN
window and since QNSPanel is never a main window, Cocoa is breaking
the stack order. To avoid this - try to change the key
window BEFORE ordering out a window.
The application has a stack of all open windows (visible and hidden),
we iterate through this stack starting from our current key window
and look for the nearest window below, that can become a new key window.
Most probably, it will be our transient parent :)
This code will change (potentially) the key window _only_
if there is a transient parent.

Task-number: QTBUG-39809
Change-Id: I96b630799341875fc7e38dabf1ff6416338e687b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-22 17:06:24 +02:00
Eskil Abrahamsen Blomfeldt
412ec70f14 OS X: Fix menu item shortcuts without modifiers
A regression was introduced by bdebec4e2e.
The intention of the change was to avoid using Qt's shortcut mechanism
to trigger menu items which were already triggered through the regular
menu API in Cocoa. However, Cocoa has trouble with key equivalents that
do not have any keyboard modifiers. Thus, we have to allow these
particular key sequences to go through the regular system. I've verified
that the original bug is still fixed with this change.

[ChangeLog][OS X] Fixed menu item shortcuts without keyboard
modifiers.

Task-number: QTBUG-41192
Change-Id: I8f5a9cbc7a448b3cb0519baed95be5cbb630205c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-22 14:32:28 +02:00
Gabriel de Dietrich
65a991e57e Make sure we don't delete child QWindows if they have WA_NativeWindow set
Deleting a QWindow automatically deletes its child windows because
they are in the QObject hierarchy. However, if the user sets both
WA_NativeWindow and WA_DontCreateNativeAncestors, we can't just
delete that widget's QWindow. First because the widget doesn't get
notified (and maybe it should be), and then because we may invalidate
any reference to the QWindow the user may have kept.

Our solution is to reparent the child QWindows into the new parent's
closest QWindow. We must, however, take the precaution of not keeping
any reference to the backing store in the platform window. Reparenting
operations can trigger repaints on the platform window, but the backing
store is not set and flushed until later.

Task-number: QTBUG-38377
Change-Id: I353f5528f227a227b6d10419367cbe1d5d07a94e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-09-22 14:11:08 +02:00
Giuseppe D'Angelo
87fbfe074b Fix a mishandling of the fd returned by socket(2)
socket(2) is allowed to return 0, so 0 should not be included
when checking for errors.

Change-Id: I0454ea60347d90078d3ab3046969add8d5c37935
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-22 14:08:57 +02:00
David Schulz
5d688c5780 Add backslash to the list of word separator.
Task-number: QTBUG-40384
Change-Id: I16ae1432f3bdd7e577593fc43336bf29c735a66b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-22 13:42:59 +02:00
Albert Astals Cid
a966b19b52 Fix crash in QNetworkAccessCacheBackend::closeDownstreamChannel
device is private, always null and class has no friends, so no need to have it at all

Change-Id: I320d47f1a712a3202c08b494563533e29d185501
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-22 13:42:03 +02:00
Christian Kandeler
c6c0eb084a Document non-intuitive behavior of QTreeWidgetItem::setHidden().
Task-number: QTBUG-30366
Change-Id: I02e098fbf0e3a44794ed0e1b1bf533c1c9ad5632
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-22 12:38:17 +02:00
Andy Shaw
a5df2e7120 Cocoa: Handle insertNewLine selector for when it is sent while composing text
Some IMEs will perform an insertNewLine when Return/Enter is pressed while
composing text as well as causing the edit to finish. By handling this it
will ensure that the extra enter/return event is sent when the IME
requests it.

Task-id: QTBUG-39125
Change-Id: Ice6eded68e6b1dc51703a38316f76f78099923da
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-19 09:35:56 +02:00
Adam Majer
1fa3627423 Remove reference to removed qatomic_sparc.h
qatomic_sparc.h was removed previously as part of general cleanup of
old atomic code for Qt 5.3. Unfortunately SPARC include reference was
not removed resulting in build failure on that platform.

Task-number: QTBUG-41384
Change-Id: Ic6e31b32324b0e5dd3700a6a21515a8eea5668bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-18 15:58:13 +02:00
Frederik Gladhorn
a72d34d26e Merge remote-tracking branch 'origin/5.3.2' into 5.3
Change-Id: Iae36a5178c0411d4d36508e0725e132af390157a
2014-09-17 20:57:50 +02:00
Erik Verbruggen
e409eafe23 OSX: emit aboutToShow signal for top-level dock menu.
Qt sets a QCocoaMenuDelegate on every menu it creates in order to emit
the (OSX specific) aboutToShow signal. However, there are a few cases
where OSX will copy a menu without copying the delegate. One of those
cases is the dock: the result of -[NSApplication applicationDockMenu:]
is used to create a new menu, to which a few more items are copied.
This copy is then send back to the dock.

This patch invokes the delegate's -menuWillOpen: method when
-[NSApplication applicationDockMenu:] is called. Note that sub-menus
won't receive the call-back, because the dock doesn't tell the
application what happens after returning from applicationDockMenu:.

Task-number: QTBUG-39604
Change-Id: I0e06df371a3d77342ae4b7148041214e5c4579d7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-16 22:42:50 +02:00
Giuseppe D'Angelo
bb3d2ca9f1 QToolButton: properly reset the size hint when a menu is set on it
QToolButton::sizeHint() takes into account the presence of a menu.
However, setMenu() doesn't retrigger a size hint recalculation. Hence,
(un)setting a menu on an already sized tool button won't properly
reset the size hint. Since the calculated size hint is cached,
delete the cached value and call updateGeometry to cause a
recalculation.

Task-number: QTBUG-38949
Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 22:42:47 +02:00
Eike Ziller
055622ed48 OS X: Fix positioning of popup menus in case of native NSWindows
The code transformed the coordinates from the view to the window's
content view, and since that content view is flipped in the pure
Qt world (content view == QNSView), it manually flipped the
coordinates to transform from that to window coordinates.

Instead just directly transform the view coordinates to window
coordinates using standard Cocoa methods, which then works with
any kind of content view and NSWindow configuration.

Task-number: QTBUG-40958
Change-Id: Idddd327fe9cff3309606379d0e04ee8b4bd5eece
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-16 22:42:43 +02:00
Giuseppe D'Angelo
b2b9fdfda0 QSizeGrip: use a QPointer to the tracked TLW
And not a normal pointer. The problem is that in certain scenarios,
if the TLW containing a QSizeGrip changes and the old TLW gets
immediately destroyed, then the mechanism which updates the tracked
TLW is run too late, and ends up accessing a dangling pointer.
Therefore, we need to protect that pointer via a smart pointer.

Task-number: QTBUG-22867
Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 20:50:50 +02:00
Kai Koehne
0fa0608f70 Logging: Remove use of _declspec(thread)
thread-local variables are known to be broken on Windows XP if the
library is loaded dynamically. This has been fixed since Windows Vista,
but to avoid any elaborate runtime checking of the OS version we're just
removing the logic alltogether for MSVC / Windows.

Task-number: QTBUG-41008
Change-Id: I64ee95270d142294c975a5890d6e1b62a833b6ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-15 15:58:40 +02:00
Oliver Wolff
d4d752e241 QWindowsWindow: Fixed warning text
Change-Id: I80019f705edcf3b5f974af72ef86b45546582210
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-15 15:58:36 +02:00
Aki Koskinen
a3b88a0025 Improved documentation for QStyledItemDelegate::eventFilter
Added the notion that enter and return keys are not handled
if editor is of type QTextEdit or QPlainTextEdit.

Change-Id: I9d5cb529bf154c687fab1949fccf37e9da096c85
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-09-15 15:58:06 +02:00
Oswald Buddenhagen
1da57ecd06 fix bogus library paths in ANGLE prl files
Task-number: QTBUG-41204
Change-Id: I3ddcba23467e7df3a4449c4960972f37810ed323
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-09-15 15:58:03 +02:00
Tim Blechmann
739f98aa09 cocoa: fix namespace manging for QNSView
Change-Id: I83035b45cabd938a9fdfa3a5d12de2c1793b30b3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-15 10:29:38 +02:00
Tim Blechmann
1126701f8c cocoa: don't override NSApplication-sendEvent if configured as AA_MacPluginApplication
Change-Id: I48cebbcb814ee8e97583c3165e7cb668077cfbad
Task-number: QTBUG-40409
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-15 10:29:25 +02:00
Tim Blechmann
c8d2514347 QGuiApplication: clear font database on cleanup
Change-Id: If196c5e93b7ed68c6a0f6be7414f9efc8195f168
Task-number: QTBUG-40865
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-12 11:14:57 +02:00
Gabriel de Dietrich
982b9b7ec2 QMacStyle: Use NSView rendering for some inactive widgets on 10.10
Right now, we use them for inactive non-editable combo box, check
box, and radio button only on Yosemite. We keep as much as possible
the previous behavior on older versions.

In addition, we add a way for QQuickStyleItem to specify the window
the item is on. This is currently without effect, since we don't
seem to take the inactive window state into account.

Task-number: QTBUG-40833
Change-Id: I2fb2a99e6adf1972f881195b79b07ce85a960273
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-11 11:53:53 +02:00
Eskil Abrahamsen Blomfeldt
c1b46b98ed Fix possible divide by zero in QPlainTextEdit
If the font engine for some reason fails to get font metrics
for the font, the application should still not crash.

[ChangeLog][Widgets][QPlainTextEdit] Fixed a possible divide
by zero crash when font metrics were missing for the font.

Task-number: QTBUG-40347
Change-Id: I571bc3eace07cdbee6f9ce9aa649df95412aed71
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-11 10:15:22 +02:00
Boris Savelev
4b6d873725 Add QMAKE_CFLAGS_XCB to xcb
Add QMAKE_CFLAGS_XCB to xcb-static,
needed for successfully building with -qt-xcb.
Add QMAKE_CFLAGS because some code gets built with the C compiler.
Also, this fixes a compile error
when xcb include is not in system include path.

Task-number: QTBUG-41129
Change-Id: I842ebe391a7a857e234becc451c33601fce9b07a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-09-10 16:59:47 +02:00
Thiago Macieira
209a75f2d0 Qt 5.3.2 changelog
Change-Id: I96c014c364c93d412b11acee00dc339d5eceb306
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-09-10 14:32:55 +02:00
David Faure
507fff201b qsql ibase: fix memory corruption due to LONG being 4 bytes in firebird.
As fb_types.h says, Firebird requires (S)LONG to be 32 bit, and it defines
SLONG to int. This leads to sqllen being 4, so qsql_ibase.cpp allocates
4 bytes... and was writing 8 bytes into it.

Fixed by checking sqllen, the same way QIBaseResult::gotoNext does.

Change-Id: Ie8680d32f98c354dfc8430b8efbfe95450556956
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-10 08:28:11 +02:00
Eric Lemanissier
3e80497668 Preventing caching of null authenticator
In some cases, e.g. when bad credentials are provided in an ftp URI,
QNetworkAccessAuthenticationManager::cacheCredentials is called with a
null authenticator. This authenticator should not be cached, because
it is useless, and leads to inconsistencies in the use of the cache

Task-number: QTBUG-40622
Change-Id: If2a0a422b915f268648f5eef1d68601446123371
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-09-09 22:26:27 +02:00
Olivier Blin
529a31c967 configure: fix expanding system commands in qmake parser with GNU awk < 4
qmake variables using $$system() were incorrectly parsed by the custom
qmake parser in the configure script, when using GNU awk 3.1.8 or
earlier. They are parsed correctly with GNU awk 4 or mawk.

This was occurring with such an assignement (from an extra mkspecs file):
    QMAKE_CC                = $$system($$CMD QMAKE_CC 2>/dev/null)

The custom qmake parser in the configure script first attempts to
expand $$UPPERCASE variables, before running $$system(), using this:
    match(value, /\$\$(\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/)

But when using non-ASCII locales with GNU awk 3.1.8 or earlier,
$$system was expanded (to an empty string) because these earlier awk
versions match lowercase letters for the [A-Z] regexp, which is
traditionally used to match uppercase letters.

This behavior has been changed in GNU awk 4.0.0, which only matches
uppercase letters for [A-Z] by default. A workaround for earlier GNU
awk versions is to run awk with the C locale.

See GNU awk NEWS "Changes from 3.1.8 to 4.0.0":
25. Gawk now treats ranges of the form [d-h] as if they were in the C
    locale, no matter what kind of regexp is being used, and even if
    --posix.  The latest POSIX standard allows this, and the documentation
    has been updated.  Maybe this will stop all the questions about
    [a-z] matching uppercase letters.
    THIS CHANGES BEHAVIOR!!!!

See also gawk.info "A.7 Regexp Ranges and Locales: A Long Sad Story"

Change-Id: Ibb3eb28738c3e77d496c634e1f5c9f630957e730
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-09 17:16:01 +02:00
Marcel Krems
e6857b7ebc Updated QSql{Query,Result}::bindValue doc to reflect the current state.
Since 5.0 it is possible to use one call to bindValue to bind
values to multiple placeholders with the same name.

Task-number: QTBUG-23360
Change-Id: Ic838150d25dd07bca7bc9e5d91ab3362a73833d6
Reviewed-by: Matt Newell <newellm@blur.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-08 16:18:19 +02:00
John Brooks
61b47cd166 Correct QString::toStdString documentation on encoding
This statement was left from when toAscii was used, instead of toUtf8.
There is no loss of information when converting to UTF-8.

Change-Id: Iad92977af319b324cbf06f1a24712b31a7836622
Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-05 22:59:12 +02:00
Thomas Fischer
983dde1f2f Avoid adding widget to its own layout
Widgets and layouts added or inserted to a layout are checked for:
- Not being NULL
- Not being the parent widget of a layout or the layout itself,
  respectively

Without this commit, adding a widget to its own layout would result in a
CPU-hogging infinite loop. Now, a warning is written to stderr and the
add or insert function call is ignored.

The checks are implemented as public functions of QLayoutPrivate and
thus accessible in QLayout's descendants to be used in various
"addWidget", "insertWidget", etc functions.

Unlike 'classical' layouts like QGridLayout, QFormLayout does indeed
accept widgets that are NULL. To not break this behavior, any call for
the check functions first tests if the widget or layout, respectively,
to test is NULL or not and calls the check only in the latter case.

Automated tests for QBoxLayout, QGridLayout, and QFormLayout were added.
For an unpatched Qt 5.3, each of those automated tests will freeze as
explained in QTBUG-40609. For a fixed version, warning messages about
invalid parameters to addWidget/addLayout/... calls will be read by
QTest::ignoreMessage, resulting in a passed test.

Change-Id: I1522d5727e643da3f7c025755975aca9f482676d
Task-number: QTBUG-40609
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 00:05:45 +02:00
Samuel Gaist
8206a263ab Add missing private headers warning
Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-04 22:58:57 +02:00
J-P Nurmi
a544ef5906 QCoreTextFontDatabase: reduce memory consumption
ATSFontNotify() allocates over 30MB for no apparent reason for
applications that don't register fonts.

Change-Id: I7bbc97f53b76be1e638de8ca0d1be3a08586cf00
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-04 19:50:19 +02:00