Creating an application using XCB



  • Hello to everybody,
    I'm new here and I'm srongly searching for a solution for my problem:
    I would like to write a simple GUI application using XCB.
    Has anybody a small example where I can learn from or is there a group in this forum where I can find more?
    Thanks a lot in advance!
    Kurt


  • Moderators

    @K-Str How is your question related to Qt?
    You should start here: https://xcb.freedesktop.org/


  • Qt Champions 2017



  • Hello jsulm,
    I would like tocreate a QT project using the QT Creator whizzard. This means:

      1. creating a project (e.g QT Widgets) application.
      1. designing a window using the Forms wizzard.

    then I create the programm, compile and link it. at least Starting the programm on the Raspberry and everything is fine ;-)
    Do you think this is possible? Or must I write an application line by line using an editor?
    Hello mrjj,
    Tanks for this hint. Buuut....
    How can I make this by using QT Crator?
    Kurt


  • Qt Champions 2017

    @K-Str
    That is very possible with Qt but why you talk about XCB then?
    http://doc.qt.io/qt-5/gettingstartedqt.html

    you cannot make XCB windows in Qt Designer :)
    well you could draw them, then create an app that can take the gui files and create XCB calls from it.

    Why not just get this
    http://www.qtrpi.com/home

    and use Qt directly on the pi?
    (and forget about XCB)



  • @mrjj
    I use a Raspberry and a 3.2" display having a SPI interface. But Standard QT is having a HDMI interface. Thats my problem.



  • Hi Kurt,

    you don´t write a special application for XCB. You can use the xcb platform plugin to run a normal QWidget application under x11.

    ./myProg --platform xcb
    

    see http://doc.qt.io/qt-5/embedded-linux.html#xcb



  • Hi sneubert,
    thanks for your answer.
    Sorry but I do not understand.
    I'm not really familiar with QT. But I think xcb is already installed.

    • There is a directory : \SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\include
    • and a QT Project Include file : qt_lib_xcb_qpa_lib_private.pri

    can I use this pri file?
    Where must I insert ./myProg --platform xcb.


  • Moderators

    @K-Str If you write a Qt application you usually don't care whether it uses XCB, win32 API, frame buffer or what ever. This is handled for you by Qt. This is one of the reasons why Qt exists. You just need to use the correct platform plug-in as @sneubert said, please check the link he provided. No need to use XCB directly.
    "But Standard QT is having a HDMI interface" - Qt does not have such interfaces. Is X11 running on your Raspberry Pi and if so is it running on this SPI display? If it does then your Qt app should work there.



  • Hello to all,
    thanks a lot for your hints.
    sneubert recommended to use the following command to run it:
    ./applicationName --platform linuxfb:fb=/dev/fb1
    This works fine.
    Thanks.
    Kurt


Log in to reply
 

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