Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 Project on Raspberry Pi 5 Bookworm
Forum Updated to NodeBB v4.3 + New Features

Qt5 Project on Raspberry Pi 5 Bookworm

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nahumb
    wrote on 22 Sept 2024, 16:26 last edited by
    #1

    Hi,

    I’m developing a Qt based project for raspberry pi5 Bookworm using VisualGDB (VS Community 2022) running on a Win11 PC and deploying the executable on the Raspi5.

    It all works perfect, however, I get different results when I remotely running the application as a debug session from VS and when I directly run the executable on the Raspi5.

    The major differences are:

    Coloring of some widgets are the same and as required, but other may slightly differ, or are completely different, such as the QPushButton background color, that may individually be set for each button when running as VS debug session, but when executing the application directly on the Raspi5, all buttons background color is White.

    Coloring is done by setting each widget styleSheet property using the Qt Designer application.

    As part of the application, the in-focus widget may be programably selected, bringing each widget at atime to focus on top. The last in-focus location of each widget is also maintained.
    This all works fine when running as a VS remote debug session, however, when running the executable on the Raspi5, the in focus selection works, however, the widget locations always goes back to the original widget location at creation.

    Can anyone provide an explanation to the above and if are there any ways to get it work the same in both scenarios?

    Thanks,

    Nahum Budin.

    A 1 Reply Last reply 22 Sept 2024, 17:50
    0
    • N nahumb
      22 Sept 2024, 16:26

      Hi,

      I’m developing a Qt based project for raspberry pi5 Bookworm using VisualGDB (VS Community 2022) running on a Win11 PC and deploying the executable on the Raspi5.

      It all works perfect, however, I get different results when I remotely running the application as a debug session from VS and when I directly run the executable on the Raspi5.

      The major differences are:

      Coloring of some widgets are the same and as required, but other may slightly differ, or are completely different, such as the QPushButton background color, that may individually be set for each button when running as VS debug session, but when executing the application directly on the Raspi5, all buttons background color is White.

      Coloring is done by setting each widget styleSheet property using the Qt Designer application.

      As part of the application, the in-focus widget may be programably selected, bringing each widget at atime to focus on top. The last in-focus location of each widget is also maintained.
      This all works fine when running as a VS remote debug session, however, when running the executable on the Raspi5, the in focus selection works, however, the widget locations always goes back to the original widget location at creation.

      Can anyone provide an explanation to the above and if are there any ways to get it work the same in both scenarios?

      Thanks,

      Nahum Budin.

      A Offline
      A Offline
      Axel Spoerl
      Moderators
      wrote on 22 Sept 2024, 17:50 last edited by
      #2

      @nahumb
      It’s a bit hard to guess that without seeing your creator kits and CMake/qmake configuration. In principle both should look the same.

      One reason for different look may be that Creator sets environment variables for styling. Maybe you want to add some code to log the application’s style.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nahumb
        wrote on 23 Sept 2024, 08:16 last edited by nahumb
        #3

        Hi Axel,

        Thanks for your prompt reply.

        After further searching I have found a solution on a stackoverflow post for the buttons color.
        The solution is adding a "boarder:none" to the stylesheet, for example: background-color: rgba(46, 204, 113, 0.4); border: none;
        This keeps the pushbuttons background colors in both running scenarios.

        I'm still looking for a workaround for the keeping the widgets screen locations issue.

        Thanks,

        Nahum.

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nahumb
          wrote on 23 Sept 2024, 20:14 last edited by nahumb
          #4

          @Axel-Spoerl
          After further exploring the position issue, I have identify that there is an issue with the moveEvent being fired when dragging
          a QDilaog when the application runs from the VS debug session, but generated only once when the Dialog is created and opened
          when running directly from the Raspi5.

          void Dialog_MyDialog::moveEvent(QMoveEvent *event) {
          	QWidget::moveEvent(event); 
          
          	last_position = event->pos();
          	printf("Dialog position %i:%i\n", last_position.x(), last_position.y());
          }
          
          1 Reply Last reply
          0
          • N Offline
            N Offline
            nahumb
            wrote on 25 Sept 2024, 19:30 last edited by
            #5

            @Axel-Spoerl

            Looks like Qt and Wayland do not work well together.

            I've switch RasPi OS Bookworm GUI to use X11 instead of Wayland and it all works fine now (thank to the support of Paul Hutch on the Raspi Forum).

            1 Reply Last reply
            0
            • N nahumb has marked this topic as solved on 25 Sept 2024, 19:31
            • A Offline
              A Offline
              Axel Spoerl
              Moderators
              wrote on 25 Sept 2024, 19:48 last edited by
              #6

              Which Qt version do you use?

              Software Engineer
              The Qt Company, Oslo

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nahumb
                wrote on 26 Sept 2024, 07:26 last edited by
                #7

                The c++ application is based on Qt5.

                1 Reply Last reply
                0

                1/7

                22 Sept 2024, 16:26

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved