Commit Graph

2113 Commits

Author SHA1 Message Date
Stephen Kelly
0b293e4afc Make this API virtual to make selection proxying possible.
Change-Id: Ie93c8b38c59d347026a68eae03687d9017b3d048
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-11 12:24:48 +01:00
Friedemann Kleint
af914694d8 QPlatformDialogHelper: Split class hierarchy, decouple from Dialog
- Introduce hierarchy of QPlatformDialogHelper-derived classes
  for font, color and file dialogs.
- Start reducing dependencies on QDialog:
  * Remove QDialog-specifics from interface, introduce enumeration
    for DialogCode
  * Make the helpers Q_OBJECTS to be able to add the signals
    passed on to the QDialogs
  * Remove QDialogPrivate pointer
- Split setVisible_sys() in show_sys() (factory method for native
  dialogs) and hide_sys(). Pass parent window to  show_sys(),
  removing the necessity to query the QDialog for it
- Introduce a styleHint() similar to QGuiApplication's for
  platform-specific
- Fix compile in cocoa/windows, reduce depency on QDialog
  (-private) classes.

Change-Id: Ic1cb715e1edf767f2cb18b9780341d189339ef1d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-11-11 10:58:10 +01:00
Chris Meyer
9a8a70d8e4 Prefer organizationDomain or CFBundleIdentifier for settings file
Watch for attempts to write to "Trolltech" preferences and use
QCoreApplication::organizationDomain() instead. If that doesn't exist,
then fall back to CFBundleIdentifier if possible. If that doesn't
exist, then follow the old code path and use the hardcoded string.

This change eliminates extra files being created which helps Mac app
store acceptance.

Change-Id: I1ba3984b46cf3888f371d87f6ad8ea6c2f26d2ec
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-11-11 10:58:10 +01:00
Tero Ahola
1505508742 Repaint QProgressBar when minimum or maximum changed
The implementation of QProgressBar::setMinimum and setMaximum did not
repaint the widget. This caused the widget to be shown incorrectly in
case you call setMinimum or setMaximum but not setValue.

Task-number: QTBUG-22121
(cherry picked from commit b1998f4f59c3b10700963b2d13a17a0cc77ef665)

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>

Change-Id: I331d37ab4451d9e096cdf91a9e0a0286bc3cdffb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-11 10:58:10 +01:00
Tero Ahola
adcfc9f38b Fix QProgressBar causing timer event spam
On Windows you will get a lot of timer events if you use QProgressBar
widget. This is because QWindowsStyle uses a timer to animate a
progress bar with unknown state (min and max values both zero). The
issue was fixed by starting the timer only if needed.

Task-number: QTBUG-10501
(cherry picked from commit  72e61b127470b044e370af7017fa8a5b0538244f)

Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>

Change-Id: If9ff2ab99929d9b85a7ffa8f6fd47b045b982f67
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-11 09:18:44 +01:00
Thomas Hartmann
e82b120410 avoid type aliasing
For -O2 gcc activates -fstrict-aliasing. As a result the compiler is
allowed to assume that pt[1]=px[1]/3+B1 does not affect t.

Therefore the result of _fast_cbrt() was always 0.
Using a union for casting avoids this issue.

For more details see:
http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing

Also the updated code respect endianness.

Change-Id: Id4bed16efac52e494e7357dc2f23f94e8c525df1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-11 09:16:21 +01:00
Shane Kearns
d457f148cf Fix warning when using QXmlInputSource with non opened QIODevice
Calling setTextModeEnabled on a QIODevice that is not open generates
a warning as a result of QTBUG-20905. Previously, it caused incorrect
behaviour when called with true.
Now only call it if the QIODevice passed in is already opened.
If not open, then it is opened by the xml reader without text mode,
so there is no difference in behaviour.

xml autotests still pass, although this removes several QWARN messages
from the qdom autotest.

Task-number: QTBUG-22659
Change-Id: Ie3137e44fe776bff6371ebd008428110168717ec
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-11 02:45:05 +01:00
Olivier Goffart
96611a677f Fix parsing of #if defined expression
We only need to match the closing parentheses if there was an opening one

This has caused mis-parsing of tst_qbytearray.cpp

Change-Id: I9d52916e3ed8549c5ddd968092451fef7389a952
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-11 02:45:05 +01:00
David Boddie
c888e20f22 Doc: Added more appropriate links to help reduce confusion.
Task-number: QTBUG-19919
(cherry picked from commit 26c29a2dd7efa4c66063d1255e1f694462cbae85)
(cherry picked from commit 8304ca4edd7bd71dd0398451e62a281eac54d0a6)

Change-Id: Icd45465723f9077f109459df002556be81dddb33
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-11-11 00:01:10 +01:00
Olivier Goffart
e6abf81046 Removed include to qdatastream.h from qmetatype.h
Added forward reference to QDataStream instead

In the new connection syntax, I want to include qmetatype.h from qobject.h,
in order to handle metatype for queued connection.
So qdatastream cannot be included here (as it inherit qobject) else it would
lead to circular inclusion.

QDataStream is only used in templated code that is dependent on the
template parametter so it is fine to have it forward declared.

Change-Id: I08ea479f481262a80451a277ee29533c42cb9f89
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-11-10 13:33:02 +01:00
Aaron Kennedy
bcd16f9453 Update V8
Change-Id: Ic239ef1e55bed06260e4a04cc2199f64c2d30059
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-11-10 13:22:13 +01:00
João Abecasis
95d7abb694 Fix Q_STATIC_ASSERT on Mac
gcc 4.2.1 complains about the use of C++-style cast in the macro.

    error: template argument 1 is invalid

. Changing the bool-cast to a C-style cast makes the test compile.

Change-Id: Ie9082a3adbfd53147bfd0bfe36dd9e7328e01ee8
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-11-10 13:17:52 +01:00
Pekka Vuorela
5665c6a55a Updated Qt::InputMethodQuery documentation
Change-Id: Ibd27231366e4af2780bfe2f8f735da74dc04a1cf
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:08:00 +01:00
Pekka Vuorela
a806887992 Document QInputMethodQueryEvent class
Change-Id: I6e98f9e690b733a06ee165e5b01ab6a5a784791b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:07:51 +01:00
Pekka Vuorela
dc2a1aff9b QWidget text editors to commit text on their own on losing focus
Change-Id: I3b907661e8a24a6dbdaabf607c5c528b1b471c98
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:07:38 +01:00
Pekka Vuorela
b5c37d9e13 QTextEdit to use tentative commit instead of QInputPanel::commit()
Latter to be deprecated.

Change-Id: I2c302c73a7ab2f4201af6a3c6fb4a64a4760263e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:07:30 +01:00
Pekka Vuorela
1dbfbf4c66 Implement partial tentativeCommit support in QTextEdit
Available on plain text for now, html support still pending.

Change-Id: I0818b97874e80c8c1b33a9127aa7bb3330a8761d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-10 13:07:20 +01:00
aavit
77082cd7c9 Add isDebugBuild() query function to QLibraryInfo
Also cleaned up the doc, removing references to the buildkey() function
that has been removed.

Change-Id: I2cb403f93d93c0b2f71c8502818d669f7bfbfbec
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-11-10 13:02:34 +01:00
Morten Sorvig
95c007e1f5 Compile.
QNSPanel must be a NSPanel and not a QNSWindow
subclass.

Change-Id: I1de31e147757824610f4aabc0ef66ae3906dc0f6
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-11-10 12:55:36 +01:00
Andrew den Exter
7125dd7186 Propagate QTest::mouseEvent keyboard modifiers.
The QWindowSystemInterface mouse functions now have keyboard
modifiers parameter, make use of them.

Task-number: QTBUG-21743
Change-Id: I65ba1095825b81d575d314c1de2a45cef28e697a
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-10 03:09:58 +01:00
Bradley T. Hughes
b36e6c4319 Remove unused MMX/3DNOW/SSE/SSE2/SSSE3/NEON custom compiler logic
The QtWidgets module doesn't contain any code that needs these custom
compilers (that code has been move to QtGui).

Change-Id: I655e478908bfa0b646e68210f6215d9ffbb1f81e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-10 00:41:33 +01:00
Johannes Zellner
08c2368911 Fix build when QEGL_EXTRA_DEBUG is defined for debug output
Also shift EGL configuration plot above window surface creation

Change-Id: I2de860e087cb2648b6e8e9b75365fbe78fe7687a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-09 22:13:20 +01:00
Johannes Zellner
b44011fb77 Adopt eglfs platform plugin to changed QEGLPlatformContext API
eglClientVersion is not used anymore

Change-Id: I8595a17386c1466d7766522adbdbd7cd5002ecf8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-09 18:20:00 +01:00
Bradley T. Hughes
fb01907050 Correctly normalize timevals before calling select()
When normalizing timevals, we need to bound the tv_usec member to
0-999999 inclusive, otherwise select() may return EINVAL.

When rounding timevals to the nearest millisecond in the UNIX event
dispatcher, pass the timeval through normalizeTimeval() when returning.

As discovered on Mac OS X with tst_QFutureWatcher, starting a 10 second
timer would end up calling select() with timeval = { 9l, 1000000 },
resulting in numerous "select: Invalid argument" warnings being printed
to the console.

Change-Id: Ic539e935bf847e0d4c22a73ad203e3a7a81d0690
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 18:20:00 +01:00
Friedemann Kleint
9c9bbfc13c QVariant: Fix MSVC compiler warning about unused variable null.
Use static method isnull().
Introduced by ca26fefc06.

Change-Id: I752f8d8a5ec473dcc5f50fbda47d061b8d3a7e13
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-11-09 16:52:48 +01:00
Bradley T. Hughes
67a9b95009 Remove unnecessary variable self-assignment
Assigning an int variable to itself is unnecessary and pointless, remove
them.

styles/qplastiquestyle.cpp:932:23: warning: explicitly assigning a
variable of type 'int' to itself [-Wself-assign]
                width = width;
                ~~~~~ ^ ~~~~~
styles/qplastiquestyle.cpp:939:23: warning: explicitly assigning a
variable of type 'int' to itself [-Wself-assign]
                width = width;
                ~~~~~ ^ ~~~~~

Change-Id: I0118874028bf43992bcce07f87b46b48868436cc
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 15:28:36 +01:00
Pekka Vuorela
767d553fc2 Un-internalized QDBusServer
Was marked internal earlier because of missing implementation. That
should be now in place.

Change-Id: I9005da4455299386556e567847474c8d8b6fd5ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-09 15:28:36 +01:00
Morten Sorvig
2fd3dbb00c Cocoa: Implement mouse and keyboard grab.
Change-Id: Id53ff19d43213d79aaf8f1a6617a06ef9d0cfb4b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
2011-11-09 12:16:58 +01:00
Friedemann Kleint
260416393e Widgets: Remove dialog functionality from QGuiPlatformPlugin.
(as QGuiPlatformPlugin is deprecated)
Clean up qdialog.cpp.

Acked-by: Morten Johan Sorvig <morten.sorvig@nokia.com>

Change-Id: Id49d6cfe235d5afb4c89b0697c6b3980130a5299
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-09 10:41:09 +01:00
Jędrzej Nowacki
ca26fefc06 [optimization] QVariants comparison
QMetaType::isRegistered and QMetaType::typeName are quite expensive.
To compare two custom objects we need to have their type name (for
dereferenced comparison). If the name exist we know for sure that the
type is registered and we do not have to call QMetaType::isRegistered
anymore.

Change-Id: Iba631e012504c8633868a902880fa30d38afb917
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:12:34 +01:00
Jędrzej Nowacki
5bd377274e Add QPolygonF to metatype system.
That was strange that QPolygon was know to QMetaType class but QPolygonF
not.

Change-Id: I67bb99644b8b1d0fe1aec730619d8048cb78219b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:12:18 +01:00
Jędrzej Nowacki
8fd64d22ac Make usage of internal QVariant space.
Each QVariant instance has internal storage which may be
used for well-know basic types. This patch changes the
behavior by delegating type dependent operation to QMetaType
class which knows more types than QVariant itself.

The patch significantly reduce amount of code in QVariant
implementation.

There are few side effects of this patch:
- better performance:
* for Core types when using Gui (QGuiVariant is able to
construct Core types)
* for small custom types (QVariant::Private::Data is used for all
types that has size small enough)
- comparing two QVariants can give different result for small custom
types (binary comparison instead of pointer comparison)

Change-Id: Ic17fa500d6a882110bfba896fd456c8e6c7a63a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:11:34 +01:00
Jędrzej Nowacki
2b39be6dd5 Implement QMetaTypeSwitcher.
Currently one of the most common coding pattern, when working with
QMetaType types, is to switch over all types ids to convert a given
type id to a real c++ type. The pattern is not perfect, because of:
- code duplication - to convert type id to a real type a user has to
write own switch case
- maintenance - adding new type to QMetaType::Types doesn't propagate
to other parts of code.

Proposed type switcher can solve the issue by switching type id and
delegating found c++ type.

The class is created for internal use only and was created to simplify
common problems in QtDeclarative, QtScript and QVariant.

Change-Id: I0567ef908024b3b05ee18126f98a73a74748fbd2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:11:14 +01:00
Jędrzej Nowacki
eda469d3a0 Add QTypeModuleInfo template class
From time to time it is necessary to know from which module a type comes
from. This information couldn't be part of QTypeInfo as id doesn't work
for forward declared types.

QTypeModuleInfo should stay for Qt internal usage only.

Change-Id: Ia53747c88293fc0cdaffef919b94c653412779d3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:11:09 +01:00
Jędrzej Nowacki
7f35d5849e Refactor QMetaType types.
QMetaType::Type enum is the main source of type ids. Currently
there are many tasks that can be replaced by a smart macro that
can iterate over all types. The patch introduces series of FOR_EACH_
macros that may be used for code generation.

As the first step the macro was used for Q_DECLARE_BUILTIN_METATYPE
to make sure that no type was forgotten.

Second step was to use created macros in autotest to improve tests
coverage.

Change-Id: I34e9ad7bacf02b44b028bc1aad20b1241aacebd3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-11-09 10:11:02 +01:00
Friedemann Kleint
635cf1badf Widgets: Remove remains of Windows file dialog.
Also remove Windows-specific binary compatility hack from Qt4.

Change-Id: I4b6914b357f21737e392745f907c770db9f7a641
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-08 17:20:39 +01:00
Aurindam Jana
124044613d QGlobal: Define a default message handler
Currently, qInstallMsgHandler() does not return the
handle to the default message handler. This patch defines
a default message handler. This is returned by
qInstallMsgHandler() when called for the first time. A call
to qInstallMsgHandler(0) will restore the default message
handler as was the case previously.

Change-Id: I42f06654d45fb0e633f3c6d912fc8f05c23249aa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-08 17:20:39 +01:00
Olivier Goffart
a4f446704e QNAM: Fix authentication cache when the password is in the URL
Two problems:
 - The signal cacheCredidentials was not connected in the synchronous
   case while it must be connected. (Regression when the threaded http
   was merged)
 - We cannot cache the credidentials when we proceed the url because
   at that point, we do not know the realm (this basically reverts
   9bc5a32b875b812c3a706034c8c27614f86bd138)

Task-number: QTBUG-18411

Change-Id: I8ea11fa23db4314c3f17ed06d2d7f9ee934ccdba
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-08 17:20:39 +01:00
Jiang Jiang
1c70cd9980 Avoid double initialize of platform font database
Since platform font database will be populated in QFontDatabase::load,
no need to do it here in QFont::initialize.

The change was in cd781b732e but lost
in previous merge.

Change-Id: Iaa56fea5765d94e4f7b58409654bc218808086cd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-11-08 15:52:28 +01:00
Peter Hartmann
7a78248e9c SSL: blacklist intermediate certificates that issued weak certs
... as did browser vendors.
Tested manually with affected CA certificates.

Reviewed-by: Richard J. Moore <rich@kde.org>
(cherry picked from commit e1d6df4e5931ee49b4b68dd5a33146f5639268b7)

Change-Id: I5bf6c147abf6d2de0f313d65faa2d9a1e9684cea
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-08 15:52:28 +01:00
Morten Sorvig
ed55c4a14c Cocoa cursor support: Add QCocoaCursor.
Port the Qt 4 mac implementation.

Change-Id: I3bc6fd0b5a0398dcf43a5aaa3b498bb74b42c105
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-11-08 15:52:28 +01:00
Friedemann Kleint
f54411069c Widgets: Use QPlatformDialogHelper in QColorDialog/QFontDialog.
Change-Id: Ib9a2f19679c2d4c8583742a918d61c1a98403843
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-11-08 14:10:15 +01:00
David Faure
5e26608ae2 Add Q_DECLARE_PRIVATE equivalent for QDir, to be able to subclass it
Apply the same solution to QFileInfo (no public detach(), but a
non-inline d_func instead).

Change-Id: I31c4c759f44a0649b97f7884b078b174c9c00f22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-08 12:09:06 +01:00
Charles Yin
78542c6275 QPainterPath: Fix copy constructor again.
The previous fix a05270f435 is not correct,
QPainterPathPrivate(other) should be QPainterPathPrivate(), as there
is only a default ctor for QPainterPathPrivate and ref is initialized there,
 use copy ctor just copies the ref value which makes all detach() calls broken.

Add an unit test for this as well.

Change-Id: I658f0a977664d5ec523af3f8a48c1a866eda6ab0
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-11-08 07:43:00 +01:00
Jiang Jiang
63eae1bd15 Fix subpixel positioning support
Move subpixelPositionForX from QTextureGlyphCache to QFontEngine,
since some font engines like QFontEngineFT may need a custom
implementation or tweak it a little bit.

In QRasterPaintEngine::drawCachedGlyphs, do not add aliasedCoodinate
to x offset as that will break subpixel positioning.

Change-Id: Idbcec617509459b80965220ceb07b17737649bbf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-11-08 07:43:00 +01:00
Jędrzej Nowacki
04f6983979 Implement QRegion::isNull
The method was missing from QVariant perspective (QVariant::isNull
supposed to call isNull not isEmpty).

Change-Id: Ic1ac9f662e275ac73908809f2c4ac59679b40b00
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-11-08 06:20:42 +01:00
Friedemann Kleint
a05270f435 QPainterPath: Fix copy constructor.
Re-add base class initialization accidentally removed by
e277575987.
Fix warning: 'base class 'class QPainterPathPrivate' should be
explicitly initialized in the copy constructor.

Change-Id: Ie94fa82eeeb3a8ddc69aef447f73ce36da616916
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-11-07 16:49:08 +01:00
Bradley T. Hughes
b2bc9d2762 Bump QCoreApplicationPrivate::app_compile_version to 0x050000
The minimum compile version is 0x050000 now, it cannot be less. Remove
checks for 0x040200 in the widget code, which provided compatibility in
the 4.x series for binaries compiled with 4.0 and 4.1.

Change-Id: Ia01da90de26dca6aeeb79d29c754cbeeecf809af
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-11-07 16:45:16 +01:00
Joerg Bornemann
c76e91db97 symbian epoc root code removed
Change-Id: Ibc9f5e42c534a09a8a44a0c95789f467970d38a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-07 13:26:41 +01:00
Andrew den Exter
db34625eae Fix QQuickTextInput implicit width.
QQuickTextInput tries to set the UseDesignMetrics text option on its
QLineControl but this is overridden by the options set in
updateDisplayText(). Apply the new options in updateDisplayText to
the existing options.

Change-Id: I6789c3c2d6e496c1594d586bd075473983978f77
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-11-07 01:11:30 +01:00
Richard Moore
6248b869d0 SSL certificates: add functionality to read extensions
... by adding a new class QSslCertificateExtension and methods in
QSslCertificate to support extensions. This is needed e.g. for OCSP
(checking revocation status of a certificate) or Extended Validation
certificates.

Change-Id: I5c5d9513fa640cd487786bb9a5af734afebd0828
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-06 21:00:39 +01:00
Kevin Simons
efe02f9673 Reinstate and deprecate the two argument QMetaType::construct
Change-Id: Id291f00ba13a39b4af022b75fd428b876d6dd9b0
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-05 23:47:02 +01:00
Pekka Vuorela
7851568c65 QLineEdit - made mouse interactions commit preedit
Simplifying input context mouse handling rules by making
the editor in charge when text gets committed and selected.

This includes:
 - Allowing selection to start on top of preedit. Commits once a
   single character gets selected
 - Double click to commit preedit before selecting a word.
 - Only sending events to input context that happen on top of preedit.
 - Committing preedit when a mouse press happens outside of it,
   allowing to move cursor to click position.

Change-Id: I9dab00ea3445055ffd0d7cae540a1197c5748509
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-05 23:47:02 +01:00
Pekka Vuorela
10dc2171cf Fix broken indendation with hard tabs
Change-Id: I1aa161ddab55f11683b2eee3c205505a829013c4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-11-05 23:47:02 +01:00
Pekka Vuorela
8bd40fef07 Support tentative commit string with input method.
Tentative commit string allows input method to notify editor
what is expected to be committed in the place of preedit.
This commit adds such support in QLineEdit.

Change-Id: If855619bc6843652db0d6254f7e7063bb8ad0936
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-05 23:47:02 +01:00
Pekka Vuorela
4b3d88a9c6 QTextEdit - mouse events to override input context
- Selection can start on top of preedit
- Mouse press outside preedit commits
- Double click to commit on top of preedit

Change-Id: Ia2698d97d354a677d935de1a8fd9ed53a161ca5e
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-05 22:10:52 +01:00
Jiang Jiang
b2b3046804 Allow disabling FreeType internal cache
To disable it, set QT_NO_FT_CACHE environment variable to 1.

Change-Id: I086aa93c71cbdf86858a41a2bbad5d2db247cdfb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-11-05 02:30:04 +01:00
Jiang Jiang
2b2221fcfa Fix a warning in QGlyphRun compilation
Change-Id: Ic072240193fc8eb5e7fdcd0dada79383398b224b
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-05 02:29:41 +01:00
Jiang Jiang
bdf2225b9b Restore subpixel rendering support with fontconfig and FreeType
Change-Id: I45cf83374ba5a8b1ae88415950c1e5ab72991598
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-11-05 02:29:32 +01:00
Laszlo Agocs
0008428f90 Prevent timestamps in widgets' touch events from disappearing
Change-Id: I096914eb2b02ad9c4a5c0462a1f4b76ef17c3957
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-04 20:48:19 +01:00
Jo Asplin
b68bae1132 Added -datatags option to QTestLib
(Note: This feature is ported from Qt 4.8.
 See the following commits:
  01575deafb7d26ca2431374e92c6d71de96547c7
  4866d1ba8afbab61e102942d1ea93b81fea053d6
)

Passing the -datatags option to a QTestLib program prints the
available data tags to standard output.

For completeness, the test case name is also printed
at the start of each output line. (Although the file name
is supposed to match the lower-case version of the test case
name, this is currently not true in all cases (particularly not
under tests/benchmarks/). Even if there was a script to enforce this
convention, the -datatags option provides this information in a
reliable way.)

Data tags for each test function (f() in this case) are printed in
four different ways depending on the presence of local and global
data tags:

Case 1: No tags:
    tst_MyTestCasetst_MyTestCase f

Case 2: Local tags only:
    tst_MyTestCase f local tag 1
    tst_MyTestCase f local tag 2
    ...

Case 3: Global tags only:
    tst_MyTestCase f __global__ global tag 1
    tst_MyTestCase f __global__ global tag 2
    ...

Case 4: Local and global tags:
    tst_MyTestCase f local tag 1 __global__ global tag 1
    tst_MyTestCase f local tag 2 __global__ global tag 1
    ...
    tst_MyTestCase f local tag 1 __global__ global tag 2
    tst_MyTestCase f local tag 2 __global__ global tag 2
    ...
    ...

Note that the string __global__ is assumed to be highly unlikely to occur
in a data tag (if it does, an ambiguity results).

Change-Id: Ib51aa0c3c32ad52e52ce519729292cf8f0ec5d50
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-11-04 19:23:33 +01:00
David Faure
480c1db1ba Fix usage of QtConcurrent headers with -Wshadow -Werror
Change-Id: I172888518a3db01f89e61061eccf85f7f3387d07
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-11-04 15:58:17 +01:00
Friedemann Kleint
5a67cd2495 Windows: Add dialog helpers for native dialogs.
Implement QPlatformDialogHelper for file dialogs based on
IFileDialog. Add prototypical implementation of color dialogs.

Change-Id: If3c7470be6c0b8fbf8cfea1b6638bda43afafea7
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
2011-11-04 15:58:17 +01:00
Jiang Jiang
35f56b0cf9 Revert "Avoid fontconfig access in fontEngine creation"
This reverts commit 8dcb52df8e.

Turns out that hint style is retrieved from font match instead of
pattern match, which shouldn't be retreived until font engine
creation.

Change-Id: I90e779a3823e6a6604cdadb52586fcd5e22c295b
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-04 15:58:17 +01:00
Samuel Rødal
171e137d25 Improve QtGui start-up time and memory use.
The gamma lookup tables can be allocated and computed on demand, as
they're not always needed, depending on the platform and the use case.

Change-Id: I2d4c2860746366a0e46edb53bd4ecd2778de2464
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-11-04 14:31:25 +01:00
Lars Knoll
aa7e89e807 Revert "Use standard spelling for two languages"
This reverts commit 9358f7eaa4.

The change is source incompatible and hasn't been agreed upon. Revert
it even though it's correct in principle. It's simple to keep the old
enums around for compatibility.

Change-Id: I8d9d33868e44d0299a3f081833b06cedf0ed4345
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-04 12:37:27 +01:00
David Faure
272d20ce27 QStandardPaths: add DownloadLocation.
Only properly implemented on unix (XDG), falls back to Document location
on Mac and Windows, because not easily available with the current API
being used by either one.

Change-Id: Id269f0e3c4e3a68e19205de96c0b39980fde80ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-04 10:54:54 +01:00
Jiang Jiang
c30ebdeac0 Do not put cursor at non-stop character positions
When moving cursors, non-stop positions are skipped, however certain
input sequences can still lead us there. In such cases we should
simply ignore those positions in cursorToX.

Task-number: QTBUG-7076
Change-Id: Ia0a25931f4043359f72a6c0c14a74b905e40b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-04 01:54:33 +01:00
Jiang Jiang
75a2b9eef2 Release font engine refcount when done using it in QTextEngine
5f2b6dd2a50275bc05ae5d7e9dd8902d6d49d9df increased refcounts for
font engines in QTextEngine cache, we need to decrease them when
the QTextEngine is deallocated.

Task-number: QTBUG-21222
Reviewed-by: Eskil
(cherry picked from commit 8935a84e18804c7ff4b7336e3cfdf1cd558eaf1c)

Change-Id: I079c903d60e1bbcf78f555f8044dde69af82cf0e
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-04 01:54:29 +01:00
Jiang Jiang
9358f7eaa4 Use standard spelling for two languages
Singhalese -> Sinhalese
Divehi -> Dhivehi

Change-Id: I3faa7163202a4a9be14e3cf857da60aa4dd3196f
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-04 01:54:25 +01:00
Friedemann Kleint
720093ebd9 QWidgets: Delayed creation of the QPlatformDialogHelper.
- Create helper only once and ensure deletion
- Move nativeDialogInUse into QDialogPrivate, ensuring the native
  modal helper is called from QDialog::exec() only if it is true

Change-Id: Id92b278bb051ce254458f276fbf7075689a7d491
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-11-04 01:54:02 +01:00
Sergio Ahumada
e71ac20d0f Add QT_MODULE(Gui) macro
Fixing `macros' function test of `tst_headers'

Task-number: QTQAINFRA-324
Change-Id: Ib6fcf276108bbb5515a72f3f17b373de82a599fc
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-11-03 20:07:04 +01:00
Friedemann Kleint
7d7b2d4218 QtGui: Fix compilation with gcc 4.4
- Do not mix QStringLiteral and Q_TR_NOOP.
- Replace static QString member variables by
- static member functions to return the strings.
- Use tr() since QAccessibleActionInterface declares it.

Acked-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>

Change-Id: Iabbee8ef61a5d7bfd35978a3f1cce1866329d065
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-11-03 20:07:04 +01:00
Oliver Wolff
e84b8a3475 Fixed returned geometry of toplevel child widgets
If a widget has got a parent widget but also is a toplevel widget it
should not return its geometry relative to its parent.
In addition to that, child widgets which are not toplevel should not
change their left and top values according to their parent but also
keep their width and height intact.

Change-Id: I5e641abf5ddc0b8d056ba023f8de52af1d2ccc9f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-03 18:43:52 +01:00
Olivier Goffart
ec5e59b73c QThread::isFinished should return true from finished()
and isRunning() should return false.

This restore the Qt 4.7 behaviour

In Qt 4.7, the finished() was called with the thread's intenal mutex
locked. Which mean that:
 - Call to isRunning or isFinished called from a slot connected to
   finish within the thread would deadlock. (Hence no compatibility
   to keep here)
 - Call to isRunning or isFinished from a slot connected with
   QueuedConnection in another thread would lock the mutex until
   the destructors are finished. and then return as if the thread have
   finished.

Change-Id: I963eccae8f7634aff90cc4bbab6ca886a78e35eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-03 18:43:52 +01:00
Olivier Goffart
1fe8fb81b1 Enable deprecated feature for now
Rationale is that it makes it possible to deprecate functions without
breaking other modules.

After the feature freeze, this should be reset to 5

Notice that QT_DEPRECATED is not defined while bootstrapping Qt
(QT_NO_DEPRECATED defined)

This also means that compilation is tested

Change-Id: I85f0e65ac3a160e9aba3833787ded3f94304cb90
Reviewed-by: David Faure <faure@kde.org>
2011-11-03 18:43:52 +01:00
Pekka Vuorela
255f569a43 Renamed QTextLayout member variable for readability
Class complex enough already without int i as member variable.
Furthermore, some methods use loop variable with same name, shadowing
the member one.

Change-Id: Idf2f5e34f130a60eb6121480e596e443f23641dd
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-03 16:14:08 +01:00
Pekka Vuorela
391f5670a3 Documented side-effect of QTextLayout::setPreeditArea()
Invalidates layout and requires layouting again.

Change-Id: I1cb954f155e4fc1df4b217478998ac903cc18323
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-03 16:13:03 +01:00
Jason McDonald
65ece490a9 Fix getting of enviroment strings in testlib
The standard C getenv() returns NULL if the requested environment
variable is not found.

In Qt4 and later, qgetenv() does not return a null pointer if the
requested environment string is not defined.  Instead it returns a
QByteArray containing an empty string.  If using qgetenv(), there is no
way to tell the difference between an undefined environment variable
and one which is defined to be the empty string.

In testlib, all calls to qgetenv() were checking whether the returned
QByteArray's constData() returned a null pointer, but that would never
happen.  These calls must instead check whether the QByteArray contains
a non-empty string.

Change-Id: I342f0e8b196896c26cccce3ff169fa1b9669b5ff
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-03 02:42:56 +01:00
David Faure
e488efa577 QStandardPaths: fix encoding of XDG_CONFIG_HOME env var
Change-Id: Ibb89f204fc93aed5a669f8f9efc7859845e6d493
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-02 19:57:21 +01:00
Thomas Hartmann
b9f0bde16e Adding custom bezier easing curves to QEasingCurve
I added the possibilty to define Bezier/TCB splines and use them
as custom easing curves.

Note:
Splines have a parametric definition. This means we have a
function/polynom of t that evalutes to x and y. x/y = f(t).

For our purpose we actually need the function y = f(x).
So as a first step we have to solve the solution x = f(t) for a given
t and then in a second step we evaluate y = f(t).

f(t) is a cubic polynom so we use cardanos formula to solve this equation
directly.

For the casus irreducibilis we need 3 functions that are a combination of
arcos and cos. Instead of evaluating arcos and cos we approximate these
functions directly.

TCB splines are converted into the corresponding cubic bezier spline.

Change-Id: Id2afc15efac92e494d6358dc2e11f94e8c524da1
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-11-02 17:10:00 +01:00
Friedemann Kleint
7d560240fa Windows platform plugin: Fix compiler warnings.
Change-Id: Id7111ca74455b93aabb803babff51c4393508dbc
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
2011-11-02 15:44:04 +01:00
Olivier Goffart
f3242864c3 Use C++11 static_assert
Change-Id: I75aa2bc209cdc8869e7daa9fd0dd865ccf65a68e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-11-02 13:24:36 +01:00
Bradley T. Hughes
ca25b63bea Silence warning from clang: semicolon before method body is ignored
qnsview.mm:171:45: warning: semicolon before method body is ignored
      [-Wsemicolon-before-method-body]
- (void)handleMouseEvent:(NSEvent *)theEvent;
                                            ^

Change-Id: I0b2fdd9c28586ce03f14f784d35e88dbbb5bd8f4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-11-02 13:23:10 +01:00
Bradley T. Hughes
5341cf7831 Disable warnings while building QtV8
This is a 3rd-party submodule that we do not directly modify. Warnings
from this code is of no value to people diagnosing and fixing warnings
in Qt code itself.

Change-Id: If17d9ce6509abb7d7aa1f00daf7e771fc6231993
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-11-02 13:17:10 +01:00
Friedemann Kleint
ebc28a2ee8 Testlib: Remove remains of qpa.
Link ApplicationServices in the non-qpa case (CoreServices
present).

Change-Id: I7555243aa480a7a4db84731a797924a97bf200cd
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-11-02 08:18:12 +01:00
Bradley T. Hughes
2bce4627e6 Silence warning from clang
The original intent was most likely to memset() the entire MD5Context to
zero at the end of MD5Final(), which we do now.

In file included from tools/qcryptographichash.cpp:49:
...qtbase/src/corelib/../../include/QtCore/../../src/corelib/tools/../../3rdparty/md5/md5.cpp:139:24:
warning:
      argument to 'sizeof' in 'memset' call is the same expression as
the
      destination; did you mean to dereference it? [-Wsizeof-pointer-
        memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
               ~~~            ^~~

Change-Id: I793c6f0944b89c0e4c5f9253cdb1071175c17152
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-01 17:39:32 +01:00
Jędrzej Nowacki
991d9cf928 Fix broken build.
Variadic macros are not supported by C++98 standard.

Change-Id: Ib520297e43b654b46925f3ee2735a975ebbe8e35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-01 16:15:08 +01:00
Samuel Rødal
d3710a13a6 Add Q_PROPERTY declarations to QScreen.
This means we can expose the API to QML in a simple way.

Change-Id: Ibc36711071d288ed78ce833a64d6be2f22fc4b62
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-11-01 16:15:08 +01:00
Bradley T. Hughes
573d8b838b Tentatively keep operator=(const QAtomic* &other)
QAtomic* has a copy constructor, so it may make sense to allow
assignment of one atomic variable to another.

Change-Id: Ic754d13765080e2fcd13dc583940e354ad4404cd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-01 14:39:55 +01:00
Friedemann Kleint
24f845dd20 qeventdispatcher_win: Fix warnings about QAtomicInt.
Change-Id: I2639fcee046ad3cc5de9c2635fdb6de4b757fc27
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-11-01 14:39:55 +01:00
Sergio Ahumada
cf6ef44ffd Revert "Fix use of qMax() with floating point constants"
This reverts commit 4e1b8720c1498edbb7a5bd37f622fdd3feb07850

Change-Id: I5e52a86119b522888b69fa261ebfa9168f885864
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-11-01 09:56:40 +01:00
Liang Qi
1365d290c6 Remove S60/symbian specific code in plugins/bearer
Clean up and remove Symbian specific code and data.

Change-Id: Icef41c22f143278a66f6a46ca80c495d083bf9a9
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-11-01 01:51:32 +01:00
Bradley T. Hughes
768bc406f7 Use QAtomicInt::store() instead of operator=(int)
... since the latter is now deprecated and will be removed.

Change-Id: I456c1bf93ebf119c028bc4a63f1f8a31f069b83b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-01 01:51:32 +01:00
Lars Knoll
d7649245ec Fixes to the ibus input context
Adjust to changes in the QPlatformInputContext
and implement commit(). Fix a bug that caused the
cursor to be hidden after the first commit.

Change-Id: I85e59a72766d1180a54df412cf33beb653af4e7b
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-11-01 01:51:32 +01:00
Liang Qi
0d95e16c29 Remove S60/symbian specific code in corelib/arch
Clean up and remove Symbian specific code and
data.

Change-Id: I41794085fd5122310b1fdf4c524c6e77d22e8500
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-01 01:51:32 +01:00
Shane Kearns
0ad18e18d1 HTTP proxy engine - accept standard Connection header
The Proxy-Connection header is a non standard header, but is widely
used so forming a de-facto standard.
Some proxies use the official Connection header, so we should check
for that in responses. Otherwise https connections over http proxy
fail in case the proxy sends "Connection: close" with the 407 reply.

Task-number: QTBUG-22177
Change-Id: If6cfa4ebb7ac9d97d65b6ddcc8257aee20ac0448
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-31 20:34:43 +01:00
Peter Hartmann
869bd3d6e1 SSL documentation: correct enum name
(cherry picked from commit 9d5c920bb23b949a0b98f1268679a0a2c06dd1d9)

Change-Id: Id99040051afe97bca3b1a8e4e3ae5a4c7f617cc9
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2011-10-31 20:34:43 +01:00
Casper van Donderen
c9cd6cdbea Update enums in documentation.
Change-Id: Ic48051cc832dc8bc06df2e82c54388df60208e39
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2011-10-31 20:34:43 +01:00
Robin Burchell
81dfe46f15 Remove Symbian support from bind enum documentation.
Symbian is no longer a supported platform.

Change-Id: Ifcb2e05661b16acc6307a4ccfaa42586750734c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-31 20:25:45 +01:00
Robin Burchell
03f852cb47 Move support for socket binding from QUdpSocket upstream to QAbstractSocket.
This should be API-compatible with Qt 4, but is not ABI-compatible, due to
removing the enum from QUdpSocket.

Task-number: QTBUG-121
Change-Id: I967968c6cb6f96d3ab1d6300eadd5bde6154b300
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-10-31 20:25:12 +01:00
Robin Burchell
3aa81c55e2 Set localAddress and localPort on socket binding.
This should have always been the case, as it simply makes sense, but the
upcoming moving of binding to QAbstractSocket will require this for autotesting.

Change-Id: Ieef70196616227e7914c76fff5388a4068c36efb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-31 20:24:46 +01:00
Bradley T. Hughes
0b924cdaee Remove declaration of QRasterPlatformPixmap::fromFile()
This function is not implemented, and the declaration hides the virtual
QPlatformPixtmap::fromFile():

../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/image/qpixmap_raster_p.h:70:10:
warning:
      'QRasterPlatformPixmap::fromFile' hides overloaded virtual function
      [-Woverloaded-virtual]
    void fromFile(const QString &filename, Qt::ImageConversionFlags flags);
         ^
../../include/QtGui/../../src/gui/image/qplatformpixmap_qpa.h:90:18:
note:
      hidden overloaded virtual function 'QPlatformPixmap::fromFile' declared
      here
    virtual bool fromFile(const QString &filename, const char *format,
                 ^

Change-Id: Iedbc4acd9f9218f8fe72a44a9eff6a35b5494d75
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-31 20:22:30 +01:00
Bradley T. Hughes
fde3b2e93c Move QPrinter::init() to QPrinterPrivate::init()
This method is private, and only called from the QPrinter constructor.
This also removes warnings about overloading the virtual
QPaintDevice::init() method interitted form QWidget:

../../include/QtPrintSupport/../../src/printsupport/kernel/qprinter.h:259:10:
warning:
      'QPrinter::init' hides overloaded virtual function [-Woverloaded-
    void init(PrinterMode mode);
         ^
../../include/QtGui/../../src/gui/painting/qpaintdevice.h:93:18: note:
hidden
      overloaded virtual function 'QPaintDevice::init' declared here
    virtual void init(QPainter *painter) const;
                 ^

Change-Id: I7c5203a1264b0ad825ed4075b66017fef22a40fb
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-31 20:21:49 +01:00
Samuel Rødal
ba92fe9222 Re-added hellogl_es and ES 1 support for QOpenGLContext.
Change-Id: I576cf3595cdeeefb4ed840bb3b2b7097b3609cc7
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-10-31 12:37:51 +01:00
Olivier Goffart
73b682d816 QRecursiveMutexPrivate should not inherit from QMutexPrivate
QMutexPrivate takes more memory than necessary, and also initialize
platform specific ressources.

Change-Id: I70be1b89b1c21499645785ae47693a6b2514e28b
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-31 12:16:11 +01:00
Olivier Goffart
72257f6429 Rename QBasicMutex::d to QBasicMutex::d_ptr
Because we use d as a local variable.
We used this->d to refer it, but this can be confusing to have twice the same
name

Change-Id: I570aa5f444ada358eb456d6b3d9b8bfa60b10bbf
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-31 12:14:04 +01:00
Olivier Goffart
3c0a26b79f Add missing include when enabling deprecated code
QStringList is used by the inline code.
(I did not see that before because I was using precompiled headers)

Change-Id: Ieea4f13c143495f841b5246d835b584cc7404ac6
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-31 11:36:42 +01:00
Friedemann Kleint
9d43b8d970 Gui/OpenGL: Remove remains of qpa from profiles.
Change-Id: Iff2531a19030bd782ee4cd9bbe529d18666503f9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-31 11:35:49 +01:00
Friedemann Kleint
e277575987 Fix most warnings about assignments of QAtomicInt.
Change-Id: Ide409d72d2637b68ec2a85aaca4bc783a7e911e7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-31 11:29:08 +01:00
Lars Knoll
5761d8546f Correctly handle null windows or widgets in keyClick()
Allow passing of null windows or widgets to keyClick().
In that case route the event through the normal Qt event
processing. This allows e.g. shortcuts to catch the
key event.

Change-Id: Ic9455ea9be5164918b1c0bccbd58dd32eae74ff1
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-10-31 09:55:07 +01:00
Sergio Ahumada
79e7fb4ed6 Fix use of qMax() with floating point constants
When passing floating point constants make sure
to cast them as qreal's.

Change-Id: I17e7ee407ac4f92ce947f6a384aa4d64edb8e983
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-30 20:24:37 +01:00
Olivier Goffart
4fe3cf8ee9 moc: support c++11 style enums
Task-number: QTBUG-21480

Change-Id: Ic116a5a06dd68036823f27146e49511c68cf2de6
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2011-10-29 21:18:45 +02:00
Lars Knoll
d94c61a941 Remove S60/symbian specific code
Clean up and remove Symbian specific code and
data.

Change-Id: I89976fd087d485e04d37eccd3aeb3d2beac59b0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-10-29 21:18:45 +02:00
Olivier Goffart
1c029324bc Remove symbian threading primitive.
Those are already outdated and do not compile anymore
(QMutex has changed too much)

Better to remove that dead code so it do not show up in grep anymore

Change-Id: I096e7a73e23cbb77050843c2e1c10929086fdb8f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-28 22:20:22 +02:00
Lars Knoll
96e032c8ce Correct dependencies for the platformsupport library
Without this make -jx would often fail as some of the
dependencies of the platformsupport lib weren't built
yet.

Change-Id: I1e4fea5fa6f0dd5751b6b53458f1f14bfeb225b2
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-28 20:56:07 +02:00
Lars Knoll
9f0796c765 Remove stuff related to obsolete platforms
Qt/Embedded and Symbian are no longer supported.

Change-Id: Ifb86a384c666f389a166efe798d4792115731adb
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-10-28 20:55:13 +02:00
Robin Burchell
a2337f79ff Remove Windows and X11 from src/widgets/platforms.
This is dead code, unused with QPA in place, so remove it to avoid confusion
caused through grepping for class names existing in both old and new places.

Mac code is left in place for now, as some of it is still in use.

Change-Id: Ia82cd5bbabe71285ca997f79d8fd9c0504e32c28
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-28 16:29:13 +02:00
Friedemann Kleint
1cae2fdb86 Examples, plugins: Remove remains of qpa in profiles.
Change-Id: I0fc45c6c4df6d1f07472aec30b9e64b55db8e543
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-28 15:04:54 +02:00
Bradley T. Hughes
d23c1a9323 Mark QAtomic* implicit cast and other operators as deprecated
Add Q_DECL_DEPRECATED to all methods that are pending removal once
http://codereview.qt-project.org/#change,6243 is merged.

This is necessary to give people time to react to the source
incompatible change.

Change-Id: Ia72f184d630d593f96dd1d95ad6cd0d3bd5d811c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-10-28 13:43:26 +02:00
Samuel Rødal
77d30df7e5 Get rid of legacy glTexParameterf calls.
ES 1.0 didn't have glTexParameteri, which is why we sometimes used
glTexParameterf. However, we shouldn't use glTexParameterf because
that's treating integer values as floating point, which is not type
safe. ES 1.1+ and ES 2.x have glTexParameteri, and we don't really care
about supporting ES 1.0 in any case in Qt 5.

Change-Id: I6b586b31ddc418ba319c4cc88f6bb3978fdbd040
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2011-10-28 12:14:10 +02:00
Charles Yin
2c7ef2cee0 Update qmltest usage help
Add "-translation" command line option

Task-number:QTBUG-22390
Change-Id: I0600b92767b73ccb54e8d70f6c7bb8bf8075c81c
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2011-10-28 05:53:21 +02:00
Oliver Wolff
b4c8ac299f Freetype: Do not unlock face when returning superclass value in lockedAlphaMapForGlyph
If the face is unlocked in this case, calling unlockAlphaMapForGlyph after doing
the operation will cause an assert.

Change-Id: Icb2310a3b139e5bedf24f9c3794bd7d3fd38cfea
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-10-28 00:49:53 +02:00
Bradley T. Hughes
6476ac738c Replace implicit QAtomic* casts with explicit load()/store()
Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-10-27 18:57:38 +02:00
Friedemann Kleint
434824aede Fix compiler warnings.
- Fix gcc 4.6.X warnings about assigned but unused variables
- Remove trailing ';' from inline functions (Clang)

Change-Id: I8670afd6b149748a740f22c65de137762e9f18e1
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-27 16:35:12 +02:00
Bradley T. Hughes
d2aaa13820 Use load() instead of implicit cast when using QueuedConnection
queued_activate() sets the argumentTypes atomic pointer on first use, which
mixes a load, memory initialization, test-and-set-ordered, and
another load. The explicit memory ordering is necessary to ensure
that the memory stores happen in program order.

Change-Id: Id1f8641f9cd081ce81aa8e830692f7af8261e84b
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-10-27 16:33:24 +02:00
Bradley T. Hughes
916460929d Move the implementation of normalizeTypeInternal()
This function is only used in src/tools/moc/moc.cpp and
src/corelib/kernel/qmetaobject.cpp. We don't need to include the
static, non-inline declaration and definition every time
qmetaobject_p.h is included.

This also silences the related warning from clang:

../../../include/QtCore/5.0.0/QtCore/private/../../../../../src/corelib/kernel/qmetaobject_p.h:171:19: error:
      function 'normalizeTypeInternal' is not needed and will not be emitted
      [-Werror,-Wunneeded-internal-declaration]
static QByteArray normalizeTypeInternal(const char *t, const char *e, ...
                  ^

Change-Id: I6dfb2cb4d9d82a2ae7795f91169aa62f9a5f2c2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2011-10-27 14:56:14 +02:00
Sergio Ahumada
73e1a1c27c Add QT_BEGIN_HEADER/QT_END_HEADER macros
Fixing `macros' function test of `tst_headers'

Task-number: QTQAINFRA-324

Change-Id: I9e78d5f33dcd89718d90e0d2a40a02eba80f6ca9
Reviewed-by: Liang Qi <liang.qi@nokia.com>
2011-10-27 14:56:14 +02:00
Bradley T. Hughes
ac96f78398 Compilation fix (cannot assign const pointer to non-const pointer)
After reinterpret_casting to const NSString *, we need to const_cast to
drop the cast to match the return type.

Change-Id: I3d202aec10e719a48f29d96b81621492936ac6ad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-27 14:56:14 +02:00
Oliver Wolff
a73c357500 Fixed crash in printsupport on Windows
Change-Id: I3fec51b9f5c55296041b79bbf6da9d7687ae9afd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-27 14:56:14 +02:00
Olivier Goffart
104f8671ff Compile with QT_ENABLE_DEPRECATED_BEFORE set to old version of Qt
Change-Id: Ice67071cc97ad645a7dda264a3dce184fceae75a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-27 13:32:16 +02:00
Steven Ceuppens
fca432c1c0 Add QDataStream operators to QMargins, so it can be streamed
* QDataStream format documented
 * Added Unit test for QDataStream operators

 * Updated Unit test

Change-Id: Idbcfcb0b927e6369e8d31b57693c7aa0d1a154e7
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-27 13:32:01 +02:00
Friedemann Kleint
ddce31c12f Do not call setCursor on Desktop or if there is no platform window.
Fix a crash on Windows.

Change-Id: I2b88e113d7149444ebc8946c0ee0eba7a9b5bbc2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-27 13:28:56 +02:00
Bradley T. Hughes
4a81c29c47 Use load() when constructing QSimpleCodec's reverse map
The implicit casting results in unnecessary volatile loads. The
test-and-set-ordered doesn't need full ordering, test-and-set-release
is enough to ensure that the memory initialization done by
buildReverseMap() and test-and-set happen in program order.

Change-Id: I168b504271aeba050d6b8396becbdeb3ef938213
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-27 11:12:38 +02:00
Friedemann Kleint
19b029cd9d Windows: More fine-grained paint event handling.
Pass expose events to GL widgets, handle invalid
update rectangles, ignore WM_ERASEBKND (using code from 4.8).

Change-Id: Ide062efb392292fff556d37b0ef0e880676748a2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-27 11:12:38 +02:00
Tero Ahola
abf25d3f64 Fixed resource leak when setting QProgressBar style sheet
Task-number: QTBUG-19110

Merge-request: 2687
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
(cherry picked from commit ecd78168271cfe71715e074a50752712f4aa3229)

Change-Id: I49fdf0f74b903313089eb8cd778c80a19d34b461
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-27 11:12:38 +02:00
Simon Hausmann
92740638df Initial support for MeeGo's input method server
This platform input context plugin is based on the dbus protocol used in MeeGo
1.2 Harmattan's input method server.

It supports composition, mouse-click-on-preedit as well as basic input method
hints. Missing are: Copy & paste, preedit injection, key redirection as well
as a bunch of other smaller MeeGoTouch specific features.

Change-Id: Ic3a8741f7a5ed18b379985e316cb137f7b8f6a8e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Kenneth Rohde Christiansen <kenneth.r.christiansen@nokia.com>
2011-10-27 11:12:38 +02:00
Frederik Gladhorn
5aa14793c4 Add default actions to QAccessibleWidget.
Change-Id: I9f251aad663fd0b8db2ef068c6581241d91c090d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-27 11:12:38 +02:00
Morten Sorvig
8f912c5c0f Native file dialog support for Mac
* New API: QPlatformDialogHelper to support native dialog on QPA.
    (Currently, It supports only file dialog.)
* Modify QDialog* and QFileDialog* to support native dialog.
* Add native file dialog support to cocoa platform plugin.

Change-Id: I957f046748a27a33fd9f8af3c525feabd1b0f582
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-27 11:12:38 +02:00
Thiago Macieira
a94c960b75 Unix (non-Glib) event dispatcher: round sleep to millisecond boundary.
If we have two timers running in an application with the same timeout
and started almost at the same time by the code, they would trigger two
sleeps, the second of which very short (under a millisecond).

This causes us to match the Glib and Windows event loops, which round
all timers to millisecond anyway.

Change-Id: I7eb531e02dadf75925c01192b0f33ef3641ae1ea
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-27 11:12:38 +02:00
Morten Sorvig
3849455ee7 Cocoa: Set correct child window geometry.
Remote globalGeometry which was completely wrong,
replace with flipRect which converts from Qt
screen coordinates to OS X screen coordinates.

Change-Id: Ie560cb7c2266fe779da8a44a35596d2d12af77f5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-27 09:38:26 +02:00
Morten Sorvig
db44fdf4d6 Cocoa: Implement propagateSizeHints.
Change-Id: Idc1244ffbf975972f01d9ee48092500a72739d37
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-27 09:37:29 +02:00
Morten Sorvig
014581f255 Fix spelling
Change-Id: If9630ffa3a1c411b2e56b41ed35c272177343274
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-10-26 23:59:51 +02:00
Ritt Konstantin
42402a1672 replace 'const QChar &' with 'QChar ' for QChar and QString
Merge-request: 69
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

Change-Id: I61f5a54b783252029fcad95677958fa6a2130d01
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-26 19:59:36 +02:00
Friedemann Kleint
82d6518696 Windows: Fix Open GL formats.
- Add swapInterval as additional format
- Query context format correctly and store in separate struct
  (default vs requested/obtained)
- Cosmetics, rename enumerations, structs.

Change-Id: I381cf8e1bde33e6624feb549437c7b95dd85e93c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-26 18:06:39 +02:00
Oswald Buddenhagen
a144e0bfdc Revert "Use memmove in QListData::append(int) as regions overlap."
We have proven that the regions cannot overlap. The root problem must be
somewhere else.

This reverts commit d96b7b809e.

Change-Id: I3446487f2a1a5bd322379b8adb788c26ff3e08e2
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-26 18:06:39 +02:00
Frederik Gladhorn
b8d702dc8e Implement child instead of navigate in QAccessibleMainWindow.
Change-Id: I321ce4f8bb6e724db87a0419f890174b32cc1fe2
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-26 13:50:12 +02:00
Friedemann Kleint
264272fb88 QtPrintSupport: Remove Q_WS_QPA, qpa sections from .pro files.
Compile without -qpa.

Change-Id: Icfbf733964a7d6db80f8ec706a4b6fe84cd71b4d
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
2011-10-26 12:29:03 +02:00
Bradley T. Hughes
6d89ef35ad Remove unnecessary sources from the bootstrap library
The ISCII and TSCII codecs are not compiled in due to QT_NO_CODECS,
likewise for all of the system locale implementations due to
QT_NO_SYSTEMLOCALE.

Since these sources do not result in any symbols, there's no reason
to compile them.

Change-Id: I3b65c156f594366850df9f44406ba7638ad735ba
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-25 22:17:07 +02:00
Bradley T. Hughes
87b1ca756c Silence warning from clang
../../corelib/tools/qlocale_mac.mm:78:13: warning: '&&' within '||'
      [-Wlogical-op-parentheses]
  ...&& !qt_splitLocaleName(QString::fromLocal8Bit(result), lang, script, cntry)...
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../corelib/tools/qlocale_mac.mm:78:13: note: place parentheses around the
      '&&' expression to silence this warning
            && !qt_splitLocaleName(QString::fromLocal8Bit(result), ...
            ^

Change-Id: I64f745e7dfa64f28f264667372ed64f9e34ca3b7
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-25 22:14:10 +02:00
Xizhi Zhu
15a2ed4e1d Remove the QT_MOBILITY_BEARER macro.
It was originally added to keep compatibility with the bearer management module from Qt Mobility, and no longer needed in Qt 5.

Change-Id: I187494e02a71c3d39a52f8c0bd4d0c7cc23d0b4b
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
2011-10-25 17:22:34 +02:00
Oliver Wolff
318a274381 Readded PrintSupport for Windows
The prepared plugin architecture for
printing support was used as much as
possible but some functionality had to
be done in src/printsupport.

Change-Id: Ic8446cb8018a0970b4da97c1912ba6dc20d2a09f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-25 15:55:10 +02:00
Laszlo Agocs
54c132480b Update readme about xcb plugin dependencies
Change-Id: Ia317ce96db3400f43cf800619fddcf76b5ab450a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-25 15:50:56 +02:00
Friedemann Kleint
8afc067647 QtGui: Remove Q_WS and qpa.
Enable compilation without -qpa.
Remove QT_NO_FREETYPE and QT_NO_FONTCONFIG when building.

Change-Id: I0e017cc47ee06b885be65deaeb67a449a119b8be
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-25 12:53:46 +02:00
Arvid Ephraim Picciani
b22d290a37 QNAM: make systemProxyForQuery respect http_proxy
the generic systemProxyForQuery will use http_proxy from the
environment, if it is set.

Change-Id: Ie685c47eb6df1fdd2ab223defc7172bb25e6fe30
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-25 11:31:50 +02:00
Frederik Gladhorn
8bf83267ec Sanitize QAccessible includes.
Change-Id: I86f5ae75293e5e4d370363d84402f4e7fad03a9e
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-25 08:42:23 +02:00
Bradley T. Hughes
642fe4040b Compile with clang
Clang does not accept this syntax, see
http://llvm.org/bugs/show_bug.cgi?id=8875

The work around is to not use the typedef name. NS() around the
template parameters is necessary to match the real types (and
not the QMetaType::Type enumerators), otherwise we get the following:

kernel/qmetatype.cpp:1647:72: error: template argument for template type
      parameter must be a type
  ...NS(QVariantMap)* >(where)->NS(QVariantMap)::~QMap<QString, ...
                                                       ^~~~~~~

Change-Id: I3afa0cbbe4ef7ad899cfa9eafb3bcc10bedc20b3
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-24 15:39:33 +02:00
Olivier Goffart
4bff8ea4d4 Improve drawing scaled image with raster using SSE2
That codepath is taken in qml when an Image specify with and hight and
is not smooth, and the image contains alpha contents

The changes in qdrawingprimitive_sse2_p.h just put some code from the
BLEND_SOURCE_OVER_ARGB32_SSE2 macro into a sub macro to allow its reuse

The code that is not SSE2 in qt_scale_image_argb32_on_argb32_sse2 comes
from the qt_scale_image_argb32_on_argb32 in qblendfunctions.cpp

Change-Id: I071a040af4514fb21777dead9f7c5baf16071d59
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-24 13:56:59 +02:00
Shane Kearns
cea8e41dc8 Network - Use isLoopback API in place of existing localhost checks
Various places in QtNetwork checked for Localhost or LocalHostIPv6,
i.e. 127.0.0.1 or ::1. By using the isLoopback API, other loopback
addresses are treated the same way (e.g. 127.0.0.2 and ::ffff:127.0.0.1)

Task-number: QTBUG-22246
Change-Id: I46f55630d8646fd68034a509969a0b7cb72ca77c
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-24 13:56:41 +02:00
Shane Kearns
3736dcb65e Network - Add QHostAddress::isLoopback API.
The standard IPv4 loopback address is 127.0.0.1, however anything in
the 127.0.0.0/8 range is also a loopback address.

isLoopback returns true for any address that is in the IPv4 loopback
address range, or is the single IPv6 loopback address ::1

Task-number: QTBUG-22246
Change-Id: Ic39100e2e97a52db700e01b109998a1cfd4335e3
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-24 13:56:41 +02:00
Shane Kearns
29c30a20ba QIODevice - disallow setTextMode when not open
Calling setTextMode() before open() would make the device appear to be
already open and cause later errors.
Added a qWarning and documentation update to prevent this API misuse

Task-number: QTBUG-20905
Change-Id: I2e06cd8e79f4afcf27417ac0eae6ebef980a17aa
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-24 12:30:53 +02:00
Friedemann Kleint
1d01bc1e83 corelib: Remove Q_WS-macros.
Q_WS_QPA is the only active code path after merging
refactor, other Q_WS-macros are no longer used.

Enable compilation without -qpa.

- Remove Q_OS_MSDOS, Q_OS_OS2
- Remove Q_WS_QWS
- Remove/replace definitions/conditionals of Q_WS_XX
- Remove qpa branches from profiles
- Replace Q_WS_MAC by  Q_OS_MAC
- Replace Q_WS_MAC && !Q_WS_QPA by
  Q_OS_MAC && !QT_NO_CORESERVICES
- Similarly in profiles: mac:contains(QT_CONFIG, coreservices)
- Replace Q_FS_FAT by Q_OS_WIN

Change-Id: Icce5a6c55b052c8f72b3b979ddf31a4f388ea9c9
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-24 11:04:04 +02:00
Jiang Jiang
8c13b6b21f Keep Multi font engine in QFontCache
If we only keep single QFontEngineFT in QFontCache, then when we
are looking for the MultiQPA next time with the same QFontDef,
the FT engine will be returned and we get no font fallback support.
That's why we need to keep the Multi engines in QFontCache as well
and distinguish them from the single item. Since QPA doesn't use
'screen' field of QFontCache::Key structure, we use it here to
indicate that we are caching a multi font engine.

Change-Id: Id899d5c5ba52f4bccf134bcd6b1c6386ba22063c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-10-24 11:04:04 +02:00
Michael Brasser
7cef4b6463 Allow commiting and then reusing a QTouchEventSequence for testing.
This method allows calls to stationary() to automatically remember
the previous position for a given touch point id. Example usage:

QTouchEventSequence sequence = QTest::touchEvent(&window);
sequence.press(0, QPoint(10,10)).commit();
sequence.stationary(0).press(1, QPoint(40,10)).commit();

Task-number: QTBUG-22057
Change-Id: I489ab3d61f4637d2ed97d09ed0854afa814407a1
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-10-24 06:39:20 +02:00
Jason McDonald
f49bd47099 Remove legacy Symbian code from qtestlib.
Change-Id: Ia4ac52ce0b5f5a4ba1fcd6594daf424fd7208777
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-24 05:00:44 +02:00
Pekka Vuorela
29aa93387b Multiline editors not to limit anchor position inputMethodQuery
The queries were limited to current block, because that is the
available surrounding text. Input method side, however, cannot then
distinguish between anchor being really at start or end of the
surrounding text, or beyond it. Without the limitation there at least
is a way to know anchor is at unknown territory.

Change-Id: I388d33566388344ec816ea7d86662b7e36a3d7d0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-10-24 03:31:10 +02:00
Frederik Gladhorn
7ec068f7f0 Remove QAccessibleWidgetPrivate inheritance of QAccessible
Change-Id: Iaa7455adc5845e6daceb7eaf9384cd5560fb2cd6
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-23 20:38:40 +02:00
David Faure
dfa24768a3 Deprecate QDesktopServices::storageLocation/displayName
Which required porting the related unittests to qstandardpaths

Change-Id: I6eb63c46845f05cd29cc42b59872707526277c90
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 15:28:25 +02:00
Jason McDonald
59f91c0194 Make some qtestlib headers private.
These headers should have been private from Day One.  Make them private
now so that nobody will be tempted to use them outside testlib in the
future.

Change-Id: I5361777ade124d8187176f9af3cc79cd1a8ecb4f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-23 10:24:50 +02:00
Morten Sorvig
5603f94eaa Remove "duplicate objective-c class" warning.
Qt would dlopen both libqcocoa.dylib and
libqcocoa_debug.dylib, causing duplicate implementations
if the classes in the cocoa plugin (QNSView etc)

Fix this by building the release version only.

Change-Id: I1244a83c49999ce28edd97400e792fa2a0665fec
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-23 10:23:32 +02:00
Morten Sorvig
f6e0a2f59f Cocoa: clean up compiler warnings.
Change-Id: I2cb65bb455b79b218a317b21e5a3b0d9792e0e22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-23 10:23:23 +02:00
David Faure
83c219dfe2 Rename storageLocation() to writableLocation().
Change-Id: I8f6522a70950f78ddd6141360d36d104bd697e28
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 00:57:03 +02:00
David Faure
ddc093b90e Add QStandardPaths::RuntimeLocation, for sockets ($XDG_RUNTIME_DIR)
Change-Id: I19c36a04a9deae49ffc20fdec6a2a7eb05155cb4
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 00:56:56 +02:00
David Faure
4b72c3f434 Add QStandardPaths::findExecutable.
Change-Id: If30a83622e2ac5af48e47a38b8f70fce73044d74
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 00:56:51 +02:00
David Faure
8f3032dfe0 QStandardPaths: add Config and GenericData, add methods
New methods: standardLocations, locate, locateAll.

Change-Id: I60bc90f8df53727a72c4b1839ea4d1d88a204e29
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 00:56:39 +02:00
David Faure
86558de341 Move path information from QDesktopServices (gui) to QStandardPaths (core)
Change-Id: Ic596c21894d83b4dab0c3f5b1aed916ddd590f2f
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
2011-10-23 00:56:31 +02:00
Friedemann Kleint
4a788eb831 QWindow: Re-create platform window only if screen actually changes.
Change-Id: I3b7dd8b1307aa3cc9357dca861ea407644c5a2e9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-22 20:50:37 +02:00
Lars Knoll
68dc5b90c0 Add virtual QWindow::focusObject() method
The method allows to retrieve the object that currently
has the input focus inside the Window. This is e.g.
required to correctly determine the context for keyboard
shortcuts.

Change-Id: I9e05ef62717973bac275ce34cc70fb86aa2d1e5b
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-22 19:18:20 +02:00
David Faure
e19292120b Fix two typos: docu for "deprecated since" and Q_DEPR... -> QT_DEPR...
Shows that there should be an automated build with
QT_DISABLE_DEPRECATED_BEFORE set to 0, too...

Change-Id: If154786ea26bcbfab41efcd7001c222cc258a8af
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-22 15:02:17 +02:00
Bradley T. Hughes
53674983e0 Compile with clang
When using methods from a template base class, the lookup needs to be
qualified. See http://clang.llvm.org/compatibility.html#dep_lookup_bases

Change-Id: I5b7cd71e0d45414ac0eff97fe9ba5d3ccd5bd9e6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-22 05:05:22 +02:00
Thiago Macieira
c2ca2d7fb3 Add Q_DECL_CONSTEXPR to a QChar, QLatin1Char and QLatin1String constructors
These types now technically are trivially-constructible and
standard-layout in C++0x.

Change-Id: I455bd905fd6e237a1dff517b86dcbe59d571266f
Reviewed-by: Olivier Goffart <ogoffart@kde.org>
2011-10-22 00:16:33 +02:00
João Abecasis
53aa54fb94 Off-by-one error in assert condition...
While this was safe, it was also over-zealous, disallowing the path from
ending with the placeholder... Incidentally, the default.

Laughed-at-by: w00t_
(cherry picked from commit 7b693627ee2a17718cb6d8bee5e3deb5a97b307f)

Change-Id: I61a1511bca5cafe2edde20ef38c23154200dfcab
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:55 +02:00
João Abecasis
5658572a27 Leftovers from 401722ef9e6fe79bd41f9d5f79668f5c4997c8e6
This no longer necessary template specialization went unnoticed inside
the Windows/Symbian #ifdef. It breaks compilation on those platforms,
now that qstringbuilder.h is not included and QConcatenable is unknown
to the compiler.
(cherry picked from commit 9e656ce0f7bda4bca4ae55a7aefe1617bc2805ac)

Change-Id: Ie7145c25bca01b808fa6a3fd99e34baa8375d304
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:48 +02:00
João Abecasis
fd61059d35 Fix QTemporaryFile regressions and new found issues
With this change, the file template is always processed in original
QString format. Trying to generate native paths before adding a missing
placeholder mask could change the meaning of templates, such as "." and
"..", which are now tested to mean "..XXXXXX" and "...XXXXXX",
respectively.

After ensuring the template includes a placeholder mask, the path is
converted to a native *absolute* file path and the mask is sought for
again. On Windows, native paths were already absolute. On Symbian, we'd
need at least a clean path, as "." and ",," are not natively understood.

There is a requirement that the placeholder mask /XXXXXX+/ makes it
through this conversion unaltered, which relaxes prior requirements on
*nix platforms. On Windows and Symbian the conversion is under Qt's
control and not user-configurable.

Reviewed-by: Shane Kearns
(cherry picked from commit 401722ef9e6fe79bd41f9d5f79668f5c4997c8e6)

Conflicts:

	tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp

Change-Id: Iac823881c865adf0931dc4f429c6c1ef135eeb56
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:42 +02:00
João Abecasis
c9fde0d590 Use "native paths" on POSIX platforms as well
And don't rely solely on "local8Bit" conversions.

QFile defines an API for overriding how encoding conversions are done
for filenames. In generating unique names, QTemporaryFile ignored that
API and hardcoded the use of local 8-bit, implicitly assuming that that
was appropriate.

With this change, we switch that assumption to one where user supplied
encoding function keeps the byte value of 'X' and '/', also assuming
that encoded 'X' takes up a single-byte (i.e., the byte sequence for
"XXXXXX" remains unchanged).

There was also, and there still is an assumption in name generation that
byte values for ASCII alpha-numeric characters are valid in the "native"
encoding.

In practice this change is compatible with UTF-8, Latin-1 and other
ISO/IEC 8859 encodings. At any rate, it's very likely that only UTF-8 is
relevant here.

Reviewed-by: Denis Dzyubenko
(cherry picked from commit 0de701d01cb221464eed773fd3751aff73fe4d60)

Change-Id: I9ee0fe8e3cad48694d5ec9a2bedd5412cfc0d172
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:34 +02:00
João Abecasis
69dd45c2d8 Cleanup #includes
These are already required and included by qfsfileengine_p.h.
(cherry picked from commit a153d50eea2dea0925695a90af2c12f1887a9020)

Change-Id: I9efb635373239f6e6778eb4a3ee85c396cfeeeb5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:26 +02:00
João Abecasis
f4f729cb7b Atomic implementation of create file and obtain handle for Win/Symbian
Besides generating a unique name, createFileFromTemplate now also
acquires a file handle on all platforms. The file engine's native handle
is passed by reference and modified in place.

This fixes a long standing security issue on Windows.

On Windows and Symbian platforms we directly use the "native" file path
when processing the template and generating the unique name. Since the
native encoding is known, conversions at this point are safe.

Errors other than "file exists" are propagated to Q(Temporary)File,
and result in a failure in open(). The changes also unify error handling
and should give consistent behaviour across all platforms.

Worthy of note, there's a change in behaviour on Windows and Symbian:
fileNames returned by QTemporaryFile on Windows and Symbian are always
absolute after open has been called. This has to do with how
QFileSystemEntry::nativeFilePath works on these platforms. (Test was
updated to reflect change in behaviour.)

Reviewed-by: Gareth Stockwell
Reviewed-by: Shane Kearns
(cherry picked from commit ff9b69838ec146aeb43d4af8a03043f9c5f0454d)

Conflicts:

	tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp

Change-Id: Ibc9affb321ea4f4b193efc1f7336c9770b43d8df
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:18 +02:00
João Abecasis
a4a09488ee Minimize encoding conversions when generating unique file name
With minor adjustments, createFileFromTemplate is made to work directly
on (UTF-16) QString data, which is already in the native encoding for
Windows and Symbian. This is possible because the function only fills
out the placeholder sub-string, without touching adjacent characters.

This eliminates unnecessary conversions on those platforms.

Reviewed-by: Gareth Stockwell
Reviewed-by: Shane Kearns
(cherry picked from commit 9a76587363a2f37312326286e08cce502f7fe27e)

Change-Id: I8732b88ece5e2befb2da2e717758954c9aa7e5b0
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:09 +02:00
João Abecasis
b3ca1d4a84 Use QStringBuilder when copying template for modification
This avoids modifying the original string in the case where a
placeholder marker is not found. By marking the variable const we
further avoid checks on the reference count and detaches, also allowing
us to safely reuse it later in the function.

The new approach also fixes an issue where suffix wasn't empty, but the
toLocal8Bit conversion would be. This resulted in a buffer overflow
inside createFileFromTemplate.

Reviewed-by: Shane Kearns
(cherry picked from commit d71d3b1ce31ffc585258330d825ff8ea535254ef)

Change-Id: I6cb3fbc6c653d8a881426fddbc433826365d4816
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:20:03 +02:00
João Abecasis
6d8963971a Make Symbian follow Windows code in temporary path generation
On the one hand, we stop using OpenC here. On the other, we no longer
use an atomic create and obtain file handle API -- just as we don't on
Windows yet.

This is a stepping stone to removing back and forth conversions of path
names when generating unique names and also towards the use of native
APIs for creating and obtaining a file handle atomically.

Reviewed-by: Gareth Stockwell
Reviewed-by: Shane Kearns
(cherry picked from commit 63bb67d3107b03f399cddf4c9cca9c7eb347b62d)

Change-Id: I97b3b6179dff053807acc8d4469fdf57f57f68a6
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:19:56 +02:00
João Abecasis
56ffec36c6 Encapsulate pointer manipulations to createFileTemplate function
, where we actually control how we use the pointers. Reduce some code
duplication in #ifdefs.
(cherry picked from commit d69788728ccd843e3d4a372680185fdf5e711c86)

Change-Id: I50aafbcac520837f9dc751e85f59a482a2f5225f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-21 22:19:44 +02:00
Friedemann Kleint
fc14bd2c92 Widgets: Remove Q_WS_QPA and qpa-sections from .pro files.
Enable compilation without -qpa.

- Remove conditionals from Q_WS_QPA sections.
- Rename precompiled header.
- Remove gui-related Q_OS_SYMBIAN-#ifdef sections.
- Leave other Q_WS code in for reference.

Change-Id: I16326b631fff483aec8edd2f7a2e7a1822eab814
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-21 21:29:46 +02:00
Holger Hans Peter Freyther
c7df1af337 [directfb] Implement grab/ungrab of keyboard/pointer
Change-Id: Ie2b99bb659e324c63bfd23e96d6c89c13a8df3b4
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
960502d91a [directfb] Remove grabbing of the pointer on input
This should not be done on the input level but we should handle the
requests on the QWindow to grab/ungrab the pointer

Change-Id: Ibc61b300bf8de20f576fb8972fadf18de4a142c1
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
c8746d886f [directfb] Implement QPixmap::fromFile using DirectFB routines
The code is based on Qt 4.8 DirectFB support, it was reduced
in size (cosmetic changes, by using the outPtr()) and it has a
bugfix to pass loadAsBitmapOrPixmap that assumes the loadFromFile
routine will add '.png' and other extensions to the file.

Change-Id: I25b11206053c02be5c04730fba5bb42bd07426d1
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
b1c803a925 [directfb] Prepare to select the alpha/opaque pixel formats
Right now we assume to use 32bpp but depending on the hardware
this might not be optimal at all. Begin to prepare the code for
not having a 32bpp surfaces.

Change-Id: Iedfa49c568559e074dfaeae2a216c9eb93721d2c
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
d43775b93b [directfb] Manage the font database with a QScopedPointer
Attempt to fix a memory leak on exit by deleting the font database.

Change-Id: I07b0865c97bb8ef26950bf231b5239ca01e95c56
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
577d51ee22 [directfb] Remove some duplication in the QDirectFbBlitter c'tor.
Introduce dfb_blitter_capabilities that returns the QBlittable::Capabilities
of the DirectFB blitter.

Change-Id: Ifb803ff4f07376d5333ad2d05ff72d9a63d17fff
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
91e99d1420 directfb: Initialize m_dfb after DirectFBInit has been called
The QDirectFBIntegration is responsibe for deleting the DirectFB
instance but it can only initialize the DirectFB instance after
the DirectFBInit has been called. Change the order. This issue
got introduced by myself in 3faa89f4.

Change-Id: Ia67d439152d895e2e0a47f35eed57348c629f79f
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
500dc2a6f8 [directfb] Introduce the QDirectFBPointer from QWS/gfxdrivers
Introduce QDirectFBPointer and use it throughout the code to
fix various resource leaks in the DirectFB backend. Fix the surface
ownership of the IDirectFBSurface in the Blittable/BackingStore
code.

Change-Id: I0d4572eaab80b3558e644f26d76222461bf37bbb
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
405894fc39 [directfb] Make QDirectFBInput a QThread to allow proper exits
Without this patch the application will get stuck waiting for the
IDFBEventBuffer to report an event. We will use the
IDFBEventBuffer::WakeUp function to interrupt the waiting but this
produces the below error on exit:
QEventLoop: Cannot be used without QApplication
QThread: Destroyed while thread is still running

This is solved by making the QDirectFBInput a QThread, reimplement
the run() method to handle the events. It should work as this is
only posting events to the QApplication event loop.

Change-Id: I24adf2b080f96c72ede6a5499f484ac33fdd44fc
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
acd09c21f7 [directfb] Use QScopedPointer to manage heap allocated objects
Use QScopedPointer to avoid trying to manually delete objects. For
some of the cases the leak would only be viewable when things are
getting shut down. Leave in some more warnings for cleaning it up,
e.g. the m_eventBuffer of the Input is leaked and the input task will
only stop after another key event.

Change-Id: Ic54568343605b4ab7094a7dece40e22250184a37
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
9e54d1deab [directfb] Fix memory leak when passing arguments to directFB
We need to delete the array but also the elements inside it.

Change-Id: Ib61beeca569802638b9ff3b94ede79c0beebb399
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
421abf8d59 [directfb] Do not call a pure virtual function
In 688d9f6ec0 the base class
was changed from QWindowSurface to QPlatformBackingStore but
QPlatformBackingStore::resize is pure virtual now.

Change-Id: Ib36f177d80e9458e7e8e34f587e4554c0462e35c
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
d8fc8aa585 [directfb] Rename class from WindowSurface to BackingStore
Catch up with the naming by renaming the file from windowsurface
to backingstore, update the class names and include files.

Change-Id: I1b16826b60c19490946a77f61518e18f8099adce
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
ab50b60f5c [blitter] Work on tst_QPixmap::clear()
By default QPixmap may not hasAlphaChannel(), only if setMask()
or fill() with a transparent color is called a QPixmap will
hasAlphaChannel().

Make the QBlittablePlatformPixmap remember if there is an alpha
channel, pass this as parameter in createBlittable to make it
clear that this is required and not optional.

Update the DirectFB plugin to handle this parameter to create a
RGB32 or ARGB Surface depending on the alpha value, also only use
PreMultiplied alpha when using ARGB. Separate the two constructors
for the QDirectFbBlitter to either adopt a DirectFB Surface or to
create one.

Change-Id: I8abf82408ecd2d075fc6f241ace8be2a34ac56e7
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Holger Hans Peter Freyther
6e13586d8b [blitter] Generate a new serial number when resizing the pixmap
The raster pixmap is generating a new serial number when the pixmap
is resized, do the same for the blitter code.

Change-Id: I05c74df7ea0f3a99ec9c24dacb41562da21c2d6d
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2011-10-21 16:54:45 +02:00
Friedemann Kleint
b256d7b3bb Testlib: Fixed compilation with MSVC.
MSVC does not like VA_ARGS tricks.

Change-Id: I947dcb89e519c18a482a504725213a3f4d9670ff
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2011-10-21 16:54:45 +02:00
Sergio Ahumada
e375637fe5 Fix compiler warnings when using QT_DEPRECATED
Change-Id: If62cff5d1cbd1c8051d709db8747777606797056
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-21 15:32:14 +02:00
Laszlo Agocs
d40f4105cd Remove mtdev dependency from the touchscreen QPA plugin.
There is no reason to enforce the usage of the mtdev library. As long
as ABS_MT_TRACKING_ID is provided protocol type A is perfectly enough.

This makes the plugin more suitable for embedded systems.

Change-Id: I73ce4a1056a6dc27daacb69dc4761bca393a7e43
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-10-21 12:34:50 +02:00
Shane Kearns
25c03a888f Use QBasicAtomicInt as a static variable
QAtomicInt has a constructor, so QBasicAtomicInt needs to be used
instead to allow compile time initialisation.

Task-Number: QTBUG-20343
Reviewed-By: Olivier Goffart
(cherry picked from commit 29495592d27505feff024d574e1333809794c304)

Change-Id: Ia531c74f47daa86ba24a1b01bee36ddb1101af11
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-21 11:05:12 +02:00
Jan-Arve Saether
60b86257b8 Expand QT_TR_NOOP("str") to "str", not ("str").
This enables us to write code like :
    QStringLiteral(QT_TR_NOOP("Press"))
or just:
    QT_UNICODE_LITERAL(QT_TR_NOOP("Press"))

It also makes it consistent with the QT_TRANSLATE_NOOP3,
QT_TRANSLATE_NOOP3_UTF8 and QT_TRID_NOOP macros, as they don't surround
the string literals with parenthesis.

Change-Id: I67c30bcd88609f897bd22afb44266affa4dcfc8f
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-21 10:56:24 +02:00
Sergio Ahumada
b7950b027f Fix some compiler warnings on Mac
Change-Id: I52b5c1822f9530f75eeebfcafbade6f89062e369
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 09:14:24 +02:00
Jason McDonald
dd31340245 Make testlib use #include consistently.
Change-Id: I36b5da3f832d2588072405d93143173edc29f4af
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 02:52:01 +02:00
Jason McDonald
98bd270fb7 Fix misleading comment on test execution order.
When executing a data-driven test, testlib executes the _data function
once, then repeatedly executes init(), then the test function, then
cleanup() for each row of test data.

Change-Id: Icfa1dd19a52fb1debbc92b7cbe13d85bfb0418c7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Jason McDonald
d766ae0457 Update QSKIP documentation.
Task-number: QTBUG-21851, QTBUG-21652

Change-Id: I3d4cf8e11756b92fe9d97f01a02c61cbf2df1556
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Jason McDonald
27f9f136f7 Remove SkipMode parameter from QSKIP calls.
The previous commit removed SkipMode from the testlib APi.  This commit
removes the parameter from all calls to QSKIP.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Jason McDonald
016cd01846 Remove QTest::SkipMode from qtestlib API.
When the SkipAll mode is used, tests only report a SKIP for the first
line of test data and subsequent lines are not reported at all.  This
behaviour makes it impossible for anything post-processing test results
to accurately report test pass- and run- rates because they cannot see
how many lines of test data were skipped.

This commit removes SkipMode.  QSKIPs in regular test functions and data
functions are treated the same as SkipSingle, so that every skipped line
of local or global test data is reported in the test log.  QSKIPs
elsewhere are treated the same as SkipAll -- skipping in init() causes
the next test function to be skipped entirely, and skipping in
initTestCase() or initTestCase_data() causes all test functions to be
skipped.

This commit only changes qtestlib and the selftests. A further commit
will change the autotests to remove the SkipMode parameter from QSKIP
calls.

Note that the change in expected output for the globaldata selftest is
deliberate, as the QSKIP in the skipLocal test function has effectively
changed from SkipAll to SkipSingle.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I7b1c53fe7ca9dde032810b789d967e2a402bbe5d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-10-21 01:20:29 +02:00
Shane Kearns
4aa4198240 FTP - fix interoperability issues with SIZE command
Certain FTP servers refuse the SIZE command in ASCII mode (proftpd)
or refuse the SIZE command in ASCII mode for large files.
This is a security feature, as the SIZE command requires reading
the whole file and counting line ends which can cause denial of
services. In binary mode, the file size on disc is reported, which
is a relatively quick operation.

Qt had two problems here:
1. when size command fails, the total size was reported as -1,
   whereas the documentation of QFtp::dataTransferProgress states
   it should be reported as 0 (so that QProgressDialog can display
   a wait note rather than progress bar)
2. SIZE command was sent before setting the type of the transfer
   to ASCII / Binary. This is a problem as the size reported by
   the server is incorrect. Also it usually means sending ASCII
   SIZE for Binary transfers, which results in the 550 error on
   FTP servers with DOS protection.

Task-Number: QTTH-1428
Reviewed-By: Peter Hartmann
(cherry picked from commit 72bf6105214bfc26cff33632f7f4bdeed9cdf362)

Change-Id: Ie1f356c34d6a04362eaca64befb00788f85c0ccb
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-20 23:56:40 +02:00
Richard Moore
78d02e93ac Add the ability to enable various SSL bug workarounds.
There are lots of buggy SSL servers around and to connect to them you
need to disable various features. This commit adds the ability to
disable the SSL ticket extension, the ability to disable the insertion
of empty fragments, and the ability to disable compression.

Task-number: QTBUG-21906

Change-Id: I3e1d0347a46e9030b889bbf15b2aad19b8513b73
Merge-request: 68
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-20 18:20:12 +02:00
João Abecasis
5b6894de87 ret is an "internal" path, no need to re-process it
Where "internal" means that it uses Qt's separator '/', regardless of
the native one.
(cherry picked from commit d4aa1777389f41da60a862a8c371d13839938d43)

Change-Id: Ic23ba0b360020b2e910b1256b38522db5c57f49b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 16:53:03 +02:00
João Abecasis
68a9e55f5a We prefer capitalized drive letters, make it so sooner
Reviewed-by: Prasanth Ullattil
(cherry picked from commit 13899108ed57548d3c4f40e595481f8ee76e4fcf)

Change-Id: I70132c19af34715c92718f9b06e4f2dfba28d255
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 16:52:53 +02:00
João Abecasis
b0a6caf84b Avoid spurious detaching in QDir::to/fromNativeSeparators
The new code avoids non-const detaching operations until needed and uses
a pointer into the "raw" QChar data from then on, thus skipping unneeded
checks on the reference count for further detaching.

These functions are used all the time by the file system classes so this
small optimization won't hurt. In particular, it will help users who
already use '/' when passing paths into Qt.

Reviewed-by: Peter Hartmann
(cherry picked from commit 773a6df46243831dee7559f90e33d7eff3c5c71e)

Change-Id: I27787e787b544a63c9ea1e4138bd548500104dff
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 16:52:38 +02:00
Kent Hansen
ce5adc7684 Revert "Update V8"
This reverts commit 1c4a5fcab76d1b769a4c0369d40dd0dd7c0e7495

Several of the qtdeclarative tests and examples are dying randomly with messages like this:
> 
> #
> # Fatal error in ../3rdparty/v8/src/objects-inl.h, line 2169
> # CHECK(object->IsJSFunction()) failed
> #
> 
> 
> ==== Stack trace ============================================
> 
> 
> ==== Details ================================================
> 
> ==== Key         ============================================
> 
> =====================
> 
> Aborted (core dumped)

Change-Id: Iebaa2497a6f6ef616ef4c3576c217d2a8a2c1ea5
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-20 13:30:26 +02:00
Frederik Gladhorn
3885a45e48 Make foreground and backgroundColor proper functions.
Change-Id: I93d4355a6c0b6edb1902df6399df7884b25ea744
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-20 11:40:29 +02:00
Thiago Macieira
c7f8213bc5 Move the non-atomic and implicit functions from QBasicAtomicXXX
Now, users of QBasicAtomicInt and QBasicAtomicPointer must be sure to
use .load() and .store() to access the values.

Change-Id: I6b48ed175618baf387dd38d821bd50e6e93c082e
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-20 10:05:49 +02:00
Jędrzej Nowacki
e4b145d11c Remove unused variable from qdbusintegrator.cpp.
The variable was set but unused.

Change-Id: Ibce123916f56ec90662f6118a696dfb2f4962169
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-20 10:05:01 +02:00
João Abecasis
1ef167f050 Use fromLocal8Bit for reversing toLocal8Bit
path is converted to 8-bit encoding using toLocal8Bit in
QTemporaryFileEngine::open. The reverse operation should be used here.
(cherry picked from commit 023976f9dd48a3deb947905d32d5fc0692da7318)

Change-Id: Idb4c1ca3415300367c46a09d68df640e17b7bfdc
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 07:22:57 +02:00
João Abecasis
d2b16043ef Don't convert template's path separators again
(cherry picked from commit 19880c1bdf75455b645fb8d5ee12bcb6e37e5aff)

Change-Id: Iec201da5c09d76711d994bc1da6d15a70a66b0c8
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 07:22:44 +02:00
João Abecasis
88316bf283 Changed if/if/else/if/eleven chain to switch
Inlined isdigit in switch statement. Removed unused #includes.
Documented unreachable segment with code (Q_ASSERT).

Reviewed-by: Denis Dzyubenko
(cherry picked from commit 3596db6c9bb8db42476d0c7b52fa2043dc67135b)

Change-Id: I98c33801fd8794e95ba8fc0b5c4efe9b1910682b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 05:49:33 +02:00
João Abecasis
74276637d9 Modulus of negative dividends is undefined or negative
... depending on who you ask. Since it is possible for applicationPid to
return negative values this means we would introduce garbage ['()*+,-./]
in the generated filenames.

Reviewed-by: Denis Dzyubenko
(cherry picked from commit cb7cb1d3884ae8a032f3ad2ed3a6d8e3ffc06206)

Change-Id: Ie4f74b961397f97508ea67a0c835e45773d1cc0e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-20 04:23:33 +02:00
Jan-Arve Saether
df1c1d28de Mark the most important MSAA functions as "moz: [important]"
See comment inside commit for explanation.

Change-Id: Ifc05d479ac5094f21f8db0390ae21d99eef0dbe1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-10-20 02:32:41 +02:00
Morten Sorvig
cff475f339 Move a11y inspector from tools to util.
Change-Id: Ifc032c511aea72a8f7a4ec62d304e89718f712db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-20 02:31:45 +02:00
Liang Qi
b1b843dcf5 Update keyToValue and keysToValue in QMetaEnum
Add a ok return value for whether found or not.

Task-number: QTBUG-21672
Reviewed-by: Olivier Goffart
Change-Id: Ic0ea7455dccf1ac91705bcc1479444eb4091ded3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Liang Qi <liang.qi@nokia.com>
2011-10-19 22:27:09 +02:00
Kevin Simons
15fee6e744 Fixed missing return statement in QPrintSupport
Change-Id: I8da63b7d4c5a456b0150b14e089d8f5e69c6a70a
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-19 22:27:09 +02:00
Friedemann Kleint
40738b185d Windows: Fix Geometry, OpenGL formats
- Do not use size returned by GetWindowRect for child windows
- Turn Open GL samples off if number is 1.

Change-Id: I2f44606d965fe691548094771deda7bca51ef9a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-19 22:27:09 +02:00
Aaron Kennedy
7dc5973bf1 Update V8
Change-Id: I7a9da7dbb2116a441788407d60ed10155cded941
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-19 20:48:25 +02:00
Frederik Gladhorn
4dc25c1f29 Refactor QAccessibleActionInterface.
Some refinements done by Jan-Arve Sæther.

Change-Id: I99195b3c7273316cfa9c46e451924bbcfddd11a9
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-19 19:25:42 +02:00
Jędrzej Nowacki
663cd17718 Introduce Q_STATIC_ASSERT
Example of message of failed assert (gcc 4.6, file tst_qglobal.cpp:300):
tst_qglobal.cpp:300:92: error: invalid application of ‘sizeof’
to incomplete type ‘QStaticAssertFailure<false>’

Change-Id: Ic1798094f718eaad388d754034115aafbbb6bd5e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-19 19:25:37 +02:00
Friedemann Kleint
0b6d4a2d65 Metatype: Silence MSVC warnings about unused variables.
Turn around if's.

Change-Id: Ica6f7f54098a567816ce3918f6fe5d8d2c072e01
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-19 16:06:36 +02:00
Friedemann Kleint
6c4aa14ecc Widgets: Fix a startup crash in QSplashScreen (Linguist).
Change-Id: I38f5920fb62277f97e9b3b45651527c2475556ac
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-19 12:24:49 +02:00
Morten Sorvig
19c322b089 Fix "may be used uninitialized" compiler warning.
Change-Id: I96e9dbf0f3df527785e03661b9c25bd2d214cd44
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-19 12:02:22 +02:00
Kent Hansen
9e92ecde74 Provide API for "placement new" construction of meta-types
By making it possible to specify the place in memory where a
type should be constructed, any meta-type can be allocated on
the stack, for example. In the QML/JS QObject binding, this
makes it possible to call slots and access properties from
JavaScript without having to perform any mallocs (e.g. due to
QVariant creation) in the C++ <--> JS value conversion, in
the best case.

In addition to QMetaType::construct() and QMetaType::destruct(),
this change introduces QMetaType::typeSize(), which returns the
size of a type in bytes. This can be used to prepare a suitable
buffer for constructing a type using construct().

Benchmarks indicate that in-place construction is 2-5x faster
than normal construction for core and GUI types on linux-g++.

Note that there is already a QMetaType::construct() function
in Qt 4, which has been renamed to QMetaType::create() in Qt 5.
In order to avoid existing usages of construct() in user code
to call the Qt 5 construct() (when they really meant to call
create()), the third argument ("copy") of construct() is made
mandatory. Hence, calls to QMetaType::construct() written for
Qt 4 will cause a compile error when compiled with Qt 5, and
the user must adapt his code.

Task-number: QTBUG-12574
Change-Id: I836f06f6ee1c1c3edbd199a03424c78c942bdd3e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-19 10:25:28 +02:00
Friedemann Kleint
ae30d71413 Widgets: Remove Symbian-specific code.
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>

Change-Id: Ieee43d6650f5b1968fc7d77e618096701ffef941
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-19 08:52:05 +02:00
Laszlo Agocs
3c2aea92cf Destroy generic plugins on exit.
Change-Id: I9037cabae74f9a7d8743630d0f530aaa1593266f
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-10-19 08:52:05 +02:00
Jason McDonald
8f02339e76 Remove DEPENDS_ON from qtestlib API.
The DEPENDS_ON macro didn't do anything and has misled many users to
think that they can write test functions that depend on other test
functions.

Task-number: QTBUG-21851
Change-Id: Ibe65b2d5d88bb81b6a0ebbe0b220f7d409a1446c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:24:13 +02:00
Jason McDonald
ae1810658b Move QTRY_VERIFY/QTRY_COMPARE into testlib.
These functions have lived in tests/shared/util.h for a long time, but
they really belong in qtestlib.

Change-Id: I60d569d002dea220b51563931d8b7aa77a20b98b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:23:44 +02:00
Jason McDonald
757b0529c4 Remove QTEST_NOOP_MAIN from qtestlib API.
This macro is no longer used in Qt's tests and encourages writing tests
in a way that makes test reporting less accurate -- remove it to prevent
further misuse.  If a test can be determined at compile-time to be
inapplicable, it should be omitted from the build via .pro file logic.
If that is not possible (e.g. there is no suitable qmake variable), the
test's initTestCase() function should call QSKIP to skip the entire test
with a meaningful explanation.

Task-number: QTBUG-21851
Change-Id: Icacc8c5567a700191b6ef3fa94ee52ede94c5b34
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 05:56:55 +02:00
alex
cd7623c19f Remove Sensors and Location related macros/defines from qglobal.h.
This reduces interdependencies between QtCore and other modules.
Individual modules handle this by themselves.

Change-Id: I82cb96326b8ccb0b6acb88d899ed811f80f47ec1
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 04:31:08 +02:00
Morten Sorvig
946805f07f Cocoa: Add initial accessibility implementation.
See qcocoaaccessiblity.h for details.

For now only the first level of the hierarchy is
made accessible.

Also add tools/accessibilityinspector which is an
utility for inspecting and debugging the Qt
accessibility tree.

Change-Id: Iff520bec26b3761feb0c2e00471feb379daaa735
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-19 03:04:40 +02:00
Friedemann Kleint
b419e567c0 Windows platform: Improve Open GL.
- Pass on version to ARB.
- Query obtained ARB format more fine-grained depending on version,
  indicate failures
- Fix GDI contexts and introduce gl=gdi to activate the GDI
  functionality
- Adapt window flags after setParent if top level state changes
- Remove unused OpenGL flag from integration/context

Change-Id: I59ca74ee1fa727bd2bcfd605b3907bc82cca18fa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-18 15:47:49 +02:00
Friedemann Kleint
08e2485860 QSurfaceFormat: Use version in comparison and debug, fix setter.
Change-Id: Id123ca9366b97a172e08a4608ccdffafb7caaf09
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-18 15:47:49 +02:00
Lars Knoll
36eb5fb732 Make some more methods private
Change-Id: I0644ee287201866596dccd96e443e7e62fd89360
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-18 14:15:54 +02:00
Konstantin Ritt
74110936f0 make fromWCharArray() and toWCharArray() inlined
because we may have the size of wchar_t varying,
we need to know which is the correct encoding: UTF-16 or UCS-4

Merge-request: 49
Change-Id: Ib5a1e7dea51d0cd8394e686634a36aae984fa072
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-10-18 14:15:50 +02:00
Lars Knoll
044770f9b0 Move QShortcutMap to QtGui
QShortcut stays in QtWidgets, what we need in QtGui
is only the basic functionality of the shortcut map.
QML can integrate directly with the map where required.

Change-Id: Ie39e9242f24cbebf824e5c3d2926880325ea4187
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-18 14:15:39 +02:00
Lars Knoll
5d4756fc1b Move the widget dependent code away from the shortcutmap
qshortcut.cpp now has the honour of hosting the code that
detects whether the a given shortcutcontext is actually
valid.

Change-Id: I59d299bbd2fd62fca074a51d96e85b81a50ae73c
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-18 14:15:35 +02:00
Laszlo Agocs
12e471b7fd Do not call swapBuffers when surfaceHandle is NULL.
Calling swapBuffers with the surfaceHandle of 0 returned by QWindow
during application exit causes a crash when using GLX. The patch
avoids swapBuffer calls to platformGLContext when there is no surface
handle anymore.

Change-Id: I09c5bbafd4e7af6648ca54a58ed0267d0a2f343d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-18 14:09:16 +02:00
Casper van Donderen
0e341948ae Remove stale documentation.
Change-Id: I85139e0334b648bee0d18129cef9387dcc6c3222
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2011-10-18 10:26:39 +02:00
Friedemann Kleint
41b01096cc Remove Q_WS_ in text codecs.
Change-Id: Id27d82f91a21107f31f73d7f2920629a512dc2a1
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-10-18 08:21:33 +02:00
Friedemann Kleint
da68749fdb OpenGL: Remove Q_WS_ defines.
Change-Id: I351a910968ff7f46550af5b3742959cb0cab540d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-18 08:21:19 +02:00
Jocelyn Turcotte
4ab691ad65 Fix TouchEnd events not being received on Harmattan.
TouchEnd is sent when all the touch points have a TouchPointReleased state,
and we would clear all touch points on finger release before sending them
up the stack.

Change-Id: I14e7347090ce9a1865743202f6926ae2fc035bd3
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2011-10-17 18:03:13 +02:00
Jocelyn Turcotte
4521e2ec61 Add multipoint touch support for Harmattan to the xcb platform plugin.
Proper multipoint touch support was only introduced in XInput2.1, but Harmattan uses
a tweaked version of XInput2.0 that transfers touch data through mouse events.

This patch applies on the xcb plugin a subset of the changes that were applied on the
Qt 4.7 that was shipped to Harmattan to get similar multipoint touch support.

Change-Id: Ifda7ad40de29d7ded1443d4f78b3ec3807303a9f
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2011-10-17 18:03:13 +02:00
Jocelyn Turcotte
09cad13e49 Fix TouchPoint::lastPos() after TouchPointStationary only events.
lastPos is copied from the last point's position, and the position has
to be resolved according the the receiving item's transformation.

However, if a QTouchEvent contains only stationary points, it won't be
delivered, it's pos()/rect() will still be uninitialized, and the
touch point of the next event will be delivered with the uninitialized
pos() as it's lastPos().

This patch makes sure that the lastPos() won't be filled with a
previous incomplete stationary point state even if the platform is
sending us stationary-point-only touch events.

Change-Id: Ia7d10423c8fbe78348edbb0a89fbfa66d1b8b5d1
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2011-10-17 18:03:13 +02:00
Simon Hausmann
fa607d6272 Fix scaled text rendering with the raster paint engine & FreeType
Before commit 070d9c00c4, the raster paint engine used
to call loadGlyphs() on the FT engine, which ensures that the glyphs are loaded
and (more importantly) that the correct transformation matrix is applied on the
freetype face. After commit 070d9c0 lockedAlphaMapForGlyph is called for each glyph,
which unfortunately doesn't respect the provided transformation matrix. Therefore
when drawing scaled text, it was never actually scaled.

This patch applies the combination of the fontengine transform and the requested
transform on the freetype face actually used, similarly to loadGlyphs.

Change-Id: I0956a9e71784582db6bb90475a001a63800773f4
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-10-17 16:04:33 +02:00
Casper van Donderen
c3b7a0291d Use a QFunctionPointer for getProcAddress()
qdoc does not understand the void (*) syntax, there is a typedef to
QFunctionPointer that does work.

Change-Id: Idbe9d43d00f8676304d088d72795b6ddb7e4ee72
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-17 13:31:45 +02:00
Friedemann Kleint
bf96c83b15 Replace Q_WS_WIN by Q_OS_WIN in uic/network.
Change-Id: I592936859f6932fcd1aa47f0617ba9f8efee86dc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-17 13:31:45 +02:00
Laszlo Agocs
5d8d7b1dbc Add a warning and a return value to xcb's createGLPlatformContext
There was no value returned previously when none of GLX, EGL, DRI was
enabled. Now we show a warning message and return null (resulting in a
crash). Previously not returning a value resulted in obscure crashes
with strange-looking call stacks, now it will be clear what the
problem is.

This is particularly important because not having libx11-xcb-dev
installed results in silently disabled xlib support which in turn
disallows the usage of glx too. The result is an obscure crash in any
GL (e.g. QML2) app. Now there will be a proper warning message at
least.

Change-Id: I15cf3a6c16ca373d4ada7abb6d3c8f7e30c1e03d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-17 10:29:57 +02:00
Laszlo Agocs
86ea95259d Do not fail user time window creation when xcb is using xlib
QXcbWindow::updateNetWmUserTime() creates a new window using the
actual window as its parent. This operation was failing when Xlib
usage and GLX (or EGL) was enabled because in these cases the real
window was created with a different visual using XCreateWindow.

For the user time window however we were passing the xcb_screen's
root_visual always, and this cannot work when Xlib+GLX/EGL is in use,
resulting in a BAD_MATCH (followed by some annoying flicker on the
screen on Ubuntu at least, or a full log off (X crash?) on Fedora).

The patch saves the visual id used to create the actual window and
passes that when creating the user time window. This way the creation
of the user time window succeeds with Xlib+GLX too.

Change-Id: If3925d9ac1670d385dcc7c2b475c196908569f06
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-17 10:28:25 +02:00
Lars Knoll
5ad123c136 Less friends is good, at least for C++ code :)
Change-Id: Ia46359ee80eb30b8e16a02b7d5376cc9610fac84
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-17 01:57:26 +02:00
Martin Petersson
e07d7ab265 QHttpNetworkConnection: fix compile warning
Change-Id: I05f114dcb1c43a98c416d02b3e764dcb40d56e09
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-14 23:40:08 +02:00
Eskil Abrahamsen Blomfeldt
23e5594735 Add QGlyphRun::SplitLigature flag
If the glyph run is generated based on characters which split a
ligature glyph, it needs to include the ligature glyph in the run,
and when painting, we need to clip the painter to the reported
bounding rect of the run in order to avoid painting too much of
the ligature. To make it possible to reduce clipping to a
minimum, we need a flag to inform of whether the glyph run contains
a split ligature or not.

Change-Id: Id787e0bec6d6e8e06cc818700ae0fca22cf81e98
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2011-10-14 23:39:46 +02:00
Harald Fernengel
b2a45e02a2 Disable ELF interpreter check when cross-compiling
It's not a good idea to look at the host's /bin/ls when cross-compiling

Change-Id: I1fe67b17abd92f01c1d89146227c5419eaa3242f
Reviewed-by: Arvid Picciani <arvid.picciani@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-10-14 21:21:28 +02:00
Laszlo Agocs
b091ec9a22 Avoid using 0 as the default winId in QPlatformWindow.
When the platform plugin does not reimplement QPlatformWindow::winId()
to return a non-zero value, the default implementation provides a WId
of 0. This breaks various scenarios with QWidgets which, for example
in nativeParentWidget(), rely on internalWinId() being non-zero for
TLWs.

As a result, apps like collidingmice will crash with the 'minimal'
platform plugin when they try to do markDirtyOnScreen for the graphics
view's viewport widget because viewport()->nativeParentWidget()
unexpectedly returns null, even though it should return the
QGraphicsView.

The patch makes the default value WId(1) in order to to avoid this.

Change-Id: Iafef2e510e32b5610b8cef742313e9119ed64963
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-14 19:42:26 +02:00
Laszlo Agocs
be1e6d17b9 Make the window active in eglfs and minimal plaform plugins.
Without a call to QWindowSystemInterface::handleWindowActivated() or
QPlatformWindow::requestWindowActivated() QGuiApplication's
activeWindow() and focusWindow() will return 0 all the time, and this
breaks key event delivery when key events are received not from a
windowing system but directly from e.g. evdev. In such cases the only
choice is to send the event to the active window but if there isn't
one the event will be lost.

These platforms will have one fullscreen window at a time so marking
it the active one should be a safe assumption.

Change-Id: Ia6f0e9f021fbd61bbd368ddc46f8a13fccda1c2f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-14 19:42:17 +02:00
Lars Knoll
cfb2f5fdd1 Remove commented out reference to QShortcutMap
Change-Id: I62ca413c4f5e11e5ba91dcbb05d8088ca1d7a2b9
Reviewed-on: http://codereview.qt-project.org/6582
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-14 16:22:00 +02:00
Lars Knoll
046740f5ce Remove dependencies of QShortcutMap onto widgets
This is the first towards bringing shortcut support
back into QtGui.

Change-Id: Ic2cf376d08c326402fb90a0cf170a987b07ac304
Reviewed-on: http://codereview.qt-project.org/6577
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-14 13:13:01 +02:00
Frederik Gladhorn
736b3a6aca Accessibility plugin for mac and xcb.
Instead of creating new instances of the class whenever
accessibility() is called, create one on startup.

Change-Id: Idd5b06ee935d7acf4934b98882d254a1ef0ca04e
Reviewed-on: http://codereview.qt-project.org/6435
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2011-10-14 11:41:16 +02:00
Jocelyn Turcotte
bb22b49650 Fix OpenGL on Harmattan showing only the first frame.
swapBuffers would wait until DRI2_InvalidateBuffers was received from the
X server, but would never receive it since we are not running the xlib event loop.

This patch calls the XESetWireToEvent xlib callback of an unhandled event from the
xcb event loop directly, if one is available for its response type.

Change-Id: I3b4ef3f6e3efbae25f49f161e229e9b15e951778
Reviewed-on: http://codereview.qt-project.org/6557
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-14 00:25:20 +02:00
Laszlo Agocs
472028c1d4 Calculate an area in the touchscreen qpa plugin.
Instead of ignoring the touch major/minor and returning a rectangle
with width and height of 1, the size of the area is now calculated
based on the major. This is incomplete and far from perfect but at
least it makes visualizers, like the fingerpaint example app, work out
of the box.

Change-Id: I3bb70b4d7247f289e5cae4e7de2460ecf2c9d009
Reviewed-on: http://codereview.qt-project.org/6566
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-10-13 17:36:01 +02:00
Friedemann Kleint
1582407fc7 Remove Q_WS_ and Q_OS_SYMBIAN from QtGui.
Change-Id: I2ac3376513c3fbfc81a2e695a73a0d948d2696bc
Reviewed-on: http://codereview.qt-project.org/6607
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-10-13 15:07:41 +02:00
Friedemann Kleint
30cb91e17d Fix struct/class mismatch.
Change-Id: I282c9d9e10b0783cc10d32de031a30d07b802a55
Reviewed-on: http://codereview.qt-project.org/6610
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-13 14:49:08 +02:00
Morten Sorvig
8346c192ad Cocoa: Update QPlatformWindow geometry on move
Change-Id: I976e4da646480d10cc6af444288c421d0645f689
Reviewed-on: http://codereview.qt-project.org/6541
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-10-13 12:57:22 +02:00
Laszlo Agocs
75246bbda7 Migrate the touchscreen generic qpa plugin to QWindow.
This plugin was still using QApplication and QDesktopWidget. The code
is now migrated to QGuiApplication, QWindow, and QScreen.

Change-Id: I22a7e15982efea16cbf560d09c8831cd82ed29d0
Reviewed-on: http://codereview.qt-project.org/6528
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2011-10-13 08:05:48 +02:00
Martin Petersson
2b58e3db35 QNetworkAccessManager: hostInfo lookup should use proxy if set
startHostInfoLookup will try to detect if IPv4 or IPv6 will be used
when connecting to the host. If a proxy is set we should lookup
the proxy hostname instead, in case host name can't be resolved
via DNS and should be resolved by the proxy.

Task-number: QTBUG-21889
Change-Id: I2012798784fc40f153469a1298e261c52981297e
Reviewed-on: http://codereview.qt-project.org/6447
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2011-10-12 18:01:19 +02:00
Shane Kearns
82d897febf Fix construction races in QtNetwork
When two threads construct a QNetworkAccessManager at exactly the
same time on an SMP system, there are construction races for some
Q_GLOBAL_STATIC data. This is normal and expected - the losing
thread deletes its instance as part of the Q_GLOBAL_STATIC macro.

For QNetworkAccessBackendFactoryData, a guard mechanism intended
to prevent the data being reconstructed by destructors of other
global static classes was being set by the loser.
To fix this, the bool is changed to a QAtomicInt. In the normal
case, it will have value 0->1 on startup and 1->0 on shutdown.
In the race case, it will have values 0->1->2->1 on startup and
1->0 on shutdown.

Task-Number: QTBUG-20343

Change-Id: Ie3fe38944d10809d1ccdbe772df82d67faffe19c
Reviewed-on: http://codereview.qt-project.org/6181
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-10-11 19:16:10 +02:00
Friedemann Kleint
32ec981745 Windows: Adapt to new Lighthouse API
- Implement debug/deprecated options of QSurfaceFormat
- Implement stylehints
- Fixed input context to position the input window correctly.

Change-Id: Icba22f183c6895e30bd34d60cf6d2307ed3188cd
Reviewed-on: http://codereview.qt-project.org/6446
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-10-11 17:38:34 +02:00
Joona Petrell
e941b37fcc Move input panel visibility ownership from QInputPanel to QPlatformInputContext
Now QInputPanel::visible() can be set true even when platform doesn't provide
a virtual keyboard. Like keyboard geometry, visibility should be dictated by
the platform plugin and not QInputPanel, whose role is more like that of a mediator.
QInputPanel::show() and ::hide() calls should be treated as requests that may fail.
Changed the QInputPanel's visible property to read-only as a setter that may
fail is not really a setter, show() and hide() should be used instead.

Enabling the new functionality cannot be activated immediatelly without breaking
existing keyboards, added a temporary function handlesInputPanelVisibility that
handovers the responsiblity of updating input panel visibility to QInputContextPlatform
only once QInputContextPlatform says that it is able to handle it.

Change-Id: Ideecaf7225cc3971f33a0ac976bd92cf7767475b
Reviewed-on: http://codereview.qt-project.org/6429
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:03:25 +02:00
Casper van Donderen
0e6a401028 Remove stale documentation and fix qdoc errors.
Change-Id: I51bb0c52eb32d9d672d115f31b16d414f81708e2
Reviewed-on: http://codereview.qt-project.org/6433
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-10-11 16:03:12 +02:00
Pekka Vuorela
bd34df230d QTextEdit - Fix selectionChange emission bug
QTextEdit did not emit selectionChange signal if selection
availability did not change, but the start or end of the selection did.
This was causing unit test to fail.

Change-Id: Iea0cb0bae767bc8d2dd36141362f9a084af97266
Reviewed-on: http://codereview.qt-project.org/6426
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:03:01 +02:00
Pekka Vuorela
76ca6642a9 Removed obsolete custom input context support
Removed from QWidgetPrivate and QWidgetTextControl. Now using only
application specific input context.

Change-Id: Id25882e72026f58dab51a18e5d04a11225429963
Reviewed-on: http://codereview.qt-project.org/6427
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:01:57 +02:00
Kent Hansen
e5ce564b1d Rename QMetaType::construct() to create()
create() is symmetric with destroy().

Also rename the internal methods and fields to be
consistent (qDeleteHelper already had the "right"
name, though!).

This change will allow us to use construct() and
destruct() for something else: Placement new-style
allocation (QTBUG-12574).

The old construct() is still kept for now, until
the other repositories have been updated to use
create().

Change-Id: Iceb184af6cffcb0a634359cfc3516c718ba0c2f5
Reviewed-on: http://codereview.qt-project.org/6342
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:01:45 +02:00
Jiang Jiang
612ac2b8c8 Don't crash when no usable font is available
We will fallback to box engine when no usable font is available,
and QRawFont (which scenegraph depends on) won't allocate glyph
index array on certain occasions. In those cases, QFontEngineBox
needs to support GlyphIndicesOnly flag.

Change-Id: I408ddd1b2f1a5f7ac2b6681cb7bf531bbbfc68e6
Reviewed-on: http://codereview.qt-project.org/6360
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-10-11 16:01:12 +02:00
Kim Motoyoshi Kalland
93c8522dc3 Import symbol from QtGui rather than export from QtWidgets.
The symbol is exported in qguivariant.cpp.

Change-Id: I3ba3446251aa3ba9e901bd3e9c2157d8b22d9866
Reviewed-on: http://codereview.qt-project.org/6364
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-11 16:00:45 +02:00
Kent Hansen
7a4eec5dbb Fix typo in qfontengine_win
Task-number: QTBUG-20482

Change-Id: I3fd072af019a0e531d60a1751a6a32ea5962aac1
Reviewed-on: http://codereview.qt-project.org/6049
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-11 16:00:17 +02:00
Lorn Potter
0cb7a66989 add qmetaobjectbuilder to qtbase.
Use the QMetaObjectBuilder code from declarative and add it to libQtCore.

    Consolidating various QMetaObjectBuilder implimentations to avoid
    code duplications in those modules.

    This is currently still a private API only.

Change-Id: Ie363b4fd769c41efbb3caa7fb1d6f77af13c3c9c
Reviewed-on: http://codereview.qt-project.org/6287
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
2011-10-11 07:02:14 +02:00
Aaron Kennedy
27833629c6 Update V8
Change-Id: I359ec3f57a120ebd02d03c56d0944397b5407ed8
Reviewed-on: http://codereview.qt-project.org/6386
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Sanity-Review: Aaron Kennedy <aaron.kennedy@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-10-11 07:02:14 +02:00
Kent Hansen
ccbb3afe28 Remove duplicate check in qtextcontrol cursorMoveKeyEvent()
No reason to check for QKeySequence::MoveToPreviousLine twice.

Task-number: QTBUG-20482
Change-Id: Ib1504be33908fa7cbc27226060f94794c454681c
Reviewed-on: http://codereview.qt-project.org/6050
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2011-10-11 00:42:17 +02:00
Friedemann Kleint
d5bf2f3314 QtBase: Move idc to Active Qt.
Remove include path to Active Qt from qt.prf.

Change-Id: I476152ce56e47b573f5c835ec1347e772c4e9c3e
Reviewed-on: http://codereview.qt-project.org/6355
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
2011-10-10 16:54:52 +02:00
Bradley T. Hughes
78470cd621 Make all uses of QBasicAtomicInt and Pointer use load() and store()
Change Ie3271abd1728af599f9ab17c6f4868e475f17bb6 didn't build on Mac in
debug mode. This commit fixes the build.

Change-Id: I925af83ea577228b60679af804aa7875a779ec3f
Reviewed-on: http://codereview.qt-project.org/6331
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-10 16:54:52 +02:00
Samuel Rødal
ac03f59ccc Removed src/gui/opengl/qopenglcolormap.*
The QGLColormap API was used by QGLWidget, not very relevant in the Qt 5
core API.

Change-Id: I3c75ac09cbc292e707aea62759c09277f834de8d
Reviewed-on: http://codereview.qt-project.org/6333
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-10-10 16:54:52 +02:00