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. Double scrollbars in Qtoolbox
Forum Updated to NodeBB v4.3 + New Features

Double scrollbars in Qtoolbox

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

    I use a toolbox and I push in QTextEdit as items with the method addItem.

    So one open toolbox slot contains a QTextEdit and for some reason already a scrollbar. This scrollbar is not neccessary since the QTextEdit automatically adds a scroll bar a soon as the text goes beyond the open toolbox slot. The result is double scroll bars, one on the toolbox item that is always visible one that is added by the textedit. How can I disable the default toolbox-items-scrollbars and only let the textedit add a scroller?

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      It's just a hack idea (not tested)

      Try to search for QScrollArea children of your QToolBox and set the horizontal and vertical scroll bar policy to Qt::ScrollBarAlwaysOff

      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
      0
      • T Offline
        T Offline
        thEClaw
        wrote on last edited by
        #3

        Maybe you should search for QAbstractScrollArea instead, since that's where these settings reside. Just to be on the safe side.

        A different idea would be that you deactivate the scrollbars of the QTextEdit (same syntax, it's a QAbstractScrollArea itself) and allow it to freely resize to its contents - the parent will provide scrollbars if necessary.
        Either you do this via settings like QWidget::setSizePolicy or by reimplementing one of its functions (update() might be overkill, but I can't think of a better one right now).

        None of these I have tested on my own yet, but I am sure there is a somewhat pretty solution to be found.

        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