How to build with Qt

qt

#28

Current version of QtCreator is v4.3.1:

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


#29

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

#30

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):

https://doc.qt.io/qt-4.8/signalsandslots.html image


#31

A picture is worth a 1000 lines of code. LOL


#32

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


#33

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


#34

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


#35

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. "

#36

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


#37

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: https://dragly.org/2013/05/13/speeding-up-compilation-on-ubuntu-with-qt-creator/

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.


#38

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.


#39

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.


#40

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?


#41

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


#42

Thank you… that should cut the build time a bit.


#43

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


#44

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.


#45

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


#46

@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).


#47

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.