Standalone Qt Designer installation - c++

I develop applications with Netbeans on my Windows PC for the Raspberry Pi and build them remotely on the Raspberry Pi. Now I also would like to develop some GUIs with Qt. Because of remote building I need neither MinGW nor Qt modules (RPi of course has everything necessary installed), only Qt Designer to edit the Qt Forms.
How can I install Qt Designer only or at least with as little additional stuff as possible?

The easiest way would be to download a Qt binary, unzip it, then remove the parts used for compiling user code - i.e. leave only the bin, plugins, resources and translation folders. You can further pare down what's in the bin and translation folders.

The Qt standalone installer binary built with Qt installer framework which accepts scripts also, you can write scripts and customize which you want to install with those scripts, look here https://stackoverflow.com/a/21279733/4490542 and
https://stackoverflow.com/a/34032216/4490542

For anyone else ending up here. Here is a standalone installer someone made:
https://build-system.fman.io/qt-designer-download

Related

Associate QT WebAssembly with Emscripten

We have developed a desktop application with Qt in Python language. We want to transform the desktop version to the web version.
For Qt 5.13 or higher, there is a plugin called WebAssembly, which uses Emscripten to do code translation.
Problem
We have installed Qt 5.13 and Qt 5.14, Web Assembly but we're having trouble getting Qt to recognize Emscripten. Either it does not recognize Emscripten or, if you recognize it, you do not understand the Emscripten directory.
Are we installing Emscripten wrong? Do we need to know any details?
Snapshots
Qt for WebAssembly is meant for C++, and not for Qt for python, even though python can run on WebAssembly, the python libs most likely won't ever be ported to WebAssembly, since is quite a technical challenge, also because Qt wasm apps are statically linked, and this poses a big problem for python libs. If your app relies heavily on QML, you should be able to port and run your app in the browser. If you want to do some quick testing you can use Felgo WebAssembly tools like the web editor https://felgo.com/web-editor or the fully fledged Web IDE https://ide.felgo.com
You have to run: source /path/to/emsdk/emsdk_env.sh prior to running QtCreator but within the same context if that makes sense.
Here's an example of how to fix this
Create the file em-qtcreator.sh in your HOME folder and do something like this:
#!/bin/bash
source /path/to/emsdk/emsdk_env.sh
/path/to/qtcreator
Now, just execute that script by using
chmod +x em-qtcreator.sh
./em-qtcreator.sh
This should allow QtCreator to auto-detect emscripten, otherwise you'll have to manually add the emcc compilers in the build configuration

Can't import/configure Qt project

I have cloned the following GitHub project to my hard drive.
https://github.com/leozide/leocad
I have also installed Qt Creator 4.5.0. However, when I try to load the project in Qt Creator, it says there are no valid "kits", and will not let me configure the project. (Presumably, this is a necessary step before I can build the project.)
What do I need to do to get this to work? Thanks.
Windows 10 Home, Qt Creator 4.5.0
Qt is a cross platform framework, thus supporting a bunch of c++ compilers like MinGW GCC, Clang ...etc. a Kit is a set of Qt packages designed for a specific C++ compiler and implements the Qt libraries for that compiler, this is what you need to compile your project in Qt creator .. and they are not part of Qt Creator itself, they must be downloaded. below steps are suitable to get Qt fully functioning.
The Qt open source.
There are two ways to get Qt, the first is to download the source code packages/files and build Qt yourself (but this would be needed if you have a reason to build qt packages from sources yourself). this not covered here.
Steps to install and Configure prebuild Qt Open Source.
Download Qt Online Installer for Windows, usually from this location Qt Online Installer for Windows, this is an online installer for Qt.
Run the downloaded installer, it will guide you through few steps like creating an Qt account and logging in ...
You will end up to the component selection screen and this is the most part.
Expand the Qt Selector tree, you will get 2 groups, A list of available prebuild Qt versions, And to the bottom a Tools selector tree.
make your selection of which Qt version you wish to be downloaded and installed.
Then expand the tree for that version and Choose the components of your interest, these are package kits for a list of compilers .. (For example: a windows user might choose "MinGw x.x.x 32" suite for development under windows .. and "Android" component to develop Android Apps on Qt Creator.
Go down to the Tools tree, expand and select which components to download and install. For Windows usually you need : Qt Creator Debugger, MinGW x.x.x (same as above) and Qt installer framework (which is a maintenance tool for Qt upgrades ...etc).
If you have selected MinGw kit in Qt Version , then you must download the corresponding MingW framework, from Tools branch, unless you have it.
After all selections are made press Next and complete the installation.
Note: with a clean installation of Qt, it configures itself automatically and no further configurations are needed -> Kits are automatically configured based on your installed components.

Qt - C++ Graphical application in visual studio

I want to create graphical application (drawing and moving squares and so) using C++. I was suggested to use Qt library for this. I am windows user and I use Visual Studio 2013 for developing C++ (console) apps. So I typed Qt download into google hoping to find some package of DLLs, libs, headers or something like that so I could include headers and link libraries with my code. But all I found was IDE Qt Creator (which I do not want) and Qt Visual Studio plugin (which I downloaded, but it still requires whole IDE to work). So my question is - How can I develop graphical application (no forms, just "canvas" to draw on with some mouse/keyboard support) using Qt library, C++ language and Visual Studio IDE, without requirement of downloading tons of GBs for IDE or plugins I do not want, with insurance that application would be easily deployable on most common operating systems.
The reason I do not want Qt creator IDE is simple -- There is a chance for this to be semester project and will be reviewed by teacher without any extra IDEs. (I'll send him just VS project/generated Makefile and Qt libraries with headers)
Thanks for clarification.
The short answer is: you cannot. You need Qt SDK, which comes with Qt Creator.
Qt comes with qmake build system and it does not require any IDE to compile and run the application. You can write in any IDE you want and compile anywhere, where Qt SDK and compiler is available.
If you want to provide the application to your teacher, he must have Qt SDK too to compile it. There is no way around this. And better test the application in the target environment. Writing portable applications is not a trivial task - if you hardcode paths like C:\QtSDK\path\to\something, there is little chance to run it under Linux without any changes.
If you cannot expect any SDK on a teacher's computer, you have few options:
convince her to install necessary tools
ask her what tools are permitted and stick with them
bring your own computer for final evaluation

Qt in Windows: build environment and redistribution problems

I want to ask your opinion about one specific aspect of endless "Qt vs wxWidgets" question. Using wxWidgets in Windows, I may continue to work with my prefered build tools and compilers (in my case, Visual Studio). I only need to add wxWidgets include and lib directories to the compiler/linker path. When necessary, I just open some wxWidgets form designer (like DialogBlocks) and make form layout. Executables don't have any additional dependencies and don't cause any problems in redistribution.
On the other hand, Qt comes with its own IDE which tends to be the main development tool (which I don't want). It installs MinGW. It uses qmake, this is one more challenge in integrating Qt to existing build environment. I don't know how to use my existing libraries, developed with VC++, in Qt application. Can I continue to work with Visual Studio or I need to switch completely to Qt Creator? Or use both, building everything but UI in Visual Studio, and UI in Qt Creator? How Qt-based application can be redistributed: should I require MinGW installation on target computer?
How all these problems are solved - I need some directions and opinions from C++ developers working with Qt in Windows.
Edit: It looks like most promising directions are Visual Studio plugin and CMake. I found that Qt plugin supports VS2010, but it requires rebuilding Qt from the source. For VS2008 this plugin works with binary Qt installation - good enough.
You don't have to use the whole Qt SDK, you can only install the libraries for VS (or build from source, if you prefer. The pre-built libraries are for VS2008 but there is a makespec for VS2010 so you can build one yourself, if necessary) and use the Visual Studio integration.
You can use Visual Studio. There is a Visual Studio integration plugin that makes it a lot lot easier to develop with Qt in Visual Studio.
As for the wxWidgets vs Qt debate... I use both (on different projects). I have to say that I would rather use Qt - it has fewer bugs IMO and in general there is an easier workaround if you have problems with the framework (Qt4 is much better in this regard than Qt3 was because the 'pimpl' data is accessible). However, distribution is slightly more complicated with Qt as you must make sure that you have set included any plugins correctly in your distro (be sure to check that it works on a clean machine that does not have Qt installed).
You can download the Qt "source-only", take a look here for the latest version. You can build this library youself using the provided configure tool and MS' nmake...
For example, my typical build looks like this:
configure -shared -release -opensource -no-webkit -nomake demos -nomake examples
nmake
This will build release-mode Qt dlls, assumes you want to use the LGPL-license (with the -opensource flag), no webkit and upon calling nmake it will not build the demos and examples... Of course, you will have to take a look at all the possible options provided by configure
You don't have to use Qt Creator, many people use other IDEs or simple text editors.
qmake is not difficult to use, from a template config you can easily modify a project file by hand. In fact qmake will generate a basic project file for you to get started with.
Use existing libraries as you would in any other project.
You don't need to require a mingw install, you can include essential DLLs in your application directory; but this is the same problem as any other "DLL hell" problem.
If you use cmake as a build system, you can use that to generate project files for visual studio (and eclipse, and ordinary Makefiles, and ..., on any OS). Just install the cmake GUI and select visual studio [myversion] in the appropriate dropdown menu. The only thing to remember then is that you need to make changes to the structure of your project (e.g. adding files) to the cmake CMakeLists.txt files.
Setting up cmake + Qt is pretty easy, and you only have to figure it out once. Googling around a bit should get this setup running in no time.

Qt Program deploy to multi platform, how?

Am new in Qt Programming and i would like to develop a program which i want to run in Windows, Linux(ubuntu), and Mac.
I heard that Qt support mutli-platform application development,
but my Question is that,
would any Qt library need to run these appilication in Ubuntu after i deployed or compiled?
If you deploy on Ubuntu, and therefore use a .deb package, then your job is easy since you just have to require qt as a dependency and apt will automatically install it as needed.
Windows and Mac however do not have any "good" software management layer, so you have no choice but include the required Qt DLLs with your binary or compile a static one. On Windows you just have to make sure the DLLs are in the same directory as your program. Mac however requires some relinking to be done. This is a big pain, but fortunately Qt comes with a tool named macdeployqt which does this for you.
So according to my experience, Linux is the easiest platform to deploy to, followed by Windows, and Mac is a good last.
The link to the Qt deployment doc given above is a good starting point. If you need an example, I have written a couple of scripts to build the Windows binaries of a program of mine. You can have a look at these to get started.
Windows installer:
http://gitorious.org/tagaini-jisho/tagaini-jisho/blobs/master/pack/win32-cross/buildwin32releases.sh
http://gitorious.org/tagaini-jisho/tagaini-jisho/blobs/master/pack/win32-cross/tagainijisho.nsi
Talking for the Linux side here, if you distribute your application as packages (deb, rpm) then you can use the package dependencies rules. If you define these rules correctly, then the package manager will install the Qt libraries you need when installing your application.