Qt Program start on bootup and start GUI interaction automatically



  • hello,
    I have two questions.

    1. how to to start my Qt program on startup of my Raspberry pi? (don't want to see the boot process.)
    2. how to start Gui interaction as soon as gui is innitiated?(Dont want to use buttons)

    my work involve, raspberry pi which communicate with stm32 controler by SPI protocol
    raspberry is master and stm32 is slave. slave collect data from differnt sensors and give it back to raspberry and ii is shown on GUI on a button click .
    As said above i want to start this program when raspberry is powered on, after GUI start i should get readings on screen no external signal like Gui button clicked that i am using now and i am writing code in mainwindow and not in QApplication.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can't start an application before the boot process is done. You might be able to hide some stuff with some sort of splash screen but that's all.

    After that, you have to setup whatever tool is used for handling the various services start/stop and include your application there.



  • @SGaist
    what about second question? this is the same query as i have.
    one of my dialogs is displaying data collected on a button pressed event. i want that dialog to start collecting data as soon as it is executed.


  • Qt Champions 2018

    @Andrex_Qt The second question was answered as well. This is completely unrelated to Qt and depends on your Linux distribution and desktop environment/window manager you're using. So, you will need to provide more details to get an answer. Or, which is better, you ask the Linux distribution community.



  • @jsulm
    ok i am not able to understand Answer to second question. Details about my work as follows:
    for now only includes 1 window the MainWindow
    i use C API for SPI communication and files bcm2835.c and bcm2835.h
    i have written Spi initialization code block in constructor of MainWindow.
    SPI data transfer function is written in button_clicked() private slot.
    so you get data when you press button.
    I want to not use button.
    As soon as MainWindow GUI appears I should start SPI data transfer.
    Is there a way?


  • Qt Champions 2018

    @vishbynature said in Qt Program start on bootup and start GUI interaction automatically:

    As soon as MainWindow GUI appears I should start SPI data transfer.

    Sure. You can use QTimer to trigger the transfer.



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