summaryrefslogtreecommitdiffstats
path: root/src/winmain
Commit message (Collapse)AuthorAgeFilesLines
* winrt: handle PrelaunchActivated property to pass certificationMaurice Kalinowski2016-01-051-0/+9
| | | | | | | | | | | | | | | | Windows 10 requires apps to handle the PrelaunchActivated property. This enables a faster startup by launching an app and immediately suspending it. This happens by the system and at the time the user launches the app no library loading or initialization is required. By default we opt-out of this and return early. The reason is that we cannot know the type of application written in Qt and whether it breaks the guidelines by using prelaunch. For further details check here: https://msdn.microsoft.com/en-us/library/windows/apps/mt593297.aspx Task-number: QTBUG-50292 Change-Id: I4d0b0b95a03f93b99211d042895404a88ea7cb9d Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* remove visual studio specific argumentMaurice Kalinowski2015-12-141-0/+3
| | | | | | | | | | "-ServerName:" is only used for Visual Studio and causes bad side- effects when using QCommandLineParser. Change-Id: Ifef652bbb65df9279a39ae3c74ddbb563c87bd90 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* winrt: Readd parameters to the pid-file's CreateFile2 callOliver Wolff2015-12-111-1/+1
| | | | | | | | Recent changes to the main file accidently removed the parameter from the call. Change-Id: I4cce48327d43d9ea3fe4fd82c2f5768aa4bc6d5c Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Store exit code in pid fileMaurice Kalinowski2015-12-091-4/+13
| | | | | | | | | | | | | | | We have to call Exit() to successfully close an application as done in 25dcc90d799fba3e3f0391783ed07cb22cd1115a. Unfortunately Exit() always sets the exit code to 1 and this cannot be changed programmatically. Hence write the exit code into the pid file which is created when launched via winrtrunner. winrtrunner then fetches the content and passes the exit code to its callee. This implies that the pidFile is not deleted by the app itself anymore. Task-number: QTBUG-38654 Change-Id: Ib9b6ae4a0d61c9bf7e530e984aae3ad6204c39a0 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* winrt: Exit application properlyMaurice Kalinowski2015-10-301-1/+3
| | | | | | | | | | After returning from main() it is not sufficient to exit the main thread, it also needs to be ensured that the Xaml::IApplication object gets notified by invoking Exit. Task-number: QTBUG-49141 Change-Id: I8ca434be5f17ddddd465ede2a79585c28c51b3ef Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Wait for main thread to exit before exit.Samuel Nevala2015-10-161-0/+1
| | | | | | | | | This will allow application main to go out of scope and free objects allocated there. Change-Id: I7b7199ecf67afe578bac043f16b064c9daaae04a Task-Id: QTBUG-48760 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Add support for native pickers for Windows Phone.Samuel Nevala2015-09-071-1/+23
| | | | | | | | | Support picking file(s), folder and save file via native component on Windows Phone. Task-Id: QTBUG-44833 Change-Id: Ibffc1cf3c133c9fbf9c92e0a4f874c4e197c50ee Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* winrtmain: Start in XAML modeAndrew Knight2015-08-131-115/+148
| | | | | | | | This allows the platform plugin to start using XAML interfaces in the windowing system. Change-Id: Ifcd29b8b8d83b138af69786dfc6a1adec21be37e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* Use qthread_win.cpp for WinRT as wellOliver Wolff2015-06-231-4/+0
| | | | | | | | | | Since of Windows (Phone) 8.1 most of the desktop's thread functionality is also available, so we might be able to share the code and get rid of the extra implementation for WinRT. Task-number: QTBUG-43837 Change-Id: I0ce907cd94899834527f88c70e1e395bafdb14b3 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* fix usage of wince scopeOswald Buddenhagen2015-06-051-1/+1
| | | | | | | Fix style issues along the way. Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into ↵Jani Heikkinen2015-06-021-1/+1
|\ | | | | | | refs/staging/5.5.0
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-06-011-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/global/qglobal.h Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
| | * Windows: Fix exit crash of GUI applications when deleting argv[].Friedemann Kleint2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passing Qt arguments followed by normal arguments, a double deletion may occur due to Qt shifting argv. For example: argv[] = app -qwindowgeometry +50+50 some_arg <null> becomes: argv[] = app some_arg <null> some_arg <null> Terminate deletion when encountering the null pointer. Change-Id: I5279955b6bd463f5858d6e5e8e16a1f5d0945652 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | WinRT: Fix argument handling on Windows 10Maurice Kalinowski2015-06-011-0/+38
|/ / | | | | | | | | | | | | | | | | | | | | The Windows 10 CRT does not export __getmainargs(), so we need to move to GetCommandLine like on WinCE and desktop Windows. As CommandLineToArgv is not available, the command line is split according by spaces, allowing for quotes (and quote escaping) around arguments. Change-Id: Ibc969df94ca5423a3a71d8190bbacd201189ea19 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | Updated BSD licensed file headersJani Heikkinen2015-02-152-6/+6
| | | | | | | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-112-10/+10
|/ | | | | | | | | | | | | | | | | | 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>
* Fix argv parameter to main() on WindowsJoni Poikelin2015-02-031-1/+2
| | | | | | Task-number: QTBUG-44050 Change-Id: I5b7ddec9d66158d8075ab091b01e883520e5414e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-5/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| * fix paths in installed qtmain.prlOswald Buddenhagen2014-08-041-5/+2
| | | | | | | | | | | | | | | | simply make use of the infrastructure used for "proper" modules. Task-number: QTBUG-40026 Change-Id: Iffab72f7fb7a128549da2839a7497cff2f48b777 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | winrt: Use native threadingAndrew Knight2014-06-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using std::thread, use the WinRT ThreadPool to manage threads. This allows for setting the scheduling priority, and provides a path to enable XAML integration (which requires Qt run on a background thread). QThread::terminate() is still unsupported, and only the winmain thread can be adopted due to the behavior of the thread pool when creating tasks from the GUI thread. The associated tests are now skipped, and all other QThread tests pass. Task-number: QTBUG-31397 Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-06-051-4/+5
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt.prf src/plugins/platforms/xcb/qxcbwindow.h src/tools/qdoc/qdocindexfiles.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I214f57b03bc2ff86cf3b7dfe2966168af93a5a67
| * remove HSTRING instancesMaurice Kalinowski2014-06-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | HSTRING needs to be released or handles will be leaked. Instead use HString which takes care of resource management on its own. Task-Number: QTBUG-38115 Change-Id: I2c767776c1f22f45acd8dd77b693f30d63d894b9 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | Windows: Use WinAPI CommandLineToArgvW() to create argv from command line.Friedemann Kleint2014-05-152-12/+40
|/ | | | | | | | | | | | | | | Split the Windows CE/Desktop Windows code paths in winmain. Use CommandLineToArgvW() to obtain argv[] for Desktop Windows. [ChangeLog][QtCore][Windows] Command line parsing on Windows now uses the WinAPI function CommandLineToArgvW() to exactly match the quoting of the command interpreter. Task-number: QTBUG-35432 Task-number: QTBUG-23687 Change-Id: I6743e73649d953497642f7717d3731a83ffda2a2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* WinRT winmain: Pass ImagePath as part of ImageParams in Xap packagesAndrew Knight2014-04-011-2/+17
| | | | | | | | | ImageParams is used to pass arguments to main(), but when used the original argv[0] is dropped. To remedy this, expect argv[1] to contain the same value found in the Xap's ImagePath. Change-Id: I2fb3b9956304fdcdeec4424ea56289d56ad4fe0b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* WinRT: Add debug message handler for winrtrunnerAndrew Knight2014-03-141-0/+25
| | | | | | | | | | By placing debug messages in shared memory, the application can share debug messages with winrtrunner (or any utility which passes -qdevel to the app and opens the corresponding shared memory area). Task-number: QTBUG-37308 Change-Id: Id0e04cfd5f0f701d552a448f780788c7cbf9b438 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* WinRT winmain: handle -qdevel parameter for additional debugging toolingAndrew Knight2014-01-301-5/+24
| | | | | | | | | | | This adds an additional command line argument, -qdevel, for tooling support. Since Windows Phone deployment APIs don't return the PID, this writes the PID to a lock file that can be read by deployment tools. Since arguments may be passed from one of several entry points, the special argument checks are now done in Run() instead of onActivated(). Change-Id: Ib3af157ccf687769d43d60adef9a0ab480e835b7 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Replace win32-g++ with mingw scopeKai Koehne2014-01-171-1/+1
| | | | | | | | Commit 773dd01 introduced a general mingw platform scope, which is cleaner and more flexible than matching the spec name. Change-Id: Ie3a9cb791a83f7c8a51bc4e23069190c452ab521 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* WinRT winmain: fix linker error on x86 compilersAndrew Knight2014-01-131-1/+1
| | | | | | | | The x86 PC and Phone emulator compilers choke on WinMain's signature not matching the stdcall exported version. This fixes the issue. Change-Id: I30d8a5dab67f3f1f15869abe2928326e3401dc43 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* WinRT: Properly return exit codeAndrew Knight2014-01-071-2/+6
| | | | | | | | | Instead of returning the HRESULT of the Run method, return the actual exit code of the application. Change-Id: I1e3d654ecdb4c319d4a08fe8a11e8699d186f66b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Change entry point for WinRT apps to WinMainMaurice Kalinowski2014-01-062-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Using wmain causes the problem that the linker seems to create some code around it, which calls ExitProcess. That function however is forbidden by the Windows Store Certification process and hence you cannot publish an application currently. This does not apply to Windows Phone, which links in such a way that this problem does not occur there. With WinMain as the entry point this does not happen and also is the default entry point. Testing locally shows that certification goes fine. Since it does not pass the full command line string, the C-runtime method __getmainargs is used instead. This also gives access to any environment strings which may be passed. Note that MSDN states that this function should only be used for desktop applications. For XAML/C++ scenarios there is no entry function at all, but rather the App object gets instantiated in the default template. But this only works for XAML itself and not for plain C++ applications, probably some other entry wrapper is created on the fly here. Done-with: Andrew Knight <andrew.knight@digia.com> Change-Id: I8a118eddf6cfeddeca7d676267e979af17123e02 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-5/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformtheme.h tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
| * enable path replacement in installed prl files on all platformsOswald Buddenhagen2013-12-041-6/+4
| | | | | | | | | | | | Task-number: QTBUG-33794 Change-Id: Id0d38715673b8a1c0c034e9c15783eb255c4315b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * properly replace windows paths in installed meta filesOswald Buddenhagen2013-12-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | it's bogus in the first place that the meta files contain windows paths, but straightening that out is a prohibitive effort. so instead generate additional s/// commands which take care of these paths. fwiw, the generated s///i command is a gnu extension. but as we are doing this on windows only where we are using our built-in sed command anyway, this should be fine. Task-number: QTBUG-33794 Change-Id: I46fcc598db12816ee56b5371ab184f6277eb3a22 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | Avoid adding empty argumentsMaurice Kalinowski2013-11-011-5/+7
| | | | | | | | | | | | | | | | QByteArray split does create one item even if the string is empty. Hence check if the launch arguments string needs to be parsed at all. Change-Id: I0a355212aaa7254fe0f417c61a59c30223311915 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | WinRT winmain: enable debugger waitingAndrew Knight2013-10-041-1/+9
|/ | | | | | | | | | | | WinRT applications are not invoked directly, so a debugger may attach too late to be useful. While the application can be launched with a debugging server, attaching directly to the running process is simpler and less resource-intensive. For this reason, it is useful for applications to wait for the direct debugger to attach. If the existing -qdebug parameter is passed to the application, wait idly until the debugger attaches. Change-Id: I7b4957beb9728ab6311b459e4d809dc5f4767780 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* winmain for winrtAndrew Knight2013-09-142-1/+156
| | | | | | | | | | | | | WinRT passes the executable and Appx server info to the CRT main, and supports several additional activation arguments as well. This handles the arguments passed to main as well as the case where a modern app is launched from an external application (e.g. Qt Creator). Task-number: QTBUG-30198 Change-Id: Ia843e98c7843d5705f5f6d1c809de0b6bcdb5d26 Done-with: Kamil Trzcinski Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* fix path adjustments in installed metafilesMark Brand2013-01-301-0/+6
| | | | | | Task-number: QTBUG-28902 Change-Id: Ia70da8f0f0b7abb4ea2a46cb4068c0827888b322 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* remove some unnecessary CONFIG additionsOswald Buddenhagen2012-12-171-1/+1
| | | | | | | | qt is already added by spec_pre.prf, warn_on and depend_includepath by default_pre.prf. Change-Id: Ic00e0ba496d698ed9659c476f2ca99fc0f86a093 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* let winmain just use qtcoreOswald Buddenhagen2012-11-021-3/+1
| | | | | | | | this is correct dependency-wise (anything which links to this needs to link qtcore), and just cleaner. Change-Id: I2c49d16fc8a0ee8bc55a3c165993fd1c4e313dab Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove pointless messing with CONFIG+=fix_output_dirsOswald Buddenhagen2012-11-021-1/+0
| | | | | | | | the function is automatically performed by debug_and_release.prf, regardless what we do with this flag. Change-Id: Iddec69b35e0e905fdf4133ee240af37d3a8ada0b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove explicit load(qt_build_config)s from the librariesOswald Buddenhagen2012-10-191-2/+0
| | | | | | | .qmake.conf (and previously .qmake.cache) already does that for us. Change-Id: I06cc01fa45921d7bd66dda7a0f88729faeff37bd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-6/+6
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* remove mentions of borland from project filesOswald Buddenhagen2012-09-191-1/+1
| | | | | Change-Id: I3049b24ae287bee50aca1de06664a2309df69edf Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Revert "Use true and false in preference to TRUE and FALSE"Sergio Ahumada2012-09-071-1/+1
| | | | | | | | | | | Even though I really think the change was the right thing to do, it seems like Windows people don't like this change because of some Windows Data Types specific rules. This reverts parts of the commit 56d5c909af6473be64a1ae487b45bd444a9a8553. Change-Id: I2c67d9b1bab36fc63937ef386aef56d2a4472a04 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Use true and false in preference to TRUE and FALSESergio Ahumada2012-09-051-1/+1
| | | | | | | | The TRUE and FALSE macros are obsolete and should be replaced with true and false (all lower case) respectively. Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix misnomer: qt_module.prf => qt_build_config.prfOswald Buddenhagen2012-06-191-1/+1
| | | | | | qt_module suggests to be congruent to qt_plugin. Change-Id: I629530bcbe2ba6c0adbdc11a275119c8aff0c953
* don't use qt_module_config for winmainOswald Buddenhagen2012-06-191-20/+28
| | | | | | | it is not really a Qt module, and pretending causes some messups. Change-Id: Id0980f7c00d6d176dd4937f8b265b8b571aa1277 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix tabs/whitespacesYuchen Deng2012-05-031-9/+7
| | | | | Change-Id: I4db24b703c69ce99f529c84248d9fe4a19a60a03 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* MSVC: Fix link warning if ship qt library without pdb filesYuchen Deng2012-05-031-0/+5
| | | | | | | | | qtmaind.lib(qtmain_win.obj):-1: warning: LNK4099: PDB 'vc100.pdb' was not found with 'qtmaind.lib(qtmain_win.obj)'; linking object as if no debug info Change-Id: I5d515a240e917f5747ec8ca7dabde1cd1a1b14de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>