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. QToolButton different text display policy between single and multi-line
Forum Updated to NodeBB v4.3 + New Features

QToolButton different text display policy between single and multi-line

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 605 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.
  • E Offline
    E Offline
    Etienne1984
    wrote on 4 Mar 2020, 09:41 last edited by Etienne1984 3 Apr 2020, 09:53
    #1

    Hello,

    I have two QToolButton displaying an icon, and under this icon a text with one or two lines. I can see that when the text has a single line, it displays from the left border to the right border, and it is constrained with no margin (default padding is 0, so this is normal).
    But in multiline (\n separating two words), the text is constrained as if big left and right margins were present.

    I use QT 5.12, PyQT to be precise.

    Screenshots :
    Screenshot from 2020-03-04 10-30-52.png
    You can see "Result Database" left and right margin are bigger then "Start Batch"

    Screenshot from 2020-03-04 10-31-19.png
    But when donwsizing a bit the width, "Result Database" text is unexpectedly altered whereas "Start Batch" displays still ok (and I can even resize until it touches the borders)

    ToolButtonStyle is set to "ToolButtonUnderIcon", there is no stylesheet declared for any of the QToolButton, and if I add "padding-left: 0px; padding-right: 0px;" it does not change anything. Icon is 32 by 32, buttons are 70 (min) to 100 (max) width, and 72 height.

    Is this normal ? Do you know any reason to explain this behavior ?

    Could I disable the automatic text modification behavior (apparition of "..."), I would prefer clipping ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Mar 2020, 19:41 last edited by
      #2

      Hi and welcome to devnet,

      Looks like related to QTBUG-64132.

      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
      4
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 4 Mar 2020, 20:00 last edited by
        #3

        What exact Qt5.12 version do you use? This should be fixed in at least the recent one.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        4
        • E Offline
          E Offline
          Etienne1984
          wrote on 5 Mar 2020, 08:33 last edited by Etienne1984 3 May 2020, 08:34
          #4

          Thank you very much @Christian-Ehrlicher and @SGaist for your quick and pertinent answers , I read related bugs description and saw that in 5.12.4 bug had probably been fixed. I was using 5.12.0.

          I had the possibility to upgrade a little my runtime version for Qt, and installed directly 5.13.0, and tested : it works fine. I mark the subject as closed !

          1 Reply Last reply
          0

          4/4

          5 Mar 2020, 08:33

          • Login

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