0

Currently i am trying create a qt5 application on yocto using qtwayland. I used the core-image-minimal and added wayland, weston, qtwayland, qtbase plugins etc. I have added ~/Apps/Wayland/wayland.sourceme and set up weston.ini.

Right now i can start weston and enter the weston desktop, open terminal and run my helloworld app just fine. but when i kill weston or reboot the system to get back to terminal as root. I run my app by doing

source ~/App/Wayland/wayland.sourceme
~/helloworld -platform wayland

and i get Failed to create display (no such file or directory)

even doing export DISPLAY=:0.0 does not work either.

i also followed https://wiki.qt.io/QtWayland too with no luck. how can i run my app using -platform wayland or any of the other platforms.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
Bbbh
  • 321
  • 7
  • 20
  • I don't understand, you want a wayland client to run without a wayland server running? What behavior do you expect exactly? – PatJ Apr 14 '15 at 19:24
  • correct me if im wrong but the qt5 doesnt need a wayland server. from all the tutorials i've read just shows adding -platform wayland or wayland-egls etc. will run the application in full screen – Bbbh Apr 15 '15 at 13:14
  • I tried looking for that and found nothing. Where did you find that? From the link you provided, you can create a compositor but you need it running before launching your client. – PatJ Apr 15 '15 at 13:43
  • theres other boards that omit the wayland package and just use qtwayland such as http://wiki.wandboard.org/index.php/Building_Qt5_using_yocto_on_Wandboard im going to try to build that with yocto for x86 and hope that works. i know what you mean as there needs to be a display server. such as what i have now is int /etc/init.d/myapp i have inside that xorg & and then myapp & and it starts my app full screen. im trying to do the same with wayland – Bbbh Apr 15 '15 at 21:05

2 Answers2

3

You are trying to run a Qt Application using a wayland platform plugin. Which makes your qt application run as a wayland client.

Now for the wayland client to run there should be a wayland compositor running.

Now there are two ways in which you can do this,

  1. Run a wayland compositor (weston) before running your Qt Application.
  2. Compile qml-compositor and run it before running your Qt Application.

In both cases you have to have a compositor running if you want your application to run as a wayland client.

If you just want to run your application in fullscreen and nothing else, you can also use eglfs platform plugin and not use wayland altogether.

Sami
  • 155
  • 3
  • both all options produce the same thing that a display is not found. i followed the tutorial on ubuntu 14.04. i can not get qml-compositor to run by itself. – Bbbh Jun 04 '15 at 13:11
  • 1
    it turns out /dev/fb0 wasn't tired to anything. i was testing with fbi and even that wasn't displaying anything to the screen. i am not sure what i installed but when i got fbi working qtwayland started working too – Bbbh Jun 09 '15 at 15:42
  • @Bbbh Could you be a bit more speciffic? What exactly did you do to solve this? – 71GA Jan 12 '22 at 13:10
1

From the Qt Wiki:

Run Qt applications as Wayland clients

When you build the QtWayland module, you should get a new platform plugin for wayland. To use it you must first already have a Wayland compositor running.

If you don't want to use an external compositor, follow the instructions in the "Create and Run your own Wayland Compositor with Qt5". For example you could run the QmlCompositor:

source ~/Apps/Wayland/wayland.sourceme
cd qtwayland/examples/qml-compositor
./qml-compositor -platform xcb
Community
  • 1
  • 1
HappyCactus
  • 1,935
  • 16
  • 24