Completely new and completely lost...



  • Hello!

    As the title says, I'm completely new to QT and I'm completely lost.

    I started with old VB and recently developed some Win Desktop Apps with Visual Studio using C#. I'm happy with the .NET but now I need to develop an app for the Raspberry Pi 2.

    I tried to do this as a Universal Windows app using VS2015 and run the app on Windows 10 IoT on the RPi. In general this is quite easy and works fine, but to me it seems as if the Universal Windows Framework is still in its infancy. E.g. it seems not to be possible to simply flush the serial port's input buffer, so I looked for another system and got pointed to QT.

    So here I am but completely lost and I hope you could help me answering my first basic questions rolleyes

    1. I have choosen the qt-opensource-windows-x86-mingw492-5.5.1 pack. Is this the right basis for what I intend to do (develop an UI app for the RPi2)?

    2. How can my (future) app run on the RPi? Will it run on Raspian using some QT dlls deployed with the app or will it require a complete QT framework on the RPi?

    3. Can I develop a QT Widgets app (using C++) or will I have to do a QT Quick app (using (also) QML as far as I understood?) since RPi is some kind of embedded device? I'm just fighting to get into C++ and like to avoid learning an addidional 'language' right now...

    4. How can I compile my app on my Windows machine to run it on the RPi and how to deploy it onto the RPi?

    5. Is it a reasonable attempt to try to do a kind of MDI app commiunicating via serial port, probably requiring some kind of multi-threading or asyncronous mechanism, with QT within about 3 months (only 1..2 days a week time for it) as a QT and C++ newbie?

    I hope you can help me with some answers...

    Thank you very much!!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Something's not clear: are you planning to use Win10 or Linux on the RPi2 ?

    In the second case, I'd recommend using a virtual machine with Linux installed to handle cross-compliation and development. It will really make your life easier.
    On the other hand, the RPI2 is powerful enough so that that you can develop directly on it.

    1. No, the pre-built package for windows and except the WinRT are for developing desktop applications.
    2. It depends on how you are going to setup your system. But no, you don't need to have the complete framework installed.
    3. Yes you can, nothing forces you to use QML (depending on your application, you should still keep it as an option)
    4. It's doable, but it's really not the easiest way. There are some guides to cross-compile from Windows to Linux for the RPi but you really should consider the virtual machine alternative to make your life easier.
    5. Depends on the size of the application and what it should do but it's likely going to be tight given the starting constraints.

    On a side note, it's Qt, QT stands for Apple QuickTime which you might also be interested in.



  • Hi SGaist,

    thank you so much for responding that fast and thx for the welcome!!

    As you suggested I intend to run some Linux on the RPi. I already installed VirtualBox on the PC and tried Ubuntu with that, but it's running ugly slow (I have 12GB RAM but only a Pentium 2020M @2.4GHz - perhaps the processor is quite weak or I set something wrong). But I will follow your recommendations :-)

    -> Which Linux should I install (on PC / Virtual Machine and/or on the RPi if I would go to develope there) and which Qt pack (sry, I'm really lacking in understanding the differences)?

    Within the 3 months time frame the app might be quite rudimentary. But the basic structure should already implement a queued communication working in some kind of asynchronous way on requests of independent sources (programm/user) and a solid mechanism handling the switching between different screens. I already realized the app under .NET in C# and I 'only' have to port it, but as you said - regarding the starting constraints im not really too confident ;-)

    Thx also for the hint regarding the lower case t!

    greetings!


  • Lifetime Qt Champion

    Raspbian for the Pi should work well.

    Double check the RAM allocated to the virtual machine as well as the graphics card properties.

    For quick installs, I usually go with Kubuntu because I like KDE as desktop environment but Ubuntu would work the same. That's rather a matter of your own taste.

    Get the latest available (5.5.1 currently with 5.6.0 in the not too distant future) and cross-compile the matching sources for your device that way you ensure that if you have a bug you're hunting it on the same base between your desktop and device.

    Asynchronous => Qt's signals and slots mechanism. Depending on what you need to do, you might even not use threads. What switching are you referring to ? Based on your use case, you have QWizard, QTabWidget, QStackedWidget etc. For the serial port part, you have QSerialPort.



  • oh fu.. I'm afraid I have to go deeper into the documentation first - I have no idea how to cross-compile Qt for K/ubuntu. But at least I think I saw some tutorials on how to do this...

    -> Perhaps you have a link for me to where it is described how to do it and a link to the pack I need?!

    I think the asynchronous approach is a little different from the signals and slots mechanism. As far as I understood, a slot is some kind of an event procedure which gets called (by a signal) e.g. when the communication request got responded and evaluated.

    The asynchronous e.g. communication works that way, that the requesting procedure/function/method just starts the communication thread and then returns to its calling process. When the communication process is finished (= the asynchonous call returns), the previously calling procedure continues and does the according with the communication result.

    A slot would not know, which procedure/function did request the communication, so it does not know what it might do with the result.

    For sure there are ways to handle this, but the asynchonous approach makes things much easier. I think I read that it is possible with Qt also.

    The 'switching' means only to change between different forms/widgets/screens (however you might call it). But different things need to be done whenever a screen gets shown or closed/hidden... probably something like a show or hide event procedure / slot, but for certain reasons I required to control it 'from outside', perhaps I will develop a different concept to simplify this...

    With the VM I allocated 2 or 3 GB RAM for the Ubuntu, but perhaps the 12MB of display memory (which is also RAM with the VBox) might be too small?


  • Lifetime Qt Champion

    Depending on your budget you also have the Boot2Qt option

    This guide here provides a nicely detailed explanation about how to setup things for cross-compilation.

    Then first thing you should do is implement the core logic so that it works the way you want it. Then build the GUI on top of it.



  • Thank you very much again!

    In the meanwhile I got VM-Ubuntu-Qt running well on the PC. I will also set up Qt on the RPi for development soon and have a try how it performs.

    The three months target got canceled so I can get calmer :-)

    I'm sure I will come up with other questions later but for now I'm happy.

    Thank you very much again for your great help!


  • Lifetime Qt Champion

    You're welcome !

    Don't hesitate to ask them in separated threads (don't forget to search the forum though, there are already a lot of questions related to the RPi) :)

    If you're not lost anymore, please mark the thread as solved using the "Topic Tool" button so that other forum uses may know a solution has been found :)



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.