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. [Solved] Compress QLabel

[Solved] Compress QLabel

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.0k 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.
  • M Offline
    M Offline
    moravas
    wrote on last edited by
    #1

    Solve: I put a button on the widget, which show or hides the labels. I needed a rapid solution: it seems to be enough fast and pretty.

    Hi Folks,

    I have an UI app with some widgets, and I would like to place into that an QLabel. The label will display some formatted text, which is wrapped into several line. I would like the following: normaly, the QLabel should display only the first line of text. When the mouse points to the label, it should expand itself, so the whole text will be visible.
    How can I set the this behavioral for the QLabel?

    Regards,
    Norbert

    1 Reply Last reply
    0
    • P Offline
      P Offline
      primem0ver
      wrote on last edited by
      #2

      I am not an expert in Qt. In fact I am a beginner myself. However I have done similar things using .NET. After looking at the QLabel documentation my guess would create your own class that inherits QLabel and overrides the mouseMoveEvent method. In your override you could change the size and contents of the label as needed for your program. The documentation also suggests that this will not work unless you enable mouse tracking. You would have to research how to accomplish that.

      1 Reply Last reply
      0
      • IamSumitI Offline
        IamSumitI Offline
        IamSumit
        wrote on last edited by
        #3

        hii.

        Find some clue from following lilnk
        "Go":http://qt-project.org/forums/viewthread/32918

        hope it helps.

        Be Cute

        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