Commit Graph

17375 Commits

Author SHA1 Message Date
BogDan Vatra
f640d3f132 Force surface repaint after is (re)created.
Every time when a surface is (re)created we must paint something in it
otherwise it will appear black.

Task-number: QTBUG-36594
Change-Id: Ib4baaef189f59a83a251cf89db30b0a3aec16d92
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-02-07 04:47:04 +01:00
Gabriel de Dietrich
42aa8aa8c2 Cocoa: Handle gracefully closing a window without event dispatcher
Task-number: QTBUG-36696

Change-Id: I799eb351ee8ac1529cfbf009df3e7d57ec3a24ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-06 20:50:05 +01:00
Andy Shaw
c8172953ed Fix printing with a custom paper specified.
If DMPAPER_USER is set from the print dialog then it is expected that
the specific member variables to get the custom width and length are
used. The size returned by querying the DC_PAPERSIZE is some random
default and is not the one actually requested by the user.

Also ensure that when it is a custom paper size from the driver
itself that we store the right paper size.

Change-Id: I760b8429ca1b01f5e303f2111b8d7ca1795c8ab8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-06 17:27:37 +01:00
Nico Vertriest
845716d629 Doc: corrected description of QTableWidget::clear()
Task-number: QTBUG-36329
Change-Id: I3a78311bcb076b414ecf1ecf866e4ed60c391126
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-02-06 17:15:38 +01:00
Andy Shaw
c36aa88683 Fix the docs on when setDocument() deletes the previous document
Change-Id: I08d162a1c1e1765213205e63183ed75b2491374d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-02-06 17:11:17 +01:00
Richard Moe Gustavsen
577909b59a iOS: return correct uiview for IM rectangles
UITextView has a property for specifying which UIView the CGRects
you return should be aligned with. This makes a difference for
widgets when not using alien, since then the view that draws the
text will usually not be the same as the view that backs
the top level QWindow.

Change-Id: I240d63c98544c39308cd91465ee84351e7d7d1f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:20:11 +01:00
Richard Moe Gustavsen
865ef95107 iOS: be more specific about IM callbacks to iOS
No need to call textWillChange all the time if the text is
really not changing. And report that selectionWillChange
when Qt reports that it has changed.

Change-Id: I7bd9f540cd9302c37888926a6152b803cc871ccb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:20:06 +01:00
Richard Moe Gustavsen
f9a994e707 iOS: return styling hints for text correction pop-ups
By returning the font used at the cursor position, the
correction pop-up will be resized to match the
point size, and the text marking will get correct
height.

Change-Id: I362579b793794835323bb9ceb5ddb4655526f392
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:20:01 +01:00
Richard Moe Gustavsen
6b212351e2 iOS: send backspace events directly
For legacy reasons, we send IM events to the focus
object directly instead of through QPA. To be consistent,
and to ensure that IM and key events end up at the same
object in the same order, we need to send key events
directly to the focus object as well.
We should consider fixing up QPA to support IM events
better, but this will do for now.

Change-Id: I8a18a1f7b7295e5c64a109fb98eee928fae06a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:57 +01:00
Richard Moe Gustavsen
35dc77f8db iOS: send IM events instead of fake key events
Sending faked key events is not such a good idea, since:
1. We don't get key events on iOS, but text events
2. We cannot determine correct key code or modifiers, nor
    do we want to fake modifer press/release etc.
3. Android uses IM for all text input

So it seems that the correct solution is to avoid sending
key events in the first place. This will also bring the iOS
port on par with the Android port.

Change-Id: Ibac1d335184e62eb4185cfd4218a0ec73dffb2c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:53 +01:00
Richard Moe Gustavsen
60fe9fb018 iOS: add spell checking support
We don't have a separate enum just for spell checking in Qt, but
Qt::ImhNoPredicitiveText should cover it. So use it
to enable/disable both spell checking and auto completion.

Change-Id: I7ad661cb7d720988f13bc1ed940573006c0ce229
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:49 +01:00
Richard Moe Gustavsen
7eb8b67c8b iOS: implement support for input methods
This change will add support for input methods, word
completion, spell checking and related functionality.

Change-Id: I41d4de1cab521c679d414cfc7c1a2d0f9c1fcaaf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:44 +01:00
Richard Moe Gustavsen
e60357fa9e iOS: move key/text input into separate category
Change-Id: I62c588226b307d51f7f88b1cc0c1e00c0d0f14c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:37 +01:00
Richard Moe Gustavsen
3c9cd5876f iOS: move QUIView interface decl into separate header file
Change-Id: Idc90d85859229d49b1deecc2472b330f0adb1ef8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:32 +01:00
Richard Moe Gustavsen
d44b6da7c2 iOS: change logic for when to scroll screen
The current implementation will stop scrolling the screen to reveal
the cursor if the input item changes transformation. This to not
interfere with flicking etc. This strategy turns out to be too
strict, as some qml apps/games can easily have small animations
applied (e.g qtquick cork board example) that moves or scales
the text areas (or their parents) upon focus.

So instead of relying on input item transformation, we now
scroll whenever the cursor changes position inside the input
item (in addition to orientation changes etc). We also
refactor scrollRootView into two functions, since we in
many cases know if the keyboard should scroll up or down
already when the call is made.

Change-Id: If5bf349139eed69823cfc8986bb4b32c93bdf91b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-06 14:19:19 +01:00
Konstantin Ritt
f864bdaf59 Get rid of SpecialData::addFormatIndices
and rename SpecialData:: resolvedFormatIndices to resolvedFormats.
Instead, resolvedFormats now stores QTextCharFormat shared copies.

Change-Id: I4a22cb3f5679b980ef52d47e4e1935663dd257ea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-06 11:40:22 +01:00
Konstantin Ritt
903b9d41f7 Decrease code duplication
Check engine's supported scripts in a single place
and remove unused script parameter from fontEngine().

Change-Id: Ic153803bef519320c370b058e77eac1a4d92afd0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-06 11:38:49 +01:00
Konstantin Ritt
b13b63e99c Clean-up some leftovers
Change-Id: Ia7fb57831af55cf8e0403dbdef2e73f9957fccf7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-06 11:38:32 +01:00
Konstantin Ritt
11fe2bcd7b Fix japanese text rendering with Harfbuzz-NG
In rendering, treat (Hiragana|Katakana|Han)+ sequence like Han.

Task-number: QTBUG-36066
Change-Id: I3b5d2833e73431b07fa0df859b5d716357374cf4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-06 11:38:26 +01:00
Allan Sandfeld Jensen
57fe9bd2c6 Emit ScreenChanged events on X11
We do not currently emit screenchanged events when a window is moved
to another screen on X11.

This patch emits the event when a window no longer intersects with
its current screen, and switches to the first intersecting screen.

Change-Id: Ie40d6eb67b85bd961eeb348bc43e4f308ee22dba
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-02-06 09:45:00 +01:00
Lars Knoll
fe3637a70f Remove TableFormat as FormatType from QTextFormat
The enum value is unused, a QTextTableFormat is actually documented
to have a FormatType of FrameFormat, and isTableFormat() etc. do
the right thing.

Task-number: QTBUG-35114
Change-Id: I2f3305630b92f117c1f89b85460457265e5af126
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-06 08:03:55 +01:00
Morten Johan Sørvig
9e6f0f16ab Cocoa: Add improved cursor updating code path.
It's possible to use the cursorRect API in the cases
where QCocoaWindow has a NSWindow. This is true for
all top-level QCococaWindows today.

Task-number: QTBUG-35659
Change-Id: Iefb2c1c022448e19a9c005a808e0c81abe9281ea
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-02-06 07:52:26 +01:00
Thiago Macieira
d084590d2b Remove unused private member (fixes compilation with Clang 3.4)
qkmsscreen.h:114:18: error: private field 'm_refreshTime' is not used

Change-Id: Id9c802c5c3ae2ffdf61238f083bfe875e7b613a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-06 01:44:09 +01:00
Giuseppe D'Angelo
2a86d0a551 QOpenGLTextureHelper: de-inline the DSA / DSA emulator wrappers
There's no advantage at keeping them inline because we never call them
directly: we take pointers to them. This can actually cause
multiple copies of the function to be emitted, then the linker may or
may not decide to discard N-1 copies. Just avoid this route
and deinline them.

Change-Id: I5adc704b50ec7f26498846fcbb86cb5b5d016b4b
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-02-06 01:44:09 +01:00
Gabriel de Dietrich
b1714aec51 Cocoa: Allow frameless NSWindow child QWindows
Showing, moving and resizing

Contrarily to what an NSWindow does to its NSViews, child NSWindows need
to be explicitly shown and hidden, and clipped if the parent NSWindow
changes geometry. Also, hiding an NSWindow will not hide its child
windows. This needed to be managed manually, adding 2 additional states
to QCocoaWindow to reflect whether a child window has been clipped out by
any ancestor geometry change, or hidden by any ancestor being hid. Also,
ordering out an NSWindow will remove it fromm its parent's child windows
array, making necessary to maintain a parallel list of child windows in
QCocoaWindow.

Stack order

Although child NSWindows can be ordered relatively to each other, they
need to be added again to be moved lower in the window stack. This also
means the windows above it need to be added on top.

Key (focus) status

One of the remaining issues, is to make sure the top level window keeps
the "key status" while still forwarding key events to the child window.

Keeping same event propagation

This use case is best illustrated with undocking QDockWidgets (if these
are child NSWindows). The main issue is to make sure the QDockArea will
get the mouse events right after undocking a dock widget. We used a similar
workaround as the "key status" problem, and manually forward the mouse
events to the dock area's QWindow.

Manual test, by Morten Johan Sørvig, included.

Task-number: QTBUG-33082
Task-number: QTBUG-22815
Change-Id: I50e34936fb82bff013e99f4bcb3bd0db0704c6ae
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-05 23:12:50 +01:00
J-P Nurmi
65bd80ebfc QTabWidget: fix moving of the current tab
Task-number: QTBUG-36455
Change-Id: I38687283d60fe38a4b586b064d5ddd4ed3be06b6
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Ivan Komissarov <ABBAPOH@me.com>
2014-02-05 23:04:04 +01:00
Laszlo Agocs
2c1e77506c Do not check for !IsRenderBuffer
Unlike the newer QOpenGLFramebufferObject, QGLFramebufferObject still
contains some unfortunate tests for !IsRenderBuffer when creating
renderbuffers. Removing these tests avoids asserting in debug builds
on drivers that are not conformant to the GL spec in this respect.

This means that the qgl autotest is now passing on such drivers too.
The tests do not make much sense in the first place since Qt is not
a conformance test suite.

Change-Id: I21d6272cd5cef9dd71eab57e46771d3ce7dacbfb
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-05 21:51:57 +01:00
John Layt
23401a1462 QPrinter - Enable changing of Orientation on Mac
Since OSX 10.4 it has been possible to change the page orientation
during a print job.

Task-number: QTBUG-27630

Change-Id: Ic3c69e83afebbb9267ef6f435f968aeef2b72963
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:34:19 +01:00
John Layt
10f3c2bca6 QPrinter - Fix PaperSources
An earlier commit add new PaperSources for First and Last, but after
looking at wingdi.h it turns out these are just the first and last
DMBIN values, and Upper is equal to OnlyOne.  Remove First and Last, but
keep the Upper and CustomSource for use later by PPD based printer
systems.

Change-Id: I298472a1f54efcc584e73dec944b96fc91426c1b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:34:14 +01:00
John Layt
75aef26c27 QPageSetupDialog - Add manual dialog test
Add QPageSetupDialog to the manual dialog test.

Change-Id: I5a7a4fedf1fe3ba074891eaed84efaa1c173e620
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:34:10 +01:00
John Layt
5af95d077b QPrinter - Fix Printer Selection option on Windows
Make the printer selection option api public on Windows to be
consistent with Mac, and with the print program api which is already
public.

Change-Id: I3da9684288348eaa43276ca8534a1d5809f7027b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:34:03 +01:00
John Layt
27c33a8f7a QPrintEngne - Fix PPK_Creator
Add support to the Mac and Windows print engines to preserve the
creator name when switching between native and pdf format.

Change-Id: Ie036af3140f24d8e34aa886f091384f93aa0157b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:59 +01:00
John Layt
0ee72b09fd QPrintEngine - Fix PPK_CollateCopies
Mac supports Collate Copies using native api, so add support.  Note
this is mostly only useful for setting the print dialog default, as
Mac supports server-side multiple copies so the app will never need to
collate the copies itself.

Change PDF and Windows to default to collate true to match Mac as this
is the behavior users expect.

Task-number: QTBUG-27724
Task-number: QTBUG-35251
Task-number: QTBUG-22144

Change-Id: Ia43dbc260b3a71aa5b267cca54c168ffbea794fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:54 +01:00
John Layt
27473f19bb QPrintEngine - Fix PPK_DocumentName
Add support to the Mac print engine for set/get the Document Name using
the Job Name setting. Our documentation states this is one use that the
document name will be put to so is appropriate to be used.

Change the Windows print engine to default to a blank Docuemnt Name
consistent with the other print engines. If still blank when printing
then use a default value.

Task-number: QTBUG-27724
Task-number: QTBUG-22144

Change-Id: If590811b5720e6f759eabc290b578b94e221f9f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:50 +01:00
John Layt
053bee8b80 QPrinter - Clean up Print Engine Key defaults and tests
The PrintEngine keys are not consistently treated across the platforms
and are not properly tested.  Start the process of making the print
engines behave consistently by documenting and testing the current
behavior. Ensure all unsupported features return a consistent
default value.

The auto test for valuePreservation() has been flaky depending on the
platform and installed printers so remove it and replace it with more
complete testing.  If no native printers available then don't test
the native engines.

Fixes for the individual inconsistent keys will follow.

Task-number: QTBUG-26430

Change-Id: Iab914d7e0a5ae4a2cdc24c8645751f0910cf440c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-05 19:33:42 +01:00
David Faure
f0d135a6be Doc: fix documentation for QWidget::windowHandle.
It's not "preliminary" anymore, and it doesn't return a QPlatformWindow,
but a QWindow.

Change-Id: Iaa1938728e689d97011dce8cf0d88ff8cb4a83b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-02-05 18:41:26 +01:00
Friedemann Kleint
aae1eb3b03 Move documentation of AA_MSWindowsUseDirect3DByDefault into obsolete section.
Change-Id: Id45ddb760d1ec56741314f1125ad03d172c8e1a9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-05 15:16:00 +01:00
Frederik Gladhorn
113cfa9aa6 Accessibility Linux: Fix all widgets reporting being editable
[ChangeLog][QtGui] Accessibility on Linux reported all objects as being
editable instead of just editable text items.

Change-Id: I8bca2799a2e5b175b3ca515fee5dd02eae23829e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-02-05 14:16:56 +01:00
Cedric Chedaleux
c6d3fe8873 Checking input mask before scanning evdev devices
Adding device mask verification for static device discovery.
DRM devices are no longer scanned if mask is set to input devices only

Change-Id: Ibd2e77280c2d93c707ba7bdb84c4ae3cb0932178
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-05 13:46:46 +01:00
Laszlo Agocs
2d67bf07fe Do not query max samples on gles
Querying GL_MAX_SAMPLES is not supported in GLES2.

Avoiding the call also makes us play nice with Mesa in debug
mode since it gets rid of the warnings about the failing
glGetIntegerv call.

Change-Id: I05e501cc11af41a54fefc34ab919c5191e4f3f0a
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-05 13:46:41 +01:00
Frederik Gladhorn
760ad40700 Make QWindowContainer accessible
Change-Id: I93451b8842648db0815c96d64d319daecb45f0de
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-05 13:33:47 +01:00
Rafael Roquetto
bb9dd25843 QNX: fix wrong coding style
Change-Id: I84b166ee528b7d586f1901e6bfda999ef698c3fd
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-05 13:07:00 +01:00
Thierry Bastian
4c173e96c1 Adds the ability to not have an activity on Android
That code allows for not having an activity on Android.
In my case I've made some java code to handle an Android service.
The code is mainly about not dereferencing null pointers.

Change-Id: Ia7fda03cbbc55e6afeacd928445a4b72b51c679e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-02-05 09:19:38 +01:00
Eskil Abrahamsen Blomfeldt
35579f6fe7 Support empty inline elements in block tags in QTextDocument
This fixes the following case:

<blockquote>
<span />Foobar
</blockquote>

Qt would see the end of <span>, and consider the current block
tag as closed, thus resetting the block format, thus losing the
margin set for the current block (due to blockquote).

If you do

<blockquote>
<span>Foo</span>Foobar
</blockquote>

instead, then the same would not happen, since hasBlock is set
to false when we append text to the current inline node.

[ChangeLog][QTextDocument] Add support for empty inline elements
in block tags.

Task-number: QTBUG-33336
Change-Id: Ic566edfec96cb8d44d1c02932bb195bc921d1580
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-05 09:10:25 +01:00
Eskil Abrahamsen Blomfeldt
11189af016 Remove some left-over +1 in font height calculation
In change cb8445f032, I tried to
remove all the historical +1s when calculating the font height
from the ascent and descent, but I missed a couple. These are
used when drawing the background for the text, the height of which
would no longer match the height returned from QFontMetrics.

[ChangeLog][Text] Fixed off-by-one in the height of text background.

Task-number: QTBUG-36444
Change-Id: If6d87f903e246f9faed2298bb1693b2556906eed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-05 09:10:16 +01:00
Andy Shaw
060b853a2f Actually print when the tester pushes the print button
Change-Id: I5c995938a74f720be5beb33160488ec1ec73c0ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-05 08:51:55 +01:00
Friedemann Kleint
09e53c8b6e Plugin minimalegl: Remove superfluous keys() function.
This is no longer needed in Qt 5.

Change-Id: I10a2b893fdc822a526abc19c3d1f0f2538de0d83
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-05 08:50:19 +01:00
Friedemann Kleint
41fea09d63 Obsolete AA_ImmediateWidgetCreation.
This attribute is not guaranteed to fully work with QPA.

Task-number: QTBUG-36489
Change-Id: I638a8e00851288012be553b5316aa6088dd67cff
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-02-05 06:29:20 +01:00
Liang Qi
839997adfa Cocoa: fix single punctuation input via CJK input method
2d05d3bd28 was not correct.

On OS X, when user uses CJK input method, only types single punctuation,
it was converted to CJK ones, and not showed in composing text.

Task-number: QTBUG-35700
Change-Id: I2d1063d2f837d075929dc5ebb5722fdefc6ee0f6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-05 02:35:11 +01:00
Morten Johan Sørvig
d01f0213b8 Cocoa: Establish pattern for accessing globals
Use a static QCocoaIntegration pointer instead of
QGuiApplication. This removes the need to call out
of the platform plugin as well as the casting from
"platform" to "cocoa" types.

Change-Id: If432b3567811223b73a67548e475e07d63635b73
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-04 22:59:04 +01:00