Jackr
Posts: 26
Joined: Sat Dec 08, 2018 10:48 pm

Qt

Sun Dec 09, 2018 3:04 am

If I got it right...
I can cross compile unsing another pc following this half-crazy procedure: wiki.qt.io/Raspberry_Pi_Beginners_Guide :?
Or I can compile qt, in just 45 hours, following this completely-crazy procedure wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi :shock:
Why there is no a package ? Can you do it please ? Thanks.

Heater
Posts: 13855
Joined: Tue Jul 17, 2012 3:02 pm

Re: Qt

Sun Dec 09, 2018 10:09 am

Qt 5 is in the current raspbian (stretch) release. No building from source required just apt-get install it from the package.
Memory in C++ is a leaky abstraction .

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Qt

Sun Dec 09, 2018 10:33 am

Code: Select all

sudo apt update
sudo apt install qt5-default

https://packages.debian.org/stretch/qt5-default
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

Jackr
Posts: 26
Joined: Sat Dec 08, 2018 10:48 pm

Re: Qt

Mon Dec 10, 2018 12:19 am

Oh ok, I got it to work, thanks!
Why googling that I only find tutorials like the ones I mentioned ? g00gl€ must be broken lol

Jackr
Posts: 26
Joined: Sat Dec 08, 2018 10:48 pm

Re: Qt

Mon Dec 10, 2018 12:22 am

Speaking about pro and cons...
Gtk should be faster and the libs are installed by default.
While Qt is easyer and more beauty.
Correct ?

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Qt

Mon Dec 10, 2018 12:33 am

Jackr wrote:
Mon Dec 10, 2018 12:19 am
Oh ok, I got it to work, thanks!
Why googling that I only find tutorials like the ones I mentioned ? g00gl€ must be broken lol

You should customise Google search to the last 6 months to save yourself from finding out of date information !
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
topguy
Posts: 5934
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt

Mon Dec 10, 2018 1:50 pm

Jackr wrote:
Mon Dec 10, 2018 12:19 am
Why googling that I only find tutorials like the ones I mentioned ?
The simple solution is usually so simple that no one really needs to write a long guide for it, you install Qt5 the same way you install all other software.
If you want a newer Qt5 version than the one in repository, or if you want to compile in OpenGLES support then you need those other guides.

Jackr
Posts: 26
Joined: Sat Dec 08, 2018 10:48 pm

Re: Qt

Mon Dec 10, 2018 8:54 pm

Jackr wrote:
Mon Dec 10, 2018 12:22 am
Speaking about pro and cons...
Gtk should be faster and the libs are installed by default.
While Qt is easyer and more beauty.
Correct ?
And is it true that the Qt UI uses gtk ?

User avatar
ksharindam
Posts: 140
Joined: Sat Jan 09, 2016 4:16 pm

Re: Qt

Tue Dec 11, 2018 7:30 pm

Jackr wrote:
Mon Dec 10, 2018 8:54 pm
And is it true that the Qt UI uses gtk ?
No, Qt does not use gtk, it has its own gui libraries. But in some cases it uses native dialog, such as it can open gtk dialog on a raspbian system.
Jackr wrote:
Mon Dec 10, 2018 12:22 am
Speaking about pro and cons...
Gtk should be faster and the libs are installed by default.
While Qt is easyer and more beauty.
Correct ?
In gtk and qt are almost same in case of speed and resource usage.

Jackr
Posts: 26
Joined: Sat Dec 08, 2018 10:48 pm

Re: Qt

Tue Dec 11, 2018 9:36 pm

ksharindam wrote:
Tue Dec 11, 2018 7:30 pm
Thanks! More opinions ?

User avatar
ksharindam
Posts: 140
Joined: Sat Jan 09, 2016 4:16 pm

Re: Qt

Wed Dec 12, 2018 4:12 pm

If you are choosing a Gui library, Qt will be great.
For a beginner , gtk is easier to learn than qt.
But after you learn how to implement signal and slots, and subclass a QObject, everything will be easier with qt.

When i started to learn gtk, i tried to create a simple drawing app, and failed to draw over a pixmap using cairo.
But then i switched to qt, and everything became easier with QPainter.

Also, there are some convenient classes, which helps a lot.

Till now, i have made a browser, a pdf viewer, a paint app, a printing app, raspberry pi configuration editor, calculator, markdown editor, image files to pdf converter using either c++ qt or PyQt.

code_exec
Posts: 273
Joined: Sun Sep 30, 2018 12:25 pm

Re: Qt

Wed Dec 12, 2018 9:39 pm

ksharindam wrote:
Wed Dec 12, 2018 4:12 pm
If you are choosing a Gui library, Qt will be great.
For a beginner , gtk is easier to learn than qt.
But after you learn how to implement signal and slots, and subclass a QObject, everything will be easier with qt.

When i started to learn gtk, i tried to create a simple drawing app, and failed to draw over a pixmap using cairo.
But then i switched to qt, and everything became easier with QPainter.

Also, there are some convenient classes, which helps a lot.

Till now, i have made a browser, a pdf viewer, a paint app, a printing app, raspberry pi configuration editor, calculator, markdown editor, image files to pdf converter using either c++ qt or PyQt.
QT has a GUI designer which allows you to drag and drop widgets into a virtual Window (also known as a Form). You can convert the UI file to a Python script, allowing you to integrate the window into your Python programs.
Ubuntu 18.04 LTS desktop images for the Raspberry Pi 3.

https://github.com/CodeExecution/Ubuntu-ARM64-RPi

User avatar
AdamStanislav
Posts: 147
Joined: Sun Mar 10, 2019 2:44 am
Location: Wisconsin
Contact: YouTube

Re: Qt

Thu Mar 14, 2019 2:02 am

fruitoftheloom wrote:
Sun Dec 09, 2018 10:33 am

Code: Select all

sudo apt update
sudo apt install qt5-default

https://packages.debian.org/stretch/qt5-default
Hello, I have found this thread and did the install as suggested. What surprised me that it does not show up in the GUI menu under Programming or anywhere else.

So, how do I start it? And how do I add it to the menu?

salvato
Posts: 75
Joined: Tue Jan 15, 2013 9:21 pm

Re: Qt

Thu Mar 14, 2019 5:33 am

Code: Select all

sudo apt install qtcreator
G.S.

DirkS
Posts: 10006
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Qt

Thu Mar 14, 2019 9:30 am

salvato wrote:
Thu Mar 14, 2019 5:33 am

Code: Select all

sudo apt install qtcreator
G.S.
Gepruefte Sicherheit https://en.wikipedia.org/wiki/Gepr%C3%BCfte_Sicherheit ?

User avatar
topguy
Posts: 5934
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Qt

Thu Mar 14, 2019 10:55 am

AdamStanislav wrote:
Thu Mar 14, 2019 2:02 am
So, how do I start it? And how do I add it to the menu?
To be precise, Qt is just a library used by other applications or used by developers. So it doesnt really come with anything you can "start" from a menu.
QtCreator is a tool for developers and very useful for developing with Qt but its an optional install that you have to install separately.

salvato
Posts: 75
Joined: Tue Jan 15, 2013 9:21 pm

Re: Qt

Thu Mar 14, 2019 11:56 am

DirkS wrote:
Thu Mar 14, 2019 9:30 am
salvato wrote:
Thu Mar 14, 2019 5:33 am

Code: Select all

sudo apt install qtcreator
G.S.
Gepruefte Sicherheit https://en.wikipedia.org/wiki/Gepr%C3%BCfte_Sicherheit ?
No ! just my initials...

DirkS
Posts: 10006
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Qt

Thu Mar 14, 2019 12:47 pm

salvato wrote:
Thu Mar 14, 2019 11:56 am
DirkS wrote:
Thu Mar 14, 2019 9:30 am
salvato wrote:
Thu Mar 14, 2019 5:33 am

Code: Select all

sudo apt install qtcreator
G.S.
Gepruefte Sicherheit https://en.wikipedia.org/wiki/Gepr%C3%BCfte_Sicherheit ?
No ! just my initials...
I would suggest that in future you make it clear what exactly you are responding to and what it is supposed to do...
Right now it adds very little (if anything) to this topic.

User avatar
AdamStanislav
Posts: 147
Joined: Sun Mar 10, 2019 2:44 am
Location: Wisconsin
Contact: YouTube

Re: Qt

Thu Mar 14, 2019 4:48 pm

topguy wrote:
Thu Mar 14, 2019 10:55 am
QtCreator is a tool for developers and very useful for developing with Qt but its an optional install that you have to install separately.
Thank you very much. I have just started installing it and it is installing the full package, which is precisely what I was looking for. So, just for anyone else who might be interested in installing the whole thing, I just typed

Code: Select all

sudo apt-get install qtcreator
and that started the install process. So, again, thank you very much :D

User avatar
AdamStanislav
Posts: 147
Joined: Sun Mar 10, 2019 2:44 am
Location: Wisconsin
Contact: YouTube

Re: Qt

Thu Mar 14, 2019 6:33 pm

Well, I got it installed, sadly my RPi 3B+ is not powerful enough for it. It loads but if I try such a simple thing as enlarging it, it crashes instantly.

I’ll have to try develop something on Windows than try to compile it on the Pi and see what happens.

Thanks to both of you who replied.

Heater
Posts: 13855
Joined: Tue Jul 17, 2012 3:02 pm

Re: Qt

Fri Mar 15, 2019 12:45 am

Some people like to develop Pi code on the Pi itself. Some people like to develop on the PC and cross-compile for the Pi. With Qt there is a third option:

Using qtcreator you can develop your program on a PC or Mac using whatever OS you have there. Get it working and tested as a Windows or whatever application. When it is in good shape copy the source code to your Pi and build it there using the qt command line tools:

Code: Select all

$ cd myProject
$ qmake -o Makefile myProject.pro
$ make
That is fine for the GUI stuff, file handling, networking, threading etc but if you program makes use of Pi specific features, GPIO, PWM, etc, that are not available on the PC you have a problem.

The solution to that is to create "mock" classes/functions that simulate the Pi features. These enable building and testing of your Qt program on the PC.

Meanwhile the real versions of those classes/functions can be developed and tested on the Pi itself without using qtcreator or even any qt at all.
Last edited by Heater on Fri Mar 15, 2019 2:07 am, edited 1 time in total.
Memory in C++ is a leaky abstraction .

User avatar
AdamStanislav
Posts: 147
Joined: Sun Mar 10, 2019 2:44 am
Location: Wisconsin
Contact: YouTube

Re: Qt

Fri Mar 15, 2019 1:22 am

Thanks, Heater. :D

salvato
Posts: 75
Joined: Tue Jan 15, 2013 9:21 pm

Re: Qt

Fri Mar 15, 2019 9:47 am

AdamStanislav wrote:
Thu Mar 14, 2019 6:33 pm
Well, I got it installed, sadly my RPi 3B+ is not powerful enough for it. It loads but if I try such a simple thing as enlarging it, it crashes instantly.
This is a bit strange. I use every day qtcreator on my Raspberry 3B (not plus) and it works very well.
Is the free space in your SD card big enough ? Is your OS updated ? Is the space reserved to the GPU leaving enough space to other programs ? (I use 128M on mine)

User avatar
AdamStanislav
Posts: 147
Joined: Sun Mar 10, 2019 2:44 am
Location: Wisconsin
Contact: YouTube

Re: Qt

Fri Mar 15, 2019 4:56 pm

Yes, my OS is updated/upgraded daily, and this should be enough SD space:

Code: Select all

Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/root      ext4       30G  5.9G   23G  21% /
devtmpfs       devtmpfs  460M     0  460M   0% /dev
tmpfs          tmpfs     464M     0  464M   0% /dev/shm
tmpfs          tmpfs     464M   13M  452M   3% /run
tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs     464M     0  464M   0% /sys/fs/cgroup
/dev/mmcblk0p1 vfat       44M   22M   22M  51% /boot
tmpfs          tmpfs      93M     0   93M   0% /run/user/1000
As for the GPU, it is at whatever default there is. I have never changed because I have no idea whether I need to or how to do it.

But it’s OK, I suppose, because last night I discovered http://gnutoolchains.com/raspberry/ and installed it on my Windows computer, so I should now be able to develop with Qt on my Windows computer for the RPi.

Return to “Graphics programming”