Codeblocks and Qt -- how to work with them? - c++

I am new to codeblocks and Qt. I would like to create some nice interfaces with buttons, lists, combo box and so on using Qt. Can someone help me, give me some links from where I can start my journey? I didn't find anywhere how to include qt designer in codeblocks in order to work with it.
Any help is appreciated.
P.S I am working in Ubuntu. I did install code::blocks 10.05 . I also have QT Designer, Creator, LInguist and Assistent.

When you have Qt Creator, you don't need anything else unless you have any specific preference for Code::Blocks or any other IDEs.
Qt Creator has an integrated debugging interface too (somewhat similar to Visual Studio).
Here is the Qt Creator manual and here you can find details on How to manage projects using Qt Creator.

If you already have all the Qt tools (Creator, Designer, etc.) then why not just use Qt Creator?
It is a wonderful little IDE and is perfect for Qt developing. I actually prefer using it on Ubuntu (on Windows I use the VS Add-In for VS 2010).
The only thing that takes getting used to is adding dependencies which you must directly edit the .pro file for. See http://doc.qt.io/qt-5/qmake-project-files.html

Related

Can't get QT to work in Visual Studio 2019 and what is the best place to learn QT?

So I do know C++ fairly well, I have used it and C for the past year in college. I'm trying to make an application with a GUI that needs a simple input box and easily customizable windows. The main focus of the project however is a lot of backend processing, I just need a GUI for the user. Is there a place where I can just learn the quick basics of QT? Also for some reason I can't get QT to work on Visual Studio 2019.
I get this error:
When I go to input the version, it doesn't actually save when I click OK.
In Manutention Tool you should download these Qt components marked as MSVC or UWP:
A MinGW build of Qt will probably work only with CLion and Qt Creator
And don't download the latest Qt, because VS doesn't work well with them.

How to integrate Qt in Eclipse

I install latest version of Eclipse IDE for C/C++ Developers.
I want to integrate Qt in Eclipse IDE.
How I can do that.I do not have QT install on my PC.
Thanks in advance.
I can't say how well it works, but there's a guide on the Qt Wiki: https://wiki.qt.io/Install_Eclipse_on_Linux
I'd personally say that Qt Creator is a lot better than Eclipse when it comes to building Qt applications, especially if you want to do anything with Designer files.

Qt Designer in Windows along with Qt Creator

In Linux, I had got Qt Designer installed along with Qt Creator. I had installed Qt Creator in Windows, but I am not able to find the Qt Designer anywhere. Also, I cannot build Qt applications using Qt Creator. I would like to know whether I need to install Qt SDK in windows to get Qt Designer.
Just get the full bundle:
http://download.qt-project.org/official_releases/qt/5.0/5.0.2/qt-windows-opensource-5.0.2-mingw47_32-x86-offline.exe
For what I remember, QtCreator includes the designer somehow, and it is a cool program to use!
Qt-Designer is part of the "PyQt4"-Package for Windows.

Creating GUIs for application

This is a question I've been wondering about for a long time.
How do you create an Interface for your program ?
It seems to much of a pain to position form controls and buttons using just code.
I'm looking for something similar to Visual Basic where you can drag and drop controls onto the window. But, I want to do this for applications written in C++.
Can It be done with compilers like MinGW on Eclipse ?
If you don't want to go the Qt route you can use ResEdit which is freeware. It will produce Win32 friendly .rc files that can be built with the MinGW resource compiler and used in Win32 applications.
There are some C++ Win32 wrapper libraries available though I'm not aware of any that are nearly as mature as Qt. I believe WinxGui is a port of WTL (or at least claims to be compatible with WTL) for GCC. It doesn't look like there has been much activity on the project site for a few years however.
What you're searching for is called Qt, both Eclipse and MinGW friendly.
Check out this nice article.
Qt toolkit is written in C++. So you can use it to develop GUI. It also comes with Qt Designer and Qt Creator IDE and tools.
Qt Reference Documentation
Qt Designer Manual
Qt Creator IDE and tools
And you can use MinGW to compile the code. You don't need to download MInGW separately. When installing Qt toolkik, it asks if you want to download MInGW also, just say yes to it. It will then download the correct version of MInGW itself.
The 1.7 GB download you look at is probably the full Qt SDK. This is not just Qt and documentation, but also includes the Qt Creator IDE with the Qt Designer "Form builder", the MinGW compiler, debugger, examples, demos, and some other stuff. There's also an "online installer" that allows you to select the packages you want before downloading everything. That's probably what I'd use if I were starting from scratch on Windows.

How to work with OpenGL and QT?

I'm Working on a small project and i need to work with OpenGL + QT
I'm Newbie in both of them. So i need a good tutorial that illustrates how to work with them each other not individually
is it better to work OpenGL on QT Creator or use QT Visual Studio Plug-in?
You'll be using QGLWidget a lot! Here you go:
http://doc.qt.io/qt-5/examples-widgets-opengl.html
Of all those, maybe this is the best one to start: Hello GL Example. If you prefer using Qt Quick instead of Qt Widgets, check these posts:
Integrating custom OpenGL rendering with Qt Quick via QQuickFramebufferObject
Scene Graph - OpenGL Under QML
If you want a higher-level 3D API than OpenGL, as o Qt 5.7 Qt 3D became stable.
As for the IDE I suggest using Qt Creator. It works out of the box on Windows and the syntax highlighting and autocomplete are comparable to Visual Studio.
You have several different options for using OpenGL in Qt. It has changed a lot over the years. For an introduction that should cover all the basic info you need to start look at this post. The old style Qt OpenGL classes and functions were called QGLxx but are now called QOpenGLxx and have been moved to the QtGUI module to start with.
Many of the simple OpenGL examples with Qt (including the QOpenGLWindow example shipped with Qt) use the old style of OpenGL that shouldn't be used any longer. Here is a tutorial that has updated the QOpenGLWindow example to modern OpenGL (3+). It is the simplest, most up to date example I have come across.
I second Qt Creator, especially for learning. It has much better integration with the Qt help files than Visual Studio does. If you are considering switching between IDEs I would also recommend building with CMake. CMake is very similar to the built in qmake of Qt Creator but it can work just as good with Visual Studio or other IDEs. I have been running some examples for learning purposes in both Visual Studio and Qt Creator with CMake. Here is a simple CMake example with Qt. For my purposes I still use the Visual Studio compiler when working in Qt Creator though.
There're some examples of how to use Open GL with QT in the SDK. You can open these examples in QT Creator if you want. To answer the second question, I find QT Creator much faster and more pleasant to use than Visual Studio but YMMV.