Commit Graph

19342 Commits

Author SHA1 Message Date
Olivier Goffart
3b0c2b7c1b Examples: Add Q_DECL_OVERRIDE to overridden functions
Q_DECL_OVERRIDE (which expands to 'override' for supported compiler)
helps to declare the intent (that it is an overridden function) and
force compilation error when there is no such virtual function in the
base class.
The examples should show the best practice of having it, as it may save
the programmer quite some time in case of change of API or typo in the
function name or arguments.

This change was done automatically with
clang-modernize -add-override -override-macros

And fixed MSVC compilation by removing inline for TorrentViewDelegate::paint

Change-Id: Ice66ae93fae571266f908703d5b8892b2c1ebb1a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-07-15 08:44:44 +02:00
Axel Rasmussen
6d87e3ed40 Rename QPixelFormat enum value to avoid conflict with X.h.
This commit fixes a potential compile error where pixelformat.h would
not compile if X.h from x11proto was included first, since X.h #define's
GrayScale as an integer constant.

Task-number: QTBUG-40087
Change-Id: I7208a204259c6d3a13b5d0cbc98a76bb54b8b494
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-07-14 23:03:18 +02:00
Thiago Macieira
8e69a03921 Doc: update QCoreApplication to be clear that we don't support text UI
Change-Id: Icc032470629201668c085fd74725a2965f09eb47
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-07-14 21:41:44 +02:00
Jerome Pasion
d4cd55daa2 QDoc: Prevent QDoc from outputting the brief for example pages.
Example pages' \brief do not form a complete sentence. The example
pages have proper introductions and descriptions, unlike API pages
which do use the brief information to summarize.

Change-Id: I11f1362cd05e3cf90ae8e1c3a07d2584737fd89c
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-07-14 17:18:19 +02:00
Shawn Rutledge
3f47becec0 Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-07-14 16:44:12 +02:00
Kai Koehne
f6940a7081 QLoggingCategory documentation improvements
Change-Id: I9cc16d01f62d94fa3e7869bf9bb7734c774f82e3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-07-14 16:44:07 +02:00
David Faure
439ee03fc5 tst_qfiledialog: ease debugging of "directoryEntered not emitted".
It can happen when the sidebar only has only one item, due to
"My Computer" being missing.

Change-Id: I2b38fef45139f1dfa20d88059e56185c3163a833
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-14 12:02:34 +02:00
David Faure
564eaa6640 tst_qfiledialog: extend reject-test to test getOpenFileNames etc.
So that this method is at least called once in the test :)

Change-Id: I3b5fc6b7c464d9e56264c709cfa313d475004207
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-14 12:02:20 +02:00
Friedemann Kleint
eb66916082 Fix some compiler warnings in benchmark tests.
main.cpp(332) : warning C4307: '*' : integral constant overflow
tst_qpainter.cpp(1293) : warning C4305: '+=' : truncation from 'double' to 'float'
tst_qpainter.cpp(1474) : warning C4305: '+=' : truncation from 'double' to 'float'
tst_qtbench.cpp(155) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
main.cpp(68) : warning C4189: 'fontHeight' : local variable is initialized but not referenced

Change-Id: If6aadd50df7c5cf7d0f33791c9247730a47ddd27
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-14 10:55:55 +02:00
Frederik Gladhorn
7c495cfea9 Merge remote-tracking branch 'origin/5.3' into dev
Conflicts:
	src/gui/text/qfontengine_qpf2.cpp

Change-Id: Ib04f92c41d0edd55d3aef8fb1708d917fba0f2a8
2014-07-14 10:35:51 +02:00
Friedemann Kleint
a55b01e038 Stabilize tst_QMenu::statusTip().
Instantiate the timer on the stack to prevent it from
interfering with other tests.

Change-Id: I91ffe23b502fcddaeb6d6d3f89ea3d27b083cdb0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-14 10:30:48 +02:00
Christian Strømme
b61ee210e6 Android: Simplify the jni code in QtAndroidClipboard
Let the QJNI classes manage the jni environment and cache the jni
handles. This lets us lazily cache the jni handle until we actually
need them.

Change-Id: Iced91e7cab19bdcab8581e94c6f2dd766fed47ed
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-07-14 02:25:29 +02:00
Christian Strømme
1220a87f8a Android: Simplify the jni code in QAndroidPlatformServices
Remove the use of QtAndroid::AttachedJNIEnv and lazily cache
the openURL() methodID on first use.

Change-Id: I601d13bc7d644d7cb2f78655ad40c7d9566cf3cb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-07-14 02:24:57 +02:00
Christian Strømme
c4b1fffb22 Android: Update QSslSocketPrivate::fetchSslCertificateData()
Replaces the raw jni calls with our own jni wrappers. This allows us
to make use of the centralized cache, avoid global data storage and
use a more optimized way to attach to the jni environment.
This change also removes the JNI_OnLoad() function since it's not
used. If we need to add a JNI_OnLoad() function later, we should find a
more suited place for it.

Change-Id: Id84ead10c27d03d19c160304b1f9853b381a103c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-07-14 02:24:36 +02:00
Jędrzej Nowacki
607462019a Speedup qDebug() << QDate(...)
We really do not need to do string parsing there.

Change-Id: Ie2277d9ff0d0445285b7108023941af111d9baca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-14 00:11:35 +02:00
Olivier Goffart
b6bce68a64 Logging: fix support for %{time format} in QT_MESSAGE_PATTERN
This revert commit de1d5815c1 which
wrongly fixed a typo. There is no typo because we use startsWith
with that constant.

Also added a test because the %{time} support was added in commit
93563952d0 but the test was missing

Change-Id: Ic96e6f21f989ca3a2905ec6c89b93d2627b77b40
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-13 18:20:42 +02:00
Olivier Goffart
9bb493e724 tst_qlogging: put the test for QT_MESSAGE_PATTERN in a data function
Change-Id: I9130b91dfe6bf1ee22431a423ec2d2f9ad62144a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-13 18:20:38 +02:00
Giuseppe D'Angelo
e7665fd8e4 Revert "QRegularExpression: lock a mutex only if there's actual work to do"
Blunder -- two threads may step into this method together,
both see not studied, and both study (with one leaking its study data).

This reverts commit 5fbd787cf9a72621d66604a4898f06ea4365226e.

Change-Id: Ia746925abcad1e43adf4f6f1d495b018de022b07
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-13 17:07:52 +02:00
Olivier Goffart
12a4db710e Revert "Session management for OS X"
Broke tst_QMenu::statusTip by closing the menu while it should not. (and therefore, a QTimer::singleShot that fires while following test are running is making the test fail)

This reverts commit 50c04d6318.

Change-Id: Ib4ef8190f945b915fe268745cc64d471994c5e2d
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-07-13 13:48:19 +02:00
Thiago Macieira
d88e4edcd5 Work around ICC bug in brace initializations containing constexpr
ICC miscompiles this:

struct Inner { int i; constexpr Inner(int i) : i(i) {}};
struct Outer { Inner i; };
const Outer x = { -1 };

(Inner = QBasicAtomicInt; Outer = QtPrivate::RefCount, then again for
QListData::Data)

We expect x to be placed in read-only memory and require no load-time
constructor. ICC unfortunately does not do that. By adding a constexpr
constructor to Outer, it starts behaving like we expect it to, but falls
apart again if you do "const Outer x[]" (the QArrayData statics).

The solution is to probably make the varaibles constexpr too, but that's
a job for the development branch.

Intel issue Id: 6000056211
Intel bug: DPD200534796
Change-Id: Ie9fb5428106486254b7329403890754f300d58c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-12 17:36:46 +02:00
Nico Vertriest
b6d50e2aa6 Doc: edited qtxml.qdocconf
Added dependency for Qt Widgets

Change-Id: I36fbec0738f5671a07b9dd18fc4487573c560cd2
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-07-11 13:45:54 +02:00
Shawn Rutledge
5c92d21cce xcb: QTabletEvents and proximity events correctly identify the tool
The tool is enum TabletDevice reported in QTabletEvent::device().
Each type of tool for each type of tablet has an ID which needs to
be mapped to this enum.

The meaning of the AbsWheel valuator depends on the tool type:
an airbrush sends tangentialPressure in the range -1..+1,
whereas an Art Pen (RotationStylus) sends rotation in degrees.

Because the evdev driver sends valuator changes individually, we
have to store the current value in each TabletData::ValuatorClassInfo
to ensure that each QTabletEvent has complete state information.

[ChangeLog][Platform Specific Changes][X11 / XCB] QTabletEvents
and proximity events correctly identify the tool in use; the
meaning of certain valuators depends on the tool; and the valuators'
current values are not lost between events

Task-number: QTBUG-39666
Task-number: QTBUG-39573
Task-number: QTBUG-39570
Change-Id: I6be242ee57e2ad0848060e04f20c0dd08954a734
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-07-11 11:10:51 +02:00
Christian Strømme
ff7fdf78ef Android: New bearer plugin
Replacement for the the generic bearer plugin.
Compared to the generic bearer engine, this plugin provides a more
detailed overview of the network configurations on Android.

Added features are:
- Correct bearer type, also for mobile connections.
- Connection state (e.g., roaming).
- Data statistics (On devices that supports it).
- Polling is not required.

Change-Id: I728cb91e04a66343648c0add6be2a003caca0f1f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-07-10 23:09:31 +02:00
Samuel Gaist
50c04d6318 Session management for OS X
This patch aims to implement the session management available on OS X.
Currently applicationShouldTerminate is just a go through that closes
everything and ends the application. The new implementation calls
first appCommitData and cancels the termination properly if required.
This means that if a user wishes to logout, Qt applications can now
cancel that like e.g. answering to Safari asking whether it is ok to
close because of a number of opened tab/window.

Task-number: QTBUG-33034
Change-Id: Icedc8590a1c0934d9bc87d3a43d6702a9903bfb8
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-07-10 21:54:19 +02:00
Andrew Knight
53ed4de022 winrt: Clean up platform message dialog helper
- Remove "Platform" from class name for consistency
- Use ComPtr and HRESULT checking where missing
- Use UICommand ID class to reduce callback complexity
- Use dialog completed callback to fix failed repeated dialog opening

These changes have been tested with the QtQuick.Dialogs message dialog
example, and all features appear to be working. Note that the WinRT
dialog supports a maximum of three buttons, though, and a warning is
printed if this number is exceeded.

Similarly to Android, the native hooks can be now be disabled by
using qputenv("QT_USE_WINRT_NATIVE_DIALOGS", "0").

Task-number: QTBUG-38115
Task-number: QTBUG-39868
Change-Id: I9943c7c11bd640790db68219cefdca1a680e96ec
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-07-10 21:37:25 +02:00
Andrew Knight
fff0844735 winrt: Introduce theme palette
Use the colors returned by WinRT's UISettings class to construct the
system palette.

Change-Id: Id0d99c7b2e3df209de0755ee72a0d2bda67fda8c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Jochen Seemann <seemann.jochen@gmail.com>
2014-07-10 21:37:18 +02:00
Andrew Knight
bb5b25e40d winrt: Clean up platform theme
- Drop "Platform" from class name for consistency
- Move styleHint() into theme class for better code reuse
- Use ComPtr and result checking
- Remove obsolete WinRT ifdefs

Change-Id: Id26bd75739a9665f61ee2e70eb3fb36747b75410
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-07-10 21:37:05 +02:00
Philippe Lelong
4a1120a2f1 Fix various issues with qandroidstyle
-Add style for checkable QGroupBox
 -Add style for checkable QItemView
 -Fix QSpinboxes contents size and position
 -Fix QTreeView and QTableView headers size and position
 -Fix Slider thumb position incorrect if minimum is not zero
Task-number: QTBUG-38717
Task-number: QTBUG-38325
Task-number: QTBUG-37965
Change-Id: I737f8d6f2d1c25d16aca0ce5de6b81884839409d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-07-10 16:53:11 +02:00
Eskil Abrahamsen Blomfeldt
0cbebb21cc Android: Prefer "Droid Serif" as default serif font
I've also updated the qfont test so it passes on Android now. Note that
there are no suitable cursive/fantasy fonts on Android, so the regular
default "Roboto" (or "Droid Sans" on older devices) will be picked here
instead.

[ChangeLog][Android] Fixed font selection to prefer "Droid Serif" when
Serif style hint is set on QFont.

Change-Id: I294eebcc4d79410e435bdddce552acc6044753b2
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-07-10 16:23:50 +02:00
Aleix Pol
52eccc6cfa Introduce a new warning in moc, to notify about duplicated properties
At the moment, it's possible to have 2 properties with the same name,
which doesn't make much sense. Notify the user about that so she can
react on it.

Change-Id: I4865b71730921b79ce9dd8abb0cc760b3f1dbfd8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-07-10 16:10:59 +02:00
Ivan Komissarov
e899693aa4 Fixed wrong function name in a file snippet
Change-Id: I453c5085685badeb6577009a0c6935dfe384258f
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-07-10 16:04:13 +02:00
Yoann Lopes
dddd5ebb08 Android: enable FBO readback workaround for more devices.
Now enabled for all devices equipped with a GPU from the Mali-4xx
series or Adreno 2xx series.

Task-number: QTBUG-40131
Change-Id: I2923c07033ef768aceec6f5590dbb6f26aa67087
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-07-10 16:00:28 +02:00
Jorgen Lind
0af228700e Make QWindow::close go through the QWindowSystemInterface
This causes a closeEvent to be sent for all calls to close.

As a side effect destroy now handles more of the state in
QGuiApplication.

[ChangeLog][QtGui][QWindow] QWindow::close() sends a QCloseEvent
which must be accepted before destroy() will be called. destroy()
is the function to close the window without confirmation.

Task-number: QTBUG-40093
Change-Id: I1ce09da4940fc29fae8decf40548a42e3bec6eca
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-10 15:39:38 +02:00
Jerome Pasion
c05fd55b96 QDoc: Edited title generation for QML and C++ API pages
-added "QML Type" for QML types
-reworded basic type pages by adding "QML Basic Type" at the end
-streamlined variables in QDoc related to the HTML and page titles.

These two changes were implemented in 5.3 branch, but got lost during
the merge into dev:
1243940f83
8e5e9d7987
This commit restores the changes while ammending similar fixes

Change-Id: I996b18f020b392aceeb40da7797838aca4a0626f
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-07-10 14:05:33 +02:00
Frederik Gladhorn
c10ba1ada0 QAccessible::PushButton is deprecated in favor of just Button
Change-Id: I2878a28f18f3a004705ec50f616846f6cd00eed1
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-07-10 13:33:23 +02:00
Andras Becsi
8663ccb039 Add support for querying "eglconfig" through the xcb native interface
We already support this for eglfs but for a desktop Qt configured with
-opengl es2 we need to expose it through xcb as well.

Change-Id: I36d0e255d8c86cc1cec56015f33470f61d7df466
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-07-10 13:26:26 +02:00
Jędrzej Nowacki
c587e5a4da Improve QString::arg test
The function gives a warning if an argument doesn't exist.

Change-Id: I6a4bbbaf2fd241ced06dc71edfe4ef69732606d1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-07-10 13:14:51 +02:00
Jędrzej Nowacki
3746eedeab Update QVariant tests
Remove old message handler hack as we have a new and better api to
ignore warning messages.

Change-Id: Id967b2672fe3e3638db9977500118a19c2afb730
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-10 13:14:40 +02:00
Frederik Gladhorn
776ddcab2c Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-07-10 13:13:55 +02:00
Eskil Abrahamsen Blomfeldt
5834360741 Fix fallbacks for adapted common script
When the platform plugin gives us specific fallbacks for a
specific script, we need to respect this, and load the correct
font family regardless of which writing systems it supports.

This is especially important since the common script is adapted
to match surrounding, proper scripts, so characters such as
digits next to e.g. Hebrew text will be marked as Hebrew. On
stock Android, there is a single Hebrew font, and this would
previously be put in all fallback slots for Hebrew regardless of
what fallback fonts were dictated by the platform plugin. Since
this font does not support the digits, they would show up as boxes.

[ChangeLog][Android] Fixed common characters like digits and
punctuation showing as boxes when positioned next to non-latin
scripts.

Task-number: QTBUG-39377
Change-Id: I1555e208a8ddc587c0bbdbfff1600cafdd9442e9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-07-10 12:38:36 +02:00
Frederik Gladhorn
f035786021 Merge remote-tracking branch 'origin/5.3' into dev
Change-Id: Ia12ffdb27ecdf25c2a2bdb0eed1945387502108a
2014-07-10 10:11:11 +02:00
Eskil Abrahamsen Blomfeldt
1dd9a0af4f Fix fallbacks for adapted common script
When the platform plugin gives us specific fallbacks for a
specific script, we need to respect this, and load the correct
font family regardless of which writing systems it supports.

This is especially important since the common script is adapted
to match surrounding, proper scripts, so characters such as
digits next to e.g. Hebrew text will be marked as Hebrew. On
stock Android, there is a single Hebrew font, and this would
previously be put in all fallback slots for Hebrew regardless of
what fallback fonts were dictated by the platform plugin. Since
this font does not support the digits, they would show up as boxes.

[ChangeLog][Android] Fixed common characters like digits and
punctuation showing as boxes when positioned next to non-latin
scripts.

Task-number: QTBUG-39377
Change-Id: I1555e208a8ddc587c0bbdbfff1600cafdd9442e9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-07-10 10:01:49 +02:00
Kai Koehne
6d166c8822 Add QDebug::noquote() stream modifier
Allow the user to disable the quoting of QString, QByteArray,
QStringLiteral by passing a "noquote()" stream modifier.

This requires another flag to be added to QDebug::Stream. To
keep BC we're using the QMessageLogContext::version field
to differentiate between QDebug streams created by earlier
versions.

Task-number: QTBUG-37146
Change-Id: I9b215eabfcfd754af16ea87f3ef928d698e37d77
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-10 09:27:44 +02:00
Friedemann Kleint
27797cb37a MSVC: Fix the compilation of benchmark tests with strict string literals.
Introduced by 9f0e5d00ab .

Change-Id: I704501bd7e543d971f9b8c9e75746b5749126c5f
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-07-10 09:02:04 +02:00
Ivan Komissarov
84c5e4866f Added autoHide property to QTabBar
This property is used to automatically hide tab bar if it has only one
tab.

Originally-by: Denis Kovalskiy <denimnumber1@gmail.com>
Change-Id: I6967f760010fa55bad6a5986c29abe7ccf625cf8
Reviewed-by: David Faure <david.faure@kdab.com>
2014-07-10 08:29:10 +02:00
Rainer Keller
5835407df1 Check for boost header in sysroot
The check has to detect if boost header is present in the system we are
building for.

Change-Id: I700a11df208c8852ba094d8bff387ad21fa309b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-07-10 08:10:52 +02:00
Friedemann Kleint
72024fd50c Reduce repetitive invocations of QFINDTESTDATA.
Store the file names in variables instead.

Task-number: QTBUG-38890
Change-Id: I65f28bb62674f14aa099e935a9d7a4e9e6e90ba9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-10 07:07:30 +02:00
David Faure
745448d3ea QFileDialog: compile with QT_NO_URL_CAST_FROM_STRING.
This is useful to detect confusions between local paths and URLs.

Change-Id: I1aa72ae10186984812691c8a1a4e843db3c85246
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-09 23:46:37 +02:00
David Faure
e7b4aaadfa qfiledialog: clean up dead code.
Q_WS_WIN is never defined, and the qt_win_get_* functions don't exist
anymore. The QPA plugin takes care of doing the Windows-specific handling
for the file dialog.

Change-Id: Icdf9aed7da3db8ed2bd71d60f821869340ec1041
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-09 23:46:01 +02:00
Peter Hartmann
916c9d469b QSslCertificate: blacklist NIC certificates from India
Those intermediate certificates were used to issue "unauthorized"
certificates according to
http://googleonlinesecurity.blogspot.de/2014/07/maintaining-digital-certificate-security.html
, and are by default trusted on Windows, so to be safe we blacklist
them here.

Change-Id: I9891c5bee2dd82c22eb0f45e9b04abd25efeb596
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-07-09 21:30:11 +02:00