Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Add spacing to QMenu::item without resizing QMenu::right-arrow

    Mobile and Embedded
    qss qmenu embedded linux
    2
    4
    401
    Loading More Posts
    • 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
      Aramir last edited by

      Hello,
      Why does the QMenu::right-arrow size change when I'm tweaking QMenu::item size (throught padding,margin,spacing, etc).

      How can I prevent this or change QMenu::right-arrow size (preferably without replacing the stock image) ?

      e606218f-b021-4d41-a76f-f106f98b5aaa-image.png

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        How are you doing that ?
        Which version of Qt are you using ?
        On which platform ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply Reply Quote 0
        • A
          Aramir @SGaist last edited by Aramir

          @SGaist

          • How are you doing that ?

          Hello I'm simply using the following stylesheet :

                  "QMenuBar { spacing : 20px; }"
                  "QMenuBar::item { padding-top : 15px; padding-bottom : 5px; color: black; }"
                  "QMenuBar::item#statusBar { background : transparent; }"
          
                  "QMenu::item { padding : 10px }"
                  "QMenu::separator { height : 2px ; background : darkgray }"
          

          link to those lines within my project (branch vocab) https://git.hijackedbrain.com/hijackedbrain/Obenkyobo/src/commit/8621fc8e2cf1ffc6eda4cefef34420b4e0746a20/Src/mainwindow.cpp#L37

          The QMenu itself is made using qtdesigner
          bfad8d90-c681-41a6-bd9c-abb528c4e002-image.png

          • Which version of Qt are you using ? On which platform ?

          I'm using qt-linux-5.15-kde-kobo for kobo ereaders (linux arm devices). Compiled using the following scripts :
          https://github.com/Rain92/kobo-qt-setup-scripts
          https://github.com/Rain92/qt5-kobo-platform-plugin

          The project itself should compile and work fine (enough) on pc but does not look the same at all.
          Unusual use case I know :/.

          Running on a Libra H2O in the screenshots.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            It's likely something that is highly specific to your device.
            What is it running to manage its GUI ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post