Commit Graph

5304 Commits

Author SHA1 Message Date
James Turner
c23e8f932b Fix Mac menu-merging case-sensitivity.
Use case-insensitive string comparisons to deal with any combination of case in the target or menu text correctly. Fixes issues reported by BHughes in TextEdit and Creator.

Change-Id: Ic3b577bf9034659b2de4aa206757b3a5a303a7b8
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-06-11 11:41:08 +02:00
Christoph Schleifenbaum
2a8c423577 Deprecate QMainWindow::unifiedTitleAndToolBarOnMac
Update documentation. Implementation is left for
now.

There is currently no replacement; once we have
that in place we'll update the docs agin to point
to it.

Change-Id: I8b4532702938398dc5b4eef5da2b3f9dfb68382f
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-11 11:22:07 +02:00
Morten Johan Sorvig
ee895bdbb1 Remove QtWidgets include.
Change-Id: I39ff73ce0dbfe36634b5331538165e636f62e57c
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-11 11:21:49 +02:00
Morten Johan Sorvig
4e2199617c Cocoa: Remove QtWidgets dependencies.
Make the file/color dialog helpers use QCoreApplication::
translate("QDialogButtonBox", text) instead of
QDialogButtonBox::tr(text)

Change-Id: I7ee4c32f8f8b9cd002836e24b962ef1c0f2e0737
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-11 11:21:37 +02:00
Jeremy Katz
69f0782c09 update QStandardPaths::standardLocations() documentation
Remove the reference to PATH, as it may confuse developers who expect
a separator between locations. The ordering has been made explicit,
including the position of writableLocation() if it can be determined.
Note that some implementations may allow the empty string.

Change-Id: I134db44dd8bea437824a1d0bf8ed373ec655ab04
Reviewed-by: David Faure <faure@kde.org>
2012-06-11 00:37:12 +02:00
Lars Knoll
b2c1550564 Use QCollator in QString and remove it from qlocale_icu
Change-Id: Ic94439943999382f8050668edfb67d3b75ac1df4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-10 19:09:04 +02:00
Lars Knoll
1e9be1327b Add proper collation support to Qt
QString::localeAwareCompare() has always been a broken
way to support collation. The current implementation is
not even thread safe.

This adds a proper collation class that fixes the problems
and finally allows Qt to sort properly according to locale
rules.

The class is private for now, but is intendent to be made
public with 5.1

Change-Id: Idb4e75ff68a398c9813af622af884a90898d2be9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-10 19:08:56 +02:00
Lars Knoll
97e177e58d Refactor the ICU code for QLocale
Clean up the ICU code and make it thread-safe. Add a
QIcuData structure to QLocalePrivate, that contains
ICU specific data.

Link against ICU directly, greatly simplifying the
code.

Also fix a bug in the locale specific case conversion
code that would cause it to fail and fall back to the
QString code if the output string was larger than the
input.

Change-Id: Ie67e5ea14fa204ebc5887d7aaeb1a4f3ecaf8697
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-10 19:08:49 +02:00
Konstantin Ritt
c631927b76 Regenerate the Unicode tables with UCD 6.1.0
Task-number: QTBUG-1963
Task-number: QTBUG-5472
Task-number: QTBUG-12144
Task-number: QTBUG-18360
Task-number: QTBUG-23654

Change-Id: Ida09ad657c4b012eca654fcb79608b7cdeb5d60d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:58:17 +02:00
Konstantin Ritt
12e0319213 Line Breaking Algorithm: handle the Object Replacement Character
See http://www.unicode.org/reports/tr14/#CB
and http://www.unicode.org/reports/tr14/#LB20 for details

Change-Id: Ice0aa2b2ce81f6e39839a353240420436eddd754
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:58:13 +02:00
Konstantin Ritt
c8dd0de1a6 Line Breaking Algorithm: don't break inside numeric expressions
Change-Id: I8362663454e4c6604ecb6289ae8009d47c78aeb1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:58:09 +02:00
Konstantin Ritt
d64cb5f707 Update the Unicode Text Breaking Algorithm implementation
to make it conformant to the Unicode 6.1 specifications #14 and #29.

The most important changes are:
* The implementation has been reworked from scratch to fix all known bugs;
* Separate-out the grapheme and the line breaking implementation to eliminate
  an overhead due to calculating unnecessary breaks;
* Stop using deprecated SG class in favor of resolving pairs of surrogates;
* A proper support for SMP code points;
* Support for extended grapheme clusters (a drop-in replacement for the legacy
  grapheme clusters as of Unicode 5.1);
* The hardcoded tailoring of UBA has been eliminated which breaks the 7 years-old
  lineBreaking test. Some later, we'll investigate if such a tailoring is still needed.

Change-Id: I9f5867b3cec753b4fc120bc5a7e20f9a73d89370
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:58:02 +02:00
Konstantin Ritt
60e1892d83 Update the qunicodetables generator to deal with UCD 6.1 files
Change-Id: If22018ff83cfc6b9c984f689648da038fce11d84
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:57:49 +02:00
Thiago Macieira
2176a4f04f Reorganise the painting.pri file after the last round of cleanups
Change-Id: I35f5356fc59d109074d39c4fafd608540743479a
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-06-10 15:56:46 +02:00
Kai Koehne
0f73d7bb35 Logging: Remove outdated QMessageHandler
Commit d9a1c2dff replaced QMessageHandler with QtMessageHandler. However,
the old signature was still supported for a grace period.

Change-Id: I3141499efdc749460b77de1ceec82f312e904bec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-10 15:55:49 +02:00
Johannes Zellner
16548ce85e evdevmouse: send correct event position for wheel events
The current position for mouse events is synchronized in the mousemanager,
thus the wheel event needs to pick the event position from there.

Change-Id: I1e73a0154b596885c7092f0a74e6dd448deb428c
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-06-10 09:39:36 +02:00
Thiago Macieira
612fae1ae6 Add support for the x86intrin.h header on GCC systems.
This header can be included at any time on x86 systems and is present
since the GCC versiosn that also support AVX.  It contains intrinsics
for instructions that have been present in x86 CPUs since the dawn of
time.

Change-Id: I9adb066c2c0b56ce8fd5ed7366716038f1254502
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-09 10:45:01 +02:00
Thiago Macieira
fbabbe63c5 Use UTF-8 in the QtTest data and benchmark tags
Future-proofing. Since Qt source code is now mandated to be in UTF-8,
it is entirely possible that someone will use non-ASCII in data tags.

Though it would be interesting to see how to access them from the
Windows command-line.

Change-Id: I880fc312432b62143888ff1e1d9abbd54f704601
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-06-09 10:45:01 +02:00
Miikka Heikkinen
5e6b167fea Windows: Fix window positioning for ActiveQt servers
The toplevel window for an embedded ActiveQt server does not have
a parent QWindow, but it does have a parent HWND, so is not a real
toplevel. Enable using a QWindow property to inform windows platfrom
plugin that a window is embedded and handle geometry accordingly.

Task-number: QTBUG-25808
Change-Id: Ie26c53b587c312b1df397b25cb944019c020b8de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-09 10:45:01 +02:00
Jonathan Liu
dfe5987161 QWizard/Win: Drag window on Vista with only left mouse button
The QWizard window should only be draggable using the left mouse button
on Vista.

Change-Id: Ie6ec118cbb48440c5dc6b84c4361119b1bbbd0cf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-09 10:45:01 +02:00
Friedemann Kleint
1fb176eaf4 QWidget::destroy(): Release mouse and keyboard grab.
This used to happen in the platform widget code.

Task-number: QTBUG-26079

Change-Id: Id6de7473c2fa4381a39114d5122e06e3bde159fa
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-09 10:45:01 +02:00
Joerg Bornemann
e03d1ae953 implement Qt::TranslucentBackground for Windows
Adapted the Qt 4.8 implementation of translucent widgets in
the Windows platform plugin. This is only working for non-OpenGL
top level Windows.

Change-Id: Ic4c1c52d33b380f530f6a07e96c0c154a0571415
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-09 08:34:56 +02:00
John Layt
14f45e535b QtPrintSupport - Add CUPS printer and options queries to plugin
Implement initial support in the CUPS plugin for directly calling CUPS
to obtain printer list and basic printer info rather than QCupsSupport.

Add api to the plugin to return any options for a printer, usually IPP
options as implemented for CUPS, but whatever applies for the host
print system.

Future changes will add support for returning the PPD options.  This
api may eventually be added to QPrinterInfo, but not in 5.0.

Change-Id: I6c8bae4c9295009599e6ab31382f5fff4c93981f
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-06-09 01:46:36 +02:00
Konstantin Ritt
80ceba9a36 QZip: improve reading of zip files, fix some edge cases in writing
This supercede https://codereview.qt-project.org/#change,25111 and fixes
some more cases;
The autotest crash is fixed as well (but the test itself omitted due to
.pro file misconfiguration)

Change-Id: I4a3adde18b4f9a8ac9822f700eee71d2a12b9c2c
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2012-06-08 21:49:58 +02:00
Lars Knoll
09992c654d Remove QFactoryInterface from style plugins
Change-Id: I5c41f1c8b91b5e1117b9163c137de4bf5f51099c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 21:34:45 +02:00
John Layt
20c7fa62ca QtPrintSupport: Move printer list into plugin base class
Move the cached printer list from the Windows plugin into the base
class so the CUPS plugin can also use it in a subsequent commit.

Change-Id: Idf5fb7fc49b1820aad58f16e8854ab9120caa193
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-06-08 18:44:55 +02:00
Miikka Heikkinen
f2df9cef75 Fix crash in qt_qpa_core_dispatcher() at application exit.
In some situations it is possible to get events when QCoreApplication
has already cleared the 'self' pointer and will thus not return an
instance. For example, destroying screen at application exit when
there are parentless dialogs open will result in hiding the dialog,
which at least in Windows causes a call to
QWindowSystemInterface::handleExposeEvent() which will need the core
dispatcher down the line.

Fixed the crash by checking if the QCoreApplication instance is valid
instead of blindly using it. This should cause no problem as unhandled
events are simply queued.

Task-number: QTBUG-26061
Change-Id: Ide2350a62208433728e0271192c1da4b1efacc9b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-08 18:39:02 +02:00
Girish Ramakrishnan
a15aa822b7 Remove unused variable inSetParent
Change-Id: Ie65514209f14d8f8b2396c1d6e37cd8c3e4c0c1a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-08 18:35:40 +02:00
Stephen Kelly
14cd267839 Use variadic macros where available to make QSKIP source compatible.
Otherwise this is a large source incompatbility during porting, so
it makes sense to provide the option of using C++11 for that.

Change-Id: I9792b3ae2c1fa3743bc9a2e74380134ea2f24add
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 18:10:18 +02:00
Markku Heikkila
9e75354aab Fix crash in QTreeWidgetItem::sortChildren when adding new item.
This is a cherry-pick of 4f388c383e39b598d997e21bd9a4f16d89bd0625
from February

Recursive call is caused if user code calls QtreeWidgetItem()::sortChildren and
sorting is enbled in QTreeWidget.

First call is from user code and second is caused by timer.
When timer expires second call is made.

This recursion is prevented with QTreeModel::SkipSorting skipSorting()
in QTreeWidgetItem::sortChildren();

Task-number: QTBUG-20345
Change-Id: Ibf73e69274423f31397a9e391bfba7d5c4103a3c
Reviewed-by: Markku Tapio Heikkilä <markku.heikkila@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-06-08 18:09:07 +02:00
Casper van Donderen
7525e85798 QDoc: Only print modulename::type on collision pages.
Change-Id: I090698b106456370f6c0982006243304f87dc70c
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-06-08 13:38:56 +02:00
John Layt
271b484b00 QtPrintSupport: Move plugin access of QPrinterInfo internals to base
Move all plugin methods requiring access to QPrinterInfo internals
into the plugin base class, and remove the plugin classes as friends
from QPrinterInfo.

Change-Id: Ic527efc681e198abf19e038dd77c36bb8017d049
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-06-08 13:33:50 +02:00
Morten Johan Sorvig
2922f85e70 Reduce QtWidgets dependencies in the Cocoa plugin.
b8246f08 added the new menus implementation which
removes one of the major QtWidget dependencies.

Continuing on the path to QtWidget-freedom this
commit removes the following:
- qmenu_mac.h/mm. Not used.
- FORMS += filedialog.ui. Not used.
- qt_strippedText from qaction.cpp. Duplicate.
- Misc stray includes.

What is left should be the dependencies needed by
the print engine implementation. These will be
handled at a later time.

Change-Id: I0cead4cdaddcebd402d30c6112f3e889d0f28740
Conflicts:
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-08 13:00:03 +02:00
Friedemann Kleint
94a81928ac Fix a crash when calling effectiveWinId() on parentless widgets.
Remove the assert as it also triggers when the widget is one
that currently has no parent (setParent(0)).
Check that the WinId is != 0 in the cursor code.

Change-Id: I711fc600f1d803c8f01c15df87984e742a4c23d2
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-06-08 08:02:13 +02:00
Frederik Gladhorn
21e0d16411 Remove widgets lib dependency on platformsupport.
Instead of the dependency add the one needed function as virtual to
the QPlatformServices in QtGui.

Change-Id: Ia4455f5ac88ec4d0480bd81635cebba62bbd8ac5
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-08 04:47:59 +02:00
Mitch Curtis
168c583a78 Allow ISODate string without seconds in QTime::fromString().
According to ISO 8601 (section 4.2.2.3), seconds can be omitted
from a string representing time.

Task-number: QTBUG-2813
Change-Id: I2578f290845e46a8f49be489f1d7427984ae7f08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:55:27 +02:00
aavit
1f461ac45b Namespace the bundled zlib symbols, to avoid clash with user zlib
When Qt is being compiled and is using the bundled zlib, QtCore needs
to export the zlib symbols, since zlib is needed in other Qt
libraries as well. That gives a danger of a potentially disastrous
symbol clash if the user later on links with both Qt and an external
zlib (ref. e.g. QTBUG-15071).

This commit enables a zlib compilation flag that causes all zlib
symbols to be redefined with a prefix. Hence, they will not clash
with a standard zlib.

A minor drawback is that zlib.h will now have #defines for a few
semi-normal identifiers. Hence, a couple of more changes are done:
In the private qzip code, the identifer crc32 had to be renamed.
QHttpNetworkReplyPrivate needed no change, but as a defensive measure
the #include <zlib.h> is moved from the _p.h file to the .cpp file,
to avoid surprising compilation errors later in code that include
that header.

This commit does not in itself solve the issue of how to let Qt
libraries outside of qtbase use the same bundled zlib, but it is
a prerequisite for that.

Change-Id: If84105901a8c90d35009faffe660c85a6bd2fee5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:53:10 +02:00
Lars Knoll
02191b6e4b Remove dependency from QFactoryInterface for the print plugin
Change-Id: Ia35890b72e7797ef655bf97b4a34af2908657c0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:20 +02:00
Lars Knoll
7715a2d0a5 Remove QFactoryInterface from the input plugins
Change-Id: Ia4a9dc5b4ef276dca39681848e531b4c9e4f64e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:16 +02:00
Lars Knoll
cf9264bb6b Remove QFactoryInterface from bearer plugins
Change-Id: I8d6736e56f34f49041fff409d040634475eb0bf5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:13 +02:00
Lars Knoll
0b69385e42 Remove the QFactoryInterface dependency from platform plugins
Change-Id: I4010e59dcd8a790e06bb9a0ccf3cc9a5c7737ed1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:09 +02:00
Lars Knoll
d173da37ee Remove QFactoryInterface from the generic plugins
Change-Id: I5a4351ca4b6605f9628496701bb8c6063cf36c78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:09 +02:00
Lars Knoll
1402660575 Remove QFactoryInterface from picture plugins
Change-Id: I7b02cbfb850d6a9fc90c1eb1e12a9950baf61e77
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:05 +02:00
Lars Knoll
dcf3c95175 Remove QFactoryInterface dependency from icon plugins
Change-Id: I65bed1646f3c5e89329a6bbe3dcdbdb5660b7004
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:05 +02:00
Lars Knoll
2903db8b4c Remove the QFactoryInterface dependency from accessible plugins
QFactoryInterface is not needed anymore and will get removed soon.

Change-Id: Ib2806200b1a7f4a45d62e2b556380946ef68f585
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-06-08 00:12:03 +02:00
Lars Knoll
c9d040c1f5 Don't inherit from QFactoryInterface for image plugins
QFactoryInterface is obsolete now that we have the new plugins loading
mechanism, where we can get the keys out of the plugin without
having to load it. Remove it from QImageIOHandlerFactoryInterface
as a first step of getting completely rid of it.

Change-Id: I856b149dd20131e1cdcdcb271c1a355c9e0da6ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-08 00:12:00 +02:00
John Layt
b9fc8bc10f SIC: QPrintSupport - Remove options api from QPageSetupDialog
QPageSetupDialog has an enum PageSetupDialogOption, however one option
had support removed in Qt 4.5 and the remaining 2 are actually for an
internal implementation detail that could lead to memory leaks if
changed by an app.

This change removes the enum and the api as they is now useless.

Change-Id: I9a3ab689dcab57151de894db5ebf22f6ad90d71e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-06-07 21:18:36 +02:00
Konstantin Ritt
88e735c9c9 Shift positions for lineBreakType
to keep them consistent with positions for all other flags.
This changes the internal behavior so that attributes[0].lineBreakType now means
"break opportunity at start of the text (before the first character in the string)"
and is always assigned with HB_NoBreak to conform rule LB2
(see http://www.unicode.org/reports/tr14/#LB2).

The current implementation is based on the sample implementation from tr14
that aimed to be as simple as possible rather than to be optimal.
From now, we can use pieces of the attributes array "as is"
without having to adjust some positions. Or we can analize some long text
by chunks (e.g. paragraph by paragraph) and consume less memory.

This introduces a minor overhead that will be eliminated shortly.

Change-Id: Ic873a05a9d5203b1c3d5aff2e4445a3f034c4bd2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 21:18:36 +02:00
Konstantin Ritt
8aac04f705 QTextBoundaryFinder: Consider soft hyphen as line breaking opportunity
SoftHyphen enum value was added to specify such a boundary reason

Change-Id: I4248909eed6ab8cbca419de4dcf9fe917620a158
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 21:18:36 +02:00
Konstantin Ritt
824180a122 Set the whiteSpace flag outside the grapheme and the line breaking loop
The white spaces determination doesn't belong to the text breaking algorithm.
A proper breaking implementation shouldn't assume spaces are
break opportunities (actually, space is allowed to be a grapheme base);
However, the whiteSpace flag should never be checked alone while iterating
over the text to find the space sequence; the grapheme boundaries should always
be taken into account. This covers the SMP code points in UTF-16 text and
graphemes that consist of a space followed with one or more grapheme extenders.

This introduces a minor overhead that would be eliminated some later.

Change-Id: Ic2cc7f485631fd0b436fc256ce112ded5f94fc07
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 21:18:36 +02:00