summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformtheme.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-221-2/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/qeglfshooks.cpp Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
| * QAndroidPlatformTheme: wrap char* in QL1S to avoid warningsAnton Kudryavtsev2016-10-181-2/+2
| | | | | | | | | | Change-Id: Idcc70038051b03366aa447f3a4c48912d3f911d5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | QGuiApplication, platform plugins: don't modify AA_DontUseNativeMenuBarShawn Rutledge2016-09-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default should be false, meaning the application will prefer to use a native menubar if the platform supports it. The application author can set it to true if he wants to always use a Qt-rendered menubar instead; or, he can call QMenuBar::setNativeMenuBar(). Qt and its plugins should not override the author's wishes. Instead, if the platform plugin cannot create a native menubar for whatever reason, createPlatformMenuBar() will return null, and QMenuBar will fall back to using a Qt menubar instead. The application can check the result via QMenuBar::isNativeMenuBar(). QMdiArea when maximized inside a QMainWindow with an empty title does not replace the main window's title if we are using native menus. This behavior turned out to be the same on Unity as it is on macOS, so the autotest needed adjustment to expect that behavior whenever the menubar is native, not only on certain platforms. tst_QMenuBar::allowActiveAndDisabled() tests a standalone QMenuBar. In f92f78094 it was disabled on macOS, but on Ubuntu it passes as long as we force it to be a non-native menubar, so it should pass that way on macOS too. Removed unused variable RESET to fix warning. Task-number: QTBUG-54793 Change-Id: I716e40da709f96331cbbf25213bd7bc153e4dbe2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-131-0/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/testlib/qtestcase.cpp src/testlib/qtestcase.qdoc Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
| * By default use native menu barBogDan Vatra2016-04-081-0/+3
| | | | | | | | | | | | Task-number: QTBUG-52010 Change-Id: I8f5feacc41719b1c084ec5a8763e597c1dab716c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QtBase (remainder): use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "" with qWarning("..."). Had to fix broken qImDebug() definition. Instead of defining it as a nullary macro in the QT_NO_DEBUG case and as a variadic macro in the other, define it in both cases, as is customary, as a non-function macro so that overload selection works without requiring variadic macro support of the compiler. Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3 AMD64 builds. Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| * Use QFileInfo::exists(f) instead of QFileInfo(f).exists()Tobias Koenig2016-01-211-1/+1
| | | | | | | | | | | | | | QFileInfo::exists(f) is somewhat faster than the version which creates an temporary object. Change-Id: I5f931a86d9dfad57d99efe04ca115422de43def9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-151-13/+19
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * Don't use QT_AUTO_SCREEN_SCALE_FACTORMorten Johan Sørvig2015-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | With the addition of Qt::AA_EnableHighDpiScaling testing of the env. variable only is no longer sufficient. Use QHighDpiScaling::isActive() instead, which is available at the time loadAndroidStyle is called. Change-Id: Iaa6bbb5a04a71fa3bd68f3bdc8c8bcdfb5d1778f Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | AndroidStyle: use std::make_shared()Marc Mutz2015-11-291-1/+1
|/ | | | | | | | More efficient, because control block and tracked object are co-located in a single memory allocation. Change-Id: Id18e2d06db43568eb34c2e2d129d1b116af73acb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Android: Add opt-in high-dpi supportMorten Johan Sørvig2015-10-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt-in by setting android.app.auto_screen_scale_factor to true in AndroidManifest.xml. This will enable devicePixelRatio scaling in QtGui using a scale factor provided by Android DisplayMetrics. Note that the Android style is not currently supported: it already accounts for different display densities which results in incorrect visual sizes when enabling devicePixelRatio scaling. Implementation: Bring DisplayMetrics::density through to setDisplayMetrics in androidjnimain.cpp, similar to what is done for "scaledDensity". Override QPlatformScreen::pixelDensity(), which forwards the scale factor to QtGui. [The difference between "density" and "scaledDensity" is that the former is a physical display density factor which corresponds closely to devicePixelRatio in Qt, while the latter also includes the Android global font scale factor.] Scale the global font pixel size in qandroidplatformtheme.cpp to keep the visual font size constant. Based on an initial patch from Daiwei Li <daiweili@suitabletech.com> Task-number: QTBUG-46615 Change-Id: Ia51f99bf6dda485a57413949246c7b32cb47e8dd Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-6/+6
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-5/+13
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Fix crash when Android Style is set more than once.BogDan Vatra2014-12-151-5/+13
| | | | | | | | | | | | | | | | Load again JSON document is it was freed. Task-number: QTBUG-43111 Change-Id: I22f1de221371b49fec8b3d66ad5f0bd2af9656fe Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-101-1/+2
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * Merge remote-tracking branch 'origin/5.4.0' into 5.4Simon Hausmann2014-12-051-1/+2
| |\ | | | | | | | | | Change-Id: I0cd11cbe95693b78450ea81a0187760f4a6a8b5f
| | * Android: Fix broken system paletteEskil Abrahamsen Blomfeldt2014-12-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we overwrite the default palette, we have to make sure we don't overwrite default values with black for all the colors that are not retrieved from the json file. We would for instance get black as both the base color and text color which would make some components unusable. Change-Id: I1079a70a0ac7eb379ed5e8d92c6b39c2ea77ba49 Task-number: QTBUG-42812 Task-number: QTBUG-42998 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-271-3/+4
|\| | | | | | | | | | | Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
| * | [QAndroidPlatformTheme] Get rid of static QFontKonstantin Ritt2014-11-251-3/+4
| |/ | | | | | | | | | | | | | | QFont is not POD and shouldn't be instantiated statically, otherwise we could end up with UB during qApp destruction. Change-Id: I2372c7a643eb3007957ab2b798732c1a18fd0ae5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-16/+281
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Set Android palette and fonts in QPA plugin.BogDan Vatra2014-11-141-16/+281
| | | | | | | | | | | | Task-number: QTBUG-40621 Change-Id: Ibe069d4f93ac317e4f1b9ef5fc6bc3edcfac8685 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-18/+10
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Android: use qEnvironmentVariableIntValue()Marc Mutz2014-09-121-3/+3
|/ | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: I6d79852613228658f9093a272edf9b434e60286c Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Forward menu button events to Qt if there is no visible menubar.BogDan Vatra2014-08-161-0/+6
| | | | | | Task-number: QTBUG-32334 Change-Id: If1b4517f233b04d4c6c165cbfe62c8cf7b624c60 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Fix namespace usageChristian Strømme2014-06-301-0/+4
| | | | | | | This change makes it possible to set a Qt namespace for Android builds. Change-Id: I79f4ae8200223f36f97e2849aae49e45b8850d23 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Support double click eventEskil Abrahamsen Blomfeldt2014-03-101-1/+25
| | | | | | | | | | | | | | | | It's impossible to get the distance between two touch events down to 5 pixels on e.g. my Nexus 5. This patch makes it possible to tweak the distance through the platform theme, and sets the distance to 15% of an inch on Android. Also provides a way to override the default minimum of 5 pixels by using an environment variable. [ChangeLog][Android] Fixed double click events Task-number: QTBUG-36974 Change-Id: I23d94020c531747d6638b645133611614a2a0703 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Consolidate StandardButton, ButtonRole and related static functionsShawn Rutledge2014-02-151-4/+4
| | | | | | | | | | Moving them into QPlatformDialogHelper for the convenience of both widgets and QtQuick.Dialogs. The main reason is to ensure that QtQuick.Dialogs does not need to depend on the widgets module, in order to re-implement the button box concept in a generic dialog. Change-Id: If400d215338d7cb6dade39d9de60e50b5e7515ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Android: default palette taken from the Holo Light themeShawn Rutledge2014-02-121-1/+33
| | | | | | | | | Currently QAndroidPlatformTheme::palette has been returning null so the default colors came from elsewhere. Now they will default to colors taken from the Holo Light theme to the extent possible. Change-Id: I022c5ef679d9d0dcb76721a4d520492bc8a6f4cf Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Introduce function for standard button texts to QPlatformTheme.Friedemann Kleint2014-01-181-0/+16
| | | | | Change-Id: I91eec04a95b5047d893490a70152237b2991f662 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Support multiple native surfaces on Android.BogDan Vatra2014-01-171-0/+170
Support for multiple native surfaces is needed by applications that need to mix raster windows with GL windows. Rework the raster and opengl implementation, get rid of eglfs and fbconvenience dependencies. Create a single android platform plugin. [ChangeLog][Android] Rework the raster and opengl implementation. [ChangeLog][Android] Create a single android platform plugin. Task-number: QTBUG-34650 Change-Id: I9b1ab51554823329dda8cfbf8fef27c38f917c7b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>