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. LineEdit with a horizontal ScrollBar
Forum Updated to NodeBB v4.3 + New Features

LineEdit with a horizontal ScrollBar

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.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.
  • I Offline
    I Offline
    isaacEnrique
    wrote on last edited by
    #1

    Greetings.

    I need a widget that is a LineEdit, but that has a horizontal scrollBar in case the text is too long. I really do not need a custom widget, rather I would like to achieve that effect and appearance combining built-in Qt widget (that's what been trying so far). I have tried to do this in QtDesigner putting a QLineEdit inside a QScrollArea, but the problem is that it takes up too much vertical space. I want the ScrollArea this adjusted around the LineEdit and like that it can not grow vertically, only horizontally, so the widget will seem a simple LineEdit and horizontal scrollBar only appear when needed.

    How I can achieve this effect?
    Can this be done only by combining a QLineEdit and QScrollArea or I'm wrong?

    Thanks in advance for any help and/or suggestions.

    Isaac Pérez
    Programming is understanding.

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      If you only want to use QtWidgets, yes, I believe this is the proper way. Was the first thing that came to mind.
      With the stylesheet options a lot of display properties may be changed for the scrollBar, so probably also the height/width etc of the bar.
      Greetz

      Greetz, Jeroen

      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