Pixel positions have to be set in relation to screen size in pixels,
not the physical size to calculate the normal position in the
range 0..1.
Change-Id: I6880fb64b7c3049d657fd081b564b945399b5865
Reviewed-by: Frank Osterfeld <frank.osterfeld@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
The library needs to do Q_INIT_RESOURCE for all resources it uses
internally, otherwise static linking will fail, and the user has
no idea how to rectify it as the name of the missing resource is
not known. The Q_INIT_RESOURCE needs to happen outside of any
namespace, hence the use of static initResources() functions.
Change-Id: I8f7d36b440b05809d97dd489cf8789f345633cec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The problem is the verifyConstExpr<>() line involving the ~ operator.
The result as an integer is a value that can no longer be represented
in an int. This is known at compile time and thus template deduction,
which only has an int to match against, fails.
To fix, use an unsigned int as the first template argument of
verifyConstExpr<>().
Clang's error message for this is really sub-optimal, cf.
http://llvm.org/bugs/show_bug.cgi?id=17834
Change-Id: I3a77dc54d2bee12b016d75724ac1bd7801f4cf2d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The other member functions that can be constexpr already are, only these
were missing.
Change-Id: I717c74b210b45cfb8af9168d61e27e3ff2f6a9c9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Loading an enum with a value that isn't in the enum is undefined,
according to Clang's usan.
So when doing logical operations on QFlags<E>, don't go through
the QFlags(E) constructor, but via QFlags(QFlag) (=int) instead.
Apply the same change to QUrlTwoFlags.
Change-Id: I5f27e22c4d831482fcbba88b97cb124fb005e3fd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We did not do this from before. Instead we would activate
the window when it's view became first responder. And this
would happen when the input panel was told to open.
That behavior is a fragile, since other layers higher
up (qml) would not open the input panel unless the window
was active, which also makes sense. A classic chicken and
egg problem.
So to play more along with how Qt is expected to work, we
change behavior to instead activate the window directly
when requested to do so (which also includes when the user
touches the window directly). This will also work better
for "keyboard" events like Key_VolumeUp, once implemented.
The down side is that Qt will give focus to widgets/items
(and as such, open the keyboard) whenever you touch the
window. But that is easier to fix, and will be dealt with
in later patches.
Change-Id: I9bbeb0205e7ea3c5079100c07e40ddb1c60b476b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
- Remove Active Qt -- it's not really plugin-related
- Add QDoc dependencies
- NOTE: Can't add Qt QML because QDoc would get confused between the
C++ and QML "Qt" namespaces.
Change-Id: I15a76dbd5235f13598a3802a815f7f49b80eac8a
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Make sure that resize events are delivered when the platform
plugin overrides the geometry set in setGeometry().
This fixes a race condition where a widget was resized to its
sizeHint() while the window was maximized, and the content was
shown scaled on the screen.
The problem is that the widget gets the wrong size from
QWidget::setWindowState() (which calls adjustSize() in order to support
normalGeometry). This size is used to resize the backingStore. When the
QWindow is resized, it calls QEglFSWindow::setGeometry() which corrects the
size to screen()->availableGeometry(), and triggers a GeometryChangeEvent
since the size was corrected.
This ends up in QGuiApplicationPrivate::processGeometryChangeEvent() which
will not send a resize event, since the size has not changed (it is always
availableGeometry()). Therefore the widget is never resized, and the
backingStore remains the wrong size.
Task-number: QTBUG-34421
Change-Id: Iee49c53cc529de36010db2695d838d8c2284edd4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
On API-11+ if there is no hardware menu button show the action bar.
Fix menu when using the opengl android plugin.
Task-number: QTBUG-32002
Change-Id: I45bd49107621e4cab85eb6411897229e20bb8281
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The constructor functions generated by rcc are put in the global namespace.
As there is no way to forward-declare a function in the global namespace
from within another namespace, Q_INIT_RESOURCE must always be called from
the global namespace.
Change-Id: I8b8b9451271cf2f9147164696a6df7615678ab03
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This code path can and will be hit during app startup,
and can result in low-resolution images being used
on high-dpi systems.
Use qApp->devicePixelRatio() instead, which is more
likely to be correct.
Change-Id: Ic881cfedd8e962037d2d4af4a1242f590d56c194
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Removed links to obsolete pages (some pages were combined and
some were removed), added links to new pages, and changed a title.
Change-Id: Iaf0e3adf2edaf048a8bb7e26b3cfd45c4680de2d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This reverts commit 8c58640fdf.
The intent was to reduce the maintenance of parallel code paths,
but this had a negative impact on performance so we need to
enable it again.
Change-Id: Ic58f7781ff076055e7c48f20fc0e7a8a2c9e51a4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Add more config changes needed for API 13+
API 13+ is mandatory to build any Qt for Android application.
Change-Id: I595f7174dd2fc8a0865772f9780ce606e1f1fcf1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
In 5.2, the HTML output is in a flatter structure and when they are
hosted in qt-project.org/doc, the documentation will be found at
http://qt-project.org/doc/qt-$QT_VER
The url variable is used by projects outside of Qt 5 which need
to link to Qt 5 documentation, such as Qt Creator.
Task-number: QTBUG-34584
Change-Id: Ifa55fcd9e402b0e184a41e316340e46aeb7101de
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
The freetype font engine would fall back to rasterizing glyphs
via QPainterPath in QFontEngine::alphaMapForGlyph() which has
a rather unfortunate implementation.
Change-Id: Ic0b4095b6f17ab33f0602139f0a8fb441dfba0ee
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
According to Thiago, Qt assumes this in a lot of places,
so make it explicit.
Change-Id: I3f4a55699379fd9fe4d792061c80b3b589c10c53
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Prevent compilers from computing strlen() at compile time by
passing a volatile pointer.
Task-number: QTBUG-34261
Change-Id: I5e5e80181024d57496907918d2a43d7c83841082
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make sure that the size of QIntegerForSize<N>::{Signed,Unsigned} is
actually N.
Change-Id: I221304f7c420e80758ef7b115bafb7cf1f8c8829
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Since the original change caused a problem with the CSS
rules being always inherited where in some cases this should
not be happening.
This reverts commit 6f65466137.
Change-Id: I6e9cf163d752b1869b5e967a7ab59963d655ba87
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This is what ConfigLocation was meant to be. A directory shared by all
applications. Unfortunately when I wrote the fallback on Windows,
I picked DataLocation (which is app-specific) instead of
GenericDataLocation (which is shared between apps). This makes it
impossible to have config files shared between apps, e.g. for libraries.
It also makes ConfigLocation quite inconsistent (on Windows one cannot
use it to load another app's config file, while it works everywhere else).
All this is fixed by GenericConfigLocation, which is shared between apps.
Change-Id: I23a755131061d4fea01e13dd1038fbd8ef333a5d
Reviewed-by: Alex Richardson <arichardson.kde@googlemail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We would spam the debug output on devices with api < 16 with some
warnings that the super class a11y delegate could not be found and
others.
Instead check the runtime version before trying to load the JNI code and
only load the delegate if api is new enough.
Change-Id: I52286cb99924b034b9b58c53566f15030939b0c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
In practice, there are several ways to forward-declare
objective-c classes. Qt uses "struct objc_object",
other projects may use a plain "class". Mismatched
forward declarations will lead to compile errors,
and this is a form of header pollution.
dd5e40d9 added a workaround where Q_FORWARD_DECLARE_OBJC_CLASS
can be predefined in order to sync up the declarations.
Make forward declaration clashes less likely by
forward-declaring in objc-mode only.
Change-Id: I9f7a399d64dc88bfe05d5385b3d46b5302112aef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Commit a2bdda8e3b was meant for creation only. We should not
hide views on our own, particularly when Qt had not asked for that.
Task-number: QTBUG-33581
Change-Id: Ib35fc78a27be1498f80aabd385e7a2185475b949
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Expanded the documentation to describe what the code in QImageReader and
QImageWriter actually expects from these plugins.
Change-Id: I04bb0cbf56d57a56ed246e723e533d73440a4d3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Only DirectConnection is tested
Change-Id: I525c6a65428489c34e58d1d9600b4e5ebda733b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Nested references with a depth of 2 or greater will fail. References
that partially expand to greater than 1024 characters will also fail.
Change-Id: Id4e49d6f7cf51e3a247efdb4c6c7c9bd9b223f6e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The qtAddModules functions resolves deps internally, but doesn't affect
the original QT and QT_PRIVATE variables. We need to pick up situations
such as the user adding QT += quick, which implies QT += qml through
the QtQuick module's dependecies.
Change-Id: I14411dbea3e4f7402be404073a3fe8f18dbb165f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
It's not providing any convenience over using Q_INIT_RESOURCE, which does
its own extern, were never documented, and was added back in 2010 without
any commit message justifying its existence.
Change-Id: I1ca9a042d3f4fca34007d28b140661c50064f11b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Two template functions for qboject_cast() are defined
in qwidget.h that confuse qdoc because qdoc doesn't
handle template functions correctly. In this case, the
documentation for all qobject_cast() functions appears
in qobject.cpp where it is declared to be related to
QObject. This fix surrounds the template functions in
qwidget.h with #ifndef Q_QDOC ... #endif, since qdoc doesn't
need to see them.
This fix unmasks a linking bug QTBUG-34564, which will
be fixed separately.
Task-number: QTBUG-34505
Change-Id: I97fd32cc563bfa4a232819c097f41be56adf0114
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Fix spelling error in method name and inline simple functions.
Change-Id: I7f2a67fb1951b58874b09002ee57e15e75561727
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This change activates ThreadedOpenGL and ThreadedPixmaps capabilities
in the iOS integration. QIOSContext is expanded with a support for
a shared context.
Change-Id: I56615c870a24e17850ad2748421c54e015de3ab2
Reviewed-by: Ian Dean <ian@mediator-software.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
The Q_INIT_RESOURCE macro is needed if a library itself uses resources, in
which case the Q_INIT_RESOURCE can and should happen in the library (like
we do for eg. widget styles), or if a library exposes resources that are
supposed to be used by the library clients, in which case the macro needs
to be put in the application code.
The distinction between the two, and the fact that resources built as part
of the main executable do not need the explicit initialization, were not
all that clear.
This was evident by the lack of Q_INIT_RESOURCE in our own Qt libraries,
and the various Q_INIT_RESOURCE calls in our examples where they are not
needed.
Change-Id: I40258458e9fdf9ee5502c212971fb3d90b4fc388
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Screen events are still read in the screen event thread but are
processed in the main thread to make it possible to support
QAbstractNativeEventFilter for screen events later.
Implementation is similar to the xcb platform plugin.
Change-Id: I7bade3e13e51c6d70bb608727a93bbd3aabc5d47
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>