简体   繁体   中英

How to deploy cross-platform applications with Qt?

I have been coding in Qt for few years using MSVC and QtCreator on Windows.

Now I have decided to move to Linux environment and continue my development under Ubuntu. I then wish to compile the result on Windows machine for Windows executable, I expect no issues as the Qt code will be platform independent.

So I have all my .cpp, .ui, .h, .pro and other files on Ubuntu, I can compile it from Qt Creator or using command line, and now I wish to deploy for Windows too. How do I proceed? Do I copy all files on Windows machine every time and open project in QtCreator on Windows? Or can I automate this process somehow to be able to use eg a network-shared folder and avoid Windows Qt Creator modifying my code developed under Linux Qt Creator? There is lack of documentation when it comes to cross-platform deployment, yet this is the key feature advertised by Qt everywhere.

Is some code editing needed? What is the best approach in this scenario?

By using version control eg git you commit on Linux env and then checkout and build manually on Windows.

And by setting up continuous integration on Windows eg Jenkins , Buildbot you can automate build process so that when you commit to version control on Linux the CI builds automatically on Windows.

Or you can use MXE to cross-compile on Linux for Windows .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM