Qt on the Pi?

Feb 17, 2018 25 Replies

I just discovered that the Qt development system seems to be in Raspbian by default. I've never delved much into Qt but it seems like a good area to explore -- especially as there might be apps using it in the new Gemini PDA (Debian Linux).



Has anybody here played with it, as I seem to be having difficulty with the basics... (:-/) (My Pi is a few years old now, but it chugs away doing useful stuff, so I haven't updated yet. I assume newer Raspians have similar features.)



I fired up QtCreator, and -- with some hassles setting up a configuration that worked -- created the default "Hello World" project, built it and was able to run it.. from QtCreator. There is an apparent executable generated, but if I try to run that (from a Terminal) nothing happens! No errors, it just returns. As most of the point of Qt is to build stand-alone apps, I'm a bit lost!



Pointers from anyone who's been there would be appreciated.



-- Pete --


Huh, I did what I should have done before I posted (:-)) and ran a web search. Sadly I'm now slightly more confused!

As I said, the Qt dev package *came* with my Raspian. I can't remember the code name, but the date seems to be Aug 2015. I also forgot to mention that this is Qt4, not 5. All the posts on the web I've been able to find either talk about having to apt-get the package or even more often about cross-compiling from Ubuntu or somewhere.

One post did give me the instructions I needed to keep it from itself wanting to cross-compile to a (non-existent) remote device, but my problem of not being able to run the result stand-alone is unchanged.

-- Pete --

I use QtCreator on the Pi as a general IDE, and build non-Qt projects. For a command line hello world, you first need to set up a compiler kit based on your installed version of gcc. I use an existing makefile to build, but you can also use cmake.

---druck

AAARGH! I've just realized what I was doing! I'm more used to another OS (Haiku), where the current directory is first in the path. so I was just typing "test". Being as that is a command of its own, it's not surprising it was just returning true! Tried "./test" and of course it works fine. Lesson: if you can't remember the "./", don't use generic names for your programs!

Glad that someone is using the app successfully. It definitely was confusing to set up, because the intro docs don't seem to mention what one might need to do, but once I figured that out it seems to work well.

Thanks,

-- Pete --

Just a reminder: Never create a program with the name 'test' in Unixish operating systems.

-TV

My test programs are usually called tea - so that I can type:

make tea

-- Steve O'Hara-Smith | Directable Mirror Arrays C:\>WIN | A better way to focus the sun The computer obeys and wins. | licences available see You lose and Bill collects. |

formatting link

Ahh. Now there's a tip I must remember! (:-))

-- Pete --

Mione will be called 'pandemonium' from now on...

The biggest threat to humanity comes from socialism, which has utterly diverted our attention away from what really matters to our existential survival, to indulging in navel gazing and faux moral investigations into what the world ought to be, whilst we fail utterly to deal with what it actually is.

To: The Natural Philosopher Re: Re: Qt on the Pi? By: The Natural Philosopher to comp.sys.raspberry-pi on Mon Feb 19 2018 10:45 am

Indeed. I like this.

Mick

--- Synchronet 3.17a-Linux NewsLink 1.108 Central Ontario Remote BBS - oxfordmi.synchro.net

I'd have thought it should be called 'love\ not\ war' for obvious reasons.

Calling something test on a Unixy machine is a learning stage we must all pass through. I have a colleague who re-performs this learning stage several times a year where once is good enough for most people!

For all things, variables, lables, subroutines, where one can easily and inadvertantly hit on a reserved word, I prefer German. So instead of test I'd proably use versuch. Nobody can remember all reserved names, at least I can't. Unfortunately in this case Test has become quite common in German too, so not even that's safe. But what is?

/ \ Mail | -- No unannounced, large, binary attachments, please! --

I call things foo, bar, baz...

/~\ cgibbs@kltpzyxm.invalid (Charlie Gibbs) \ / I'm really at ac.dekanfrus if you read it the right way. X Top-posted messages will probably be ignored. See RFC1855. / \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!

It's not a case of remembering all the reserved words but a case of remembering how to diagnose the problem based on once having used a reserved word. Although in my colleague's case just remembering test is bad would be good.

I seem to have run into a more serious hangup -- and I don't think it's my stupidity this time!

My main interest in using qtcreator was for the Design Mode, so I wouldn't have to (initially) know all the QML objects and parameters to build a UI.

Unfortunately, as soon as I click on the "Design" selector, qtcreator just freezes. I've tried waiting a while, but it's just locked, and has to be killed.

Has anyone found any different? (As I mentioned, qtcreator came with my Raspbian, so maybe a fresher installation might work?)

Thanks,

-- Pete --

Bollox. I am always happy to write bollox.

"When one man dies it's a tragedy. When thousands die it's statistics." Josef Stalin

Thoroughly handy except when your code needs debugging by someone who doesn't speak it.

"When one man dies it's a tragedy. When thousands die it's statistics." Josef Stalin

Alternatively, take a good look at the sort of names the language uses for verbs, programming structures and built-in variables, e.g. C tends to use names that do not include digits or underscores, so when writing in it using names like x_int are unlikely to clash with language elements. Or, better yet, use named that tie in to what your program does: don't use 'switch' or 'switch2' if you're setting or reading switches, use 'button', 'lightswitch' or 'door_sensor' instead because that also makes the program easier to understand.

Martin | martin at Gregorie | gregorie dot org

That always helps. When was the last time you updated Raspbian and any additional packages you installed?

I hate the Windowsian trick of springing unexpected updates at awkward moments, so have disabled those on all my Linux boxes and manually trigger weekly backups followed immediately by system upgrades. Other OSes? I don't use 'em apart from a WinCE PDA, which gets updates as needed.

Martin | martin at Gregorie | gregorie dot org

Just use a editor that colors the syntax. Reserved words have always differ ent colors respect variables, functions, etc. so they are eays to spot.

Bye Jack

This is the best way, for best results decide on all the names for things up front and stick to them rigidly in variable names, messages and documentation. Two things happen when you do this, you get consistency which is very nice and you tend to find a bunch of important details while you're doing the naming of names because it forces you to examine everything carefully.

Steve O'Hara-Smith | Directable Mirror Arrays C:\>WIN | A better way to focus the sun The computer obeys and wins. | licences available see You lose and Bill collects. | http://www.sohara.org/

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required