How to build with Qt

Current version of QtCreator is v4.3.1:

http://blog.qt.io/blog/2017/06/30/qt-creator-4-3-1-released/

The Qt wiki seems really good:

Qt Wiki

Scroll down the main page to find sections on;

  • Install/Build
  • New to Qt 5 (including ā€˜Qt for Beginnersā€™) and more good stuff
1 Like

Here is good discussion on how Qt connects itā€™s visual GUI objects (widgets) to other objects and functions, with Qtā€™s ā€˜signal-and-slotā€™ method (instead of using callbacks):

Signals & Slots | Qt 4.8 image

2 Likes

A picture is worth a 1000 lines of code. LOL

Today Qt released a new version of Qt Creator: v4.4.0

1 Like

Just FYI, Unity is written in C++.

ā€œā€¦unless youā€™re considering making some kind of simpler ā€œmake your own gameā€ software for non-programmers to use in the tradition of the old ā€œconstruction kitā€ tools from the olden days, you would probably want to choose a lower-level development setting such as c++.ā€ http://answers.unity3d.com/questions/15016/can-i-use-unity-for-making-non-game-apps.html

C# & Javascript, actually. You can use C++ as plugin libraries or if you are prepared for a lot of headachesā€¦

Yeah, but Unity recommends not to use Unity for what weā€™re doing. Itā€™s important that everyone here understands that weā€™re using C++ for very good reasons.
http://answers.unity3d.com/questions/9675/is-unity-engine-written-in-monoc-or-c.html

"Unity is written in C++, with the following exceptions:

  • we expose a .NET api so that you donā€™t have to go trough the pain of writing your game in c++, but you can write it in Javascript or c# or boo.
  • The editor applicationā€™s UI is written in C#, using mostly the same API that we expose to game developers. (We have access to a few APIā€™s that we donā€™t expose (yet), but not that many)
  • This is also the reason that the answer to the question ā€œCan I use UnityEngine.dll in some other c# projectā€ is always no. There is hardly any functionality in UnityEngine.dll, the only thing it does is relay your c#/javascript calls into the C++ part of Unity. Without the C++ part there is nothing. "

Iā€™m installing the latest QtCreator v4.4.0 for Windows 64-bit today.
If possible, please use QtCreator v4.4.0 for your OS to build our code:
https://www1.qt.io/download-open-source/#section-9

I had to install ccache on my Ubuntu 16.04, because I got messages that ccache was not found during the Build All step in QtCreator.

See this article for how to install:

The build process in the code is set to use ccache for building in Qt on Linux (not if youā€™re running Qt on Mac or Windows). The QMAKE_CXX variables are set to use ccache with the g++ compiler.

To speed up the compilation even further, use the -j parameter. The article describes how to use the -j parameter to allow multithreaded compilation.

I got error messages during compilation because it couldnā€™t locate the OpenGL libraries.

/usr/bin/ld: cannot find -lGL

I didnā€™t have to install OpenGL on Ubuntu 16.04, as I had already installed them. To check if you have OpenGL libraries installed:

$ glxinfo | grep ā€œOpenGL versionā€

If you need to install OpenGL, install mesa-utils (they arenā€™t installed by default on 16.04):

$ sudo apt-get install mesa-utils

To find out more about Qt and installing it on Ubuntu 14.04 and 16.04 hereā€™s the article: Install Qt 5 on Ubuntu - Qt Wiki.

The first time building develop in Qt will take a long time on ubuntu.
Turn off your computerā€™s suspend after 30 minutes, etc. in power settings.
But good news - all subsequent builds will take less time.

So build the first time through: from top menu Build select Run Qmake then Build All.
And wait. Watch a movie.
For subsequent builds, clean out previous results first: Build/Clean All, Run Qmake, Build All.

Note: If you run ā€˜Clean Allā€™ before your first build then youā€™ll get an error message, donā€™t worry just ā€˜Run Qmakeā€™

Then when it finishes, Set up the lower left column ā€œmonitorā€ icon: image Select Release, and ā€œvalentinaā€.
Then run and test LibreFashion by clicking on the Green Triangle.

It takes about an hour or so with Windozeā€¦ subsequent builds maybe 5-10minsā€¦ depending on how much has changed.

Is there a way to just build Tape?

Whatā€™s the option to turn off the build of tests?

Add CONFIG+=noTests to the qmake settings to skip the tests.

1 Like

Thank youā€¦ that should cut the build time a bit.

I think the steps for building Tape.pro requires data thatā€™s generated when the entire project is built.

Here is what we now require to build the code with Qt:

Qt v5.7allows us to keep support of Ubuntu 14.04 LTS.

The README.md file on the repo has been updated to reflect these changes.

A silly question - Iā€™ve successfully built Seamly from source (on Ubuntu). Is it possible to run it without doing a make install?

@Calum do you want to run on Ubuntu? I have built from inside QtCreator and am able to run from there. Can you tell a bit more about your system configuration? It is also possible to create an account on launchpad and let them do a build with the appropriate ubuntu and Qt interface libraries so that you can install from your own personal PPA. (I have done this).

Sorry, I should have said - Mint rather than Ubuntu, though thereā€™s probably no practical differences. Mint 17, I think.

To be honest, I couldnā€™t figure out how to work QtCreator, so I just build it from the commandline with qmake.

Iā€™m just trying to make sure that my ā€œproductionā€ copy, installed through the official PPA, doesnā€™t get trashed by me installing this one over it.