Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Problem with cross compiled code on raspberry pi
Forum Updated to NodeBB v4.3 + New Features

Problem with cross compiled code on raspberry pi

Scheduled Pinned Locked Moved QtonPi
5 Posts 4 Posters 7.2k 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.
  • A Offline
    A Offline
    ant1bball
    wrote on last edited by
    #1

    Hello, I am having problems with a Qt GUI application I created. Basically I created the application in my ubuntu to check if it compiles and works properly, however, if I set up the cross compiler (followed one of your tutorials and tried a hello world which works properly) and execute my code in the pi the UI does not display properly and basically I cant do anything:
    · Text disappears from buttons
    · Mouse disappears from screen (therefore cant click buttons)
    · Cant navigate buttons using tab key

    Any clues? maybe I cant use .ui files in the pi and have to use qml? Thank you in advance.

    2 Screenshots of what I get with the pi and what the program should actually look like:

    !http://imageshack.us/a/img17/9986/img20130508093318.jpg!

    !http://img825.imageshack.us/img825/2038/raspiestubuntu.png!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Do you have fonts installed on the pi? Are the detected by Qt?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ant1bball
        wrote on last edited by
        #3

        I ran on the pi terminal the following code to check the detected fonts: "fc-list – lists fonts"
        Changed the fonts of my program to DejaVu Sans (which was detected) and a few others, still nothing. Moreover there was a message in the terminal i hadn't noticed: "This plugin does not support propagateSizeHints()"

        I've been told that Qt5 has different rendering platforms, the standard for my compiled version is "eglfs", which is fullscreen EGL accelerated mobile application style. I need to run it another platform for example xcb or x11 with the command "./myprogram -platform xcb". Unfortunatelly i only have the following platform options and none of them work: eglfs,linuxfb,minimal,minimalegl,offscreen. I dont now how to install these, i'll google it see if i can find anything.

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          I tested something similar some time ago.
          Qt did find the fonts, but I had to tell my app explicitly the size of the fonts :

          @app.Setstylesheet("QWidget {font: bold 72px;}");@

          Hope this helps you.

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • W Offline
            W Offline
            WolfEng
            wrote on last edited by
            #5

            I also ran into this and defining the size using pixelSize solved it, once I changed all my text rendering elements so that they would use pixelSize I was set to go.

            However later on, I found that I was not being able to load fonts other than the default one and after I also ran into trouble when I started using TextInput elements with echoMode set to password as the stars (*) just wouldn't show.

            Trying to solve my font loading problems I came up with the following solution.

            I included the ttf files as a resource and then used a FontLoader, I'm not sure whether this works using absolute/relative paths directly instead of the qrc path, But since I found it to work with qrc I just kept it this way.

            @FontLoader {
            id: freeSansLoader
            source: "qrc:///fonts/resources/fonts/FreeSans.ttf"
            onStatusChanged: if (loader.status == FontLoader.Ready) console.log('Loaded')
            }@

            After having declared the loader I can just directly write:

            @font.family: "FreeSans"@

            On text rendering elements (Text, TextEdit, TextInput).

            A nice additional surprise after I worked around the font loading problem, was that those inputs with echoMode set to password now seemed to display the stars (*), pwetty cool.. one less bug to deal with....

            Regards,

            Wolf

            1 Reply Last reply
            0

            • Login

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