Commit Graph

17193 Commits

Author SHA1 Message Date
Thiago Macieira
ab1ec81f58 Optimize qt_memfill32 a little
Benchmarking shows it took up to 3.5% of Qt Creator's initialization
cost. Optimize by modifying only one variable per loop: instead of
updating n and dst128, we only update one variable at a time.

Removing the Duff's Device also improves the code, since the compiler
won't try to update dst128 four times per loop, only once.

The moving of the epilogue close to the prologue was just to make the
code a little cleaner.

Change-Id: I5b74e27d520ca821f380aef0533c244805f003b7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-12 20:12:17 +01:00
Thiago Macieira
af8c35bda4 Deprecate {QCoreApp,QAbstractEventDispatcher}::hasPendingEvents()
This function has a flawed design. It was flawed when it was added in
Qt 3.0.

A "false" return value is racy: any other thread running may post events
to the current thread, thus making the result stale. That includes Qt
starts for its own purposes when it comes to the main thread, like the
Scene Graph thread, the QProcessManager thread, the Windows
QAdoptedThread watcher thread, the Windows pipe writer thread, etc.

A "true" return is stable only if the selected thread is stopped, which
includes selecting the current thread (the case of QCoreApplication).
For that reason, this method should not be public, but a protected one
so that a public static could call it. But even that would not solve the
race condition from the previous paragraph (hence why
QCoreApplication::hasPendingEvents being deprecated too).

And, to top all of that off, all but one of the implementations access
the GUI thread's event loop counter in a non-thread-safe manner. I've
changed the documentation to restrict to the only currently-working use-
application.

[ChangeLog][QtCore][Event loop] QCoreApplication::hasPendingEvents and
QAbstractEventDispatcher::hasPendingEvents are now deprecated. Please
refer to the documentation for more information.

Task-number: QTBUG-36611
Change-Id: Iac61f307e9672839944ae2f75abb1aea30c419f6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-12 20:12:17 +01:00
Andy Shaw
1bf9f725d1 Respect the DontUseNativeDialog option for QColorDialog
By reimplementing canBeNativeDialog() we ensure it is only shown
natively if the circumstances are correct. The change was modelled on
how QFileDialog implements the same checks.

Change-Id: If58e33d6d0547e95975d7c0453901fa592eb96a0
[ChangeLog][QtWidgets][QColorDialog] Ensured
QColorDialog::DontUseNativeDialog is respected when showing the dialog.
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-12 20:12:17 +01:00
David Faure
f42bd772f8 Move setWindowIcon() up to QGuiApplication.
[ChangeLog][QtGui][QWindow]QWindow::icon() now defaults to the application
icon, which can be set with QGuiApplication::setWindowIcon().

Change-Id: Id1974e5cda81775e515c14b294f67fb99351c6c9
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-12 20:12:17 +01:00
David Faure
bf82245baf Restore support for -title command line argument on X11, add -qwindowtitle.
-title disappeared between Qt4 and Qt5, due to all the refactorings around QPA.
Making the caption of the mainwindow configurable allows custom setups
for specific users or use cases.

[ChangeLog][QtGui][QGuiApplication] Restore support for -title command line
argument on X11, add -qwindowtitle on all platforms.

Change-Id: I73e6bf21248f3419178eba583b257172a175e74e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-12 20:12:17 +01:00
Paul Olav Tvete
eacd58d4e7 Enabling QQuickWidget and QOpenGLWidget
Enable child widgets (without a native window) that render to an FBO
and are composed with the raster backingstore by the platform plugin.
A preliminary version of QOpenGLWidget is included as private API.

Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-12 20:12:17 +01:00
Friedemann Kleint
5ae5bebb93 Added function returning build information to QLibraryInfo.
Useful for bug reports and test logs.

[ChangeLog][QtCore] QLibraryInfo provides information on how
Qt was built.

Change-Id: I867197fd7d2e10bcdf01a8eb47c9c1e03647e2c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-12 17:24:33 +01:00
Friedemann Kleint
5adba7cba7 Check whether exposed widget is mapped in QWidgetBackingStore::sync(QWidget*).
Qt::WA_Mapped corresponds to 'exposed' in Qt 5, hence a parent window
fully obscured by its children may not have the attribute set.
In that case, go by the attribute of the child widget.

Task-number: QTBUG-33520

Change-Id: Ia08f283172daaa58f58e5636004461b2c48784f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-12 17:24:28 +01:00
Gabriel de Dietrich
4beafcd944 Cocoa: Bring back two-class native window system
While inheriting from NSPanel proved to be robust enough, it is
not really future proof as we're at the mercy of Apple changing
NSPanel's behavior. On the other hand, we can't inherit exclu-
sively from NSWindow as the tool window case, where the QWindow
should look like an NSPanel, can't be emulated perfectly without
using private APIs.

This reverts commits 79fb39a87c and df86721bb4.

Change-Id: I9021193e3614633a943578df9e2794b00094a1f7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-12 17:13:37 +01:00
Maurice Kalinowski
ff23fb6cf7 Implement native message box for WinRT
Added a basic theme class, which creates accessors for the
QPlatformMessageDialogHelper. This handles creation of the
native dialog, but also spawning an event loop around it.

There are some limitations shared with the Android implementation.
First you cannot create custom labelled buttons and also selecting
the default button is not possible. This will be added at a later
point.

Note that Windows Phone is not supported.

Change-Id: I2dec83dcded7919835a6dcdf8dc2a56282024a7e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-02-12 09:13:28 +01:00
Friedemann Kleint
db98d65415 Windows: Fix potential crash in font database when family name is empty.
Task-number: QTBUG-36651

Change-Id: Icd3edc7dbed3e692b32374b0ab6251e7f939589d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-11 20:59:15 +01:00
Friedemann Kleint
ae4243df1e Windows: Restore maximized/full screen widgets to correct screen.
Partially revert 54865d47cfd859a0e84ba8e1bbff3b56c93d4e0d and
bring back parts from abba37cd0eff959edf2d011842cbf2b36cce8467 which
failed some tests on other platforms and never made it in.

Avoid setting a geometry on maximized windows since that leaves
them in a broken state. Instead, if there is a need to restore
maximized windows to a different screen, clear the maximized flag
before applying the geometry.

[ChangeLog][QWidget][Windows] QWidget::restoreGeometry() now restores
maximized/full screen widgets to the correct screen.

Task-number: QTBUG-21371
Task-number: QTBUG-4397

Change-Id: Ibd5b736e921f20d4b7365c06c6f9c5dd4469c781
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-02-11 20:59:15 +01:00
Kai Koehne
c1bea0b532 Configure: Disable widgets module too if gui module is disabled
Use the same logic as in the Unix configure script, and disable
"widgets" if "gui" is disabled.

Change-Id: Ica338ad10b965eea297dddaaedeea61a3ae3ebe9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-11 20:59:15 +01:00
Kai Koehne
a2bfd11493 Allow configuration of logging rules from file system
Allow configuration of logging rules from outside of the application,
either through a configuration file (.config/QtProject/qtlogging.ini),
or through a file specified by a QT_LOGGING_CONF environment
variable.

The logging rules from the different sources are concatenated: First
the rules from QtProject/qtlogging.ini are applied, then
QLoggingCategory::setLoggingRules(), finally from the environment.
This allows an application to overwrite/augment the system wide rules,
and in turn that can be tailored for a specific run by setting a
configuration in the environment variable.

[ChangeLog][QtCore][Logging] The logging framework can now be configured
with an .ini file.

Change-Id: I442efde1b7e0a2ebe135c6f6e0a4b656483fe4b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-11 20:59:15 +01:00
Sérgio Martins
dc09a02e3a Fix warning with QT_NO_GRAPHICSVIEW
Change-Id: I96064f0db359fbf5c615e48633398b79872e0bc5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-02-11 20:59:15 +01:00
Sérgio Martins
63cf8ad33a Fix build with QT_NO_GRAPHICSVIEW
Change-Id: I81cfed124a2e9e1c46c966c4819e89df5abd4f74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-02-11 20:59:15 +01:00
Richard Moe Gustavsen
34dba9261e Widgets: update widget transform upon receiving QEvent::FocusIn
QWidgetPrivate::updateWidgetTransform will only update the
transform if the widget is the current focus object.
But if someone calls QApplication::setActiveWindow, Qt will
call QWindow::requestActivate and then send focus
in/out events, all in the same event loop recursion.

The problem now is that requestActivate is not guaranteed to be
synchronous (it's not on iOS). So the window activation
(together with updating the focus object) will still be pending
when the widget receives the focus-in event. As such, the
transform update will also fail.

This patch will give the event as input to the function, so
that we don't depend on window activation being synchronous.

This will fix IM spell checking popups on iOS to show at the
correct place, also after closing font popups etc.

Change-Id: If0ee70f55692bbd613821b126923364e39ed1199
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-11 20:59:15 +01:00
Andrew Knight
2a9944e281 WinRT qmake vcproj: Fix icon locator
This was broken for shadow builds. Adding the output directory to the
manifest file name fixes the problem.

Change-Id: I9e5b47a08f80f7afcfd76e13784fbaec912e50ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-11 18:53:10 +01:00
J-P Nurmi
062d2a1f80 Promote the scrollbar style animation to qstyleanimation_p.h
Makes it possible for QFusionStyle to utilize the same animation.

Change-Id: Ifac9eaa3138cf1068439d5b0271a2acce54a3c16
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-02-11 18:36:05 +01:00
Kai Koehne
e14885a18a Enable categorized logging for bootstrapped tools
Change-Id: Ie908a175bda103fd8d73031024a823a4c4d3dbb7
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-02-11 15:53:10 +01:00
Peter Hartmann
42cfb5fe4d SSL: add support for the Next Protocol Negotiation extension
... which is needed to negotiate the SPDY protocol.

[ChangeLog][QtNetwork][QSslConfiguration] Added support for the Next
Protocol Negotiation (NPN) TLS extension.

Task-number: QTBUG-33208

Change-Id: I3c945f9b7e2d2ffb0814bfdd3e87de1dae6c20ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-02-11 15:37:10 +01:00
Frederik Gladhorn
df62c31807 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-11 15:12:00 +01:00
Laszlo Agocs
17de86f282 kms: Adapt to initialize() pattern
Right now socket notifiers are attempted to be created before having
the event dispatcher up. This is wrong.

Change-Id: Ica3034b9fa790c037f28982db23c71342f6597d7
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2014-02-11 14:59:55 +01:00
Andrew Knight
b4fe9ce225 qmake: Provide feature for windeployqt
windeployqt is a tool that aids in the deployment of Qt libraries and
other files on Windows. This feature (CONFIG+=windeployqt) adds
automatic invocation of windeployqt for qmake projects as a post-link
action. For Visual Studio projects, windeployqt is added as a custom
target which runs after linking, automatically adding the output as
deployment items.

Task-number: QTBUG-35630

Change-Id: I4cdcb1a7f70cedccb4a4e17be5eb9f5de35a4d66
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-11 14:52:16 +01:00
Thiago Macieira
49df5fc3d2 Fix compilation when including files created in shadow dirs
For normal #includes, moc simply ignores the missing file, but it could
generate problems later. It's a problem when the file being sought is
the FILE from plugin metadata. A very good example of this is Qt
Creator:

coreplugin.h:49: Error: Plugin Metadata file "Core.json" does not exist.

Change-Id: I16af04b477f52c6bd53c14147ec777b358dfdf50
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-10 20:41:22 +01:00
Friedemann Kleint
97d8e3b200 Windows: Fix return value of WM_QUERYENDSESSION.
LRESULT should be non-zero if the application can quit,
and it is always handled.

Task-number: QTBUG-35986

Change-Id: Ic8b0ecc731d3efaf94e2a62491918d379fe59f5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-10 20:30:26 +01:00
Giorgos Tsiapaliokas
d61e774307 Print qCDebugs in arbitrary categories by default
The debug output of all categories will be visible by default,
except from the "qt.*" categories. "qt.*" categories are private
and their default debug output will be hidden.

[ChangeLog][QtCore][Logging] Enable qCDebug's for all categories except qt one's

Change-Id: Ibe147c8bbe0835a63b3de782288b9c3251321d8f
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-10 16:28:30 +01:00
Morten Johan Sørvig
3d08681169 Cocoa: Add setNSToolbar(QWindow *, NSToolBar *)
Calling this function associates the given native
toolbar with the QWindow. QWindow will then set
it on the native NSWindow at the appropriate time
during window creation.

Change-Id: I2a50f79b2a0453cc739f8d68e965e37b95998083
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-10 12:49:06 +01:00
Gabriel de Dietrich
df86721bb4 Cocoa: Neuter -[QNSView cancelOperation:] for normal windows
QNSWindow inherits QNSPanel regardless of the kind of QWindow. With
NSPanels, pressing escape is equivalent to dismissing the panel.
That is not the behavior we aim at for normal toplevel QWindows.

Task-number: QTBUG-36694
Change-Id: I1a1c138183cc43c968249442021f334cd37f7ce0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-10 12:49:06 +01:00
Allan Sandfeld Jensen
a7b8ef0841 Export optimized premultiply and unpremultiply methods
This patch optimizes the unpremultiply method further by using a
lookup table to avoid any divisions at all.

The opportunity is taken to export both premultiply and unpremultiply
since they are commonly used methods relevant to the exported QRgb type
that can be both premultiplied and unpremultipled ARGB.

[ChangeLog][QtGui][QColor] Exported highly optimized methods for
premultiply and unpremultiply of QRgb values.

Change-Id: I658bcf57b0bc73c34c1765b64617d43b63ae820b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-10 12:49:06 +01:00
Andrew Knight
143d591aab WinRT: Fix use of std::thread in QThread
Don't delete the thread object without detaching it, use detach()
instead of CloseHandle(), and avoid a double-delete.

Change-Id: Ia169a96fb32805e06abe099c3c35e97ce485f088
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-02-10 12:49:06 +01:00
Jorgen Lind
a80253ae4c QOpenGLTextureBlitter
private api, but useful for 2d gui code that suddenly finds itself
needing to get a set of textures onto some fbo

I didn't want to include ARB_copy_image since it looks like its from
texture/renderbuffer -> texture/renderbuffer while this class implies
texture -> write fbo. We could wrap ARB_copy_image in QOpenGLTexture or
some other class or we can add it later.

I have not added any QOpenGLTexture functions since this class opperates
on the GLuint identifier. We can add overloads later.

Change-Id: I3e565b33466c1c183a249a33c3e82c6786debd55
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-02-10 12:49:06 +01:00
Raphael Kubo da Costa
a093204f07 EGL convenience: Guard Linux-specific code with Q_OS_LINUX.
Instead of "blacklisting" Unix platforms that don't have Linux headers,
do the opposite and check for Q_OS_LINUX in the framebuffer code that
has Linux-specific code.

This should help fix the build on other Unices, such as the BSDs.

Change-Id: Icb6edf34bb20c9a98843b6dc0e2a87ee71fcd046
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-10 10:47:57 +01:00
Thiago Macieira
f7308e007e Improve the code generation for the Latin1 codec
This change does not modify the actual algorithm implemented. It only
updates the source code so that the code generation is more optimal:
 - change only one variable per loop (the "offset" variable)
 - unroll the tail expansion of the last 15 characters

The Neon code for the toLatin1 codec most likely benefits from the
unrolling of the tail too, but I can't verify that I haven't broken
anything.

Change-Id: I8a92fd3c1aa700e6f8b0c8ebdb1978ade394757f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-02-10 08:36:23 +01:00
Martin Gräßlin
ab3637dd67 Do not set input focus if WM supports _NET_ACTIVE_WINDOW
In case the window manager supports _NET_ACTIVE_WINDOW a client message
is sent to the root window and the window manager is expected to either
activate the window or mark it with demands attention.

In addition the code unconditionally also called xcb_set_input_focus
which breaks the intention of sending the client message. Thus it is
now only done if the WM doesn't support the protocol. This was also the
logic in Qt 4.x in QWidget::activateWindow (qwidget_x11.cpp).

In addition set_input_focus is only called if the window is a toplevel.

Change-Id: Iec4c02f0ea62db30a4b347d474fdfd2f05b8895b
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-09 20:03:37 +01:00
Laszlo Agocs
54835e3ccf Make xcb compile with X-less EGL implementations
On platforms like the Raspberry Pi the EGL implementation is not
compatible with X. This means that while EGL and Open GL ES can be enabled,
and will work fine with platform plugins like eglfs, EGL (and thus GL) should
be automatically disabled in xcb, otherwise a compilation error will occur
since xcb assumes the native handle types are the corresponding Xlib types.

Task-number: QTBUG-36551
Change-Id: I2cc4c558abb4b25d422a2c01da9b75b865ace402
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-09 20:03:29 +01:00
Konstantin Ritt
535086e9e5 QFontEngineBox: Fix assertion for code points beyond BMP
...due to a typo introduced in d8225fab8f and stricter checks
introduced in 4e319ca4c4.
This uses recently added QStringIterator to decrease the code duplication.

Change-Id: Ib1c2519db1c4d65f3ac14e6f9ae3fa272860b1dd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-09 15:16:35 +01:00
Morten Johan Sørvig
daf4e1e140 Cocoa: Simplify native view access.
Use NSWindow and NSView accessors on QCocoaWindow
instead of QGuiApplication and nativeResourceForWindow.

Change-Id: Iabee1e42dd119726d932f89c66a90810463d70db
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-08 23:04:16 +01:00
Morten Johan Sørvig
c0241d982b Cocoa: Remove duplicate enum.
Change-Id: I8a3b700710a1c47a31ddeed59ef73f1032ee7d09
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-08 23:03:40 +01:00
Kai Koehne
5dae375c24 Fix checking of category for printf-style qCDebug
Fixes an issue introduced in b8a38a6737. We forgot
to check for category validness, and printed qCDebug(c, ""...)
unconditionally for compilers not supporting variadic
macros.

Change-Id: I779a97dacd7ea559f0d91473aad2c29e73ea2f89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-02-08 18:20:27 +01:00
Raphael Kubo da Costa
ba8e61a388 eglfs: Put Linux-specific includes within Q_OS_LINUX guards.
This should fix the build on platforms like the BSDs, where linux/fb.h does
not exist.

Change-Id: Ia06403d71c3aaa0e177c85dcefa7986647777ae0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-08 18:03:16 +01:00
Friedemann Kleint
99eecab83d Automatically link printsupport plugins to static applications.
Add the required printsupport plugins to the QTPLUGIN variable
as is done for the QPA plugin.

[ChangeLog][QtPrintSupport] Made the Qt buildsystem automatically include the
necessary plugins so that static applications can print.

Task-number: QTBUG-29663
Change-Id: I0e2e3b0f25dd5714bd187711c85893926b0c4e85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-08 13:34:37 +01:00
Friedemann Kleint
9e6bb60131 Windows: Post drag events for the window on which the drop site was registered.
Remove findDragOverWindow(); no longer try to find the window under cursor
since that would require synthesizing drag leave events. This is left to the
DnD handling of QWidgetWindow, which searches the child which accepts drops.

Task-number: QTBUG-33635

Change-Id: I844041bb862bb0382147be4e28f880a26843c453
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-08 11:16:36 +01:00
Friedemann Kleint
4072d68f57 Windows: Refactor code registering/unregistering drop sites.
Only top level windows of certain types should be drop sites. Add code to
update drop site registration to setParent().

This ensures the drop site is unregistered for example when winId()
is invoked on a parentless widgets which is later inserted into a layout.

Task-number: QTBUG-33635

Change-Id: Ia3161ecd59753f3f39d2a5967e9cb922cf0b9203
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-08 11:16:04 +01:00
David Faure
fc060c472d QWindow: reduce a bit of code duplication.
Makes it easier to add code in the future too.
No-op change.

Change-Id: I228c36813ccf8ee95ed4b6cbbc20af3178d1b84a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-02-08 10:53:14 +01:00
David Faure
9db6c67f5c Support --option in addition to -option for all builtin Qt commandline options.
In addition to being more common and consistent with QCommandLineParser, this
will make it possible to add the documentation for these options
in the QCommandLineParser-generated help output.

[ChangeLog][General] Builtin command-line options such as -reverse,
-session, -style etc. now all support double dash, e.g. --reverse,
--session, --style...

Change-Id: Ia2e22c854ccc6a9d7b863b1234317005bc822191
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-08 10:52:54 +01:00
Morten Johan Sørvig
c8848a5e98 Compile.
Change-Id: Ib0e7e7aa2964835afda4055a5fe76abbd5db84e3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-02-08 10:43:58 +01:00
Morten Johan Sørvig
2a6e372a49 Cocoa: Option handling.
Add qt_mac_resolveOption().

Support setting options using either an environment
variable or a QWindow property, with a default fallback
value. The options are resolved with precedence in
the mentioned order.

Adds options for the following:
NSView setWantsBestResolutionOPenGLSurface
NSVIew setWantsLayer
NSOpenGLContext NSOpenGLCPSurfaceOrder

The window properties use the _q_mac_camelCase format.
The environment variables use the QT_MAC_ALL_CAPS format.

Change-Id: I1978a02d62e107a2120d81ffdd0f7b32f7731644
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-08 10:39:17 +01:00
Thiago Macieira
fd0f1bc321 Make QStringBuilder use our qt_from_latin1 code (out-of-line)
Disassembly shows that the compiler does not perform the zero-expansion
by itself. It always opts to copy byte-by-byte, which is not very
performant.

Change-Id: I08780902461d9e3e6b7b54298f41d1eca61339c4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-02-08 06:09:57 +01:00
Jan Arve Saether
de1b98e9c1 Fallback to QWidget::grab() if QScreen::grabWindow() fails.
QScreen::grabWindow() is not always reliable because it grabs from the
framebuffer. (The window might then be covered by other windows, e.g.
"Stays on top"-Windows, popups etc).
If QScreen::grabWindow() fails we therefore fallback to
QWidget::grab(). This will not grab from the frame buffer, but it will
ask the widget to render itself (with its current state) to a pixmap
and return it.
QWidget::grab() should usually return the expected pixmap, and the
pixmap it gives is not subject to the state of the window manager.

This means that both QScreen::grabWindow() *and* QWidget::grab()
must produce an unexpected pixmap in order for the test to fail.

Change-Id: I276554155bb1e5b510d2a2d43628d91669464fe2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-07 23:52:49 +01:00