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. QPlainTextEdit autoExpand & checkbox signal/slot
Forum Updated to NodeBB v4.3 + New Features

QPlainTextEdit autoExpand & checkbox signal/slot

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

    Hi community !

    Today I have 2 questions !

    • the first one is about QPlainTextEdit but I think it could be applied on other widgets.
      I would like to auto expand the widget when I add lines instead of having the scroll bar displaying. I can't find any option in the attributes to do that. I would love to avoid a line of code just by clicking on a checkbox in the attributes ^_^

    • the second one is about hiding/showing a widget via a QCheckBox or QPushButton.
      I have found that by connecting a toggled(bool) signal to the setHidden() slot of my widget would hide/show when checking the QcheckBox.
      But If I want a QPushButton to drive the show/hide state of my widget then the toggled signal doesn't work ...

    Thx !

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

      Hi,

      1. AFAIK, you have to do the expansion yourself
      2. You can connect your checkbox to the setVisible slot

      Hope it helps

      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
      • GofferG Offline
        GofferG Offline
        Goffer
        wrote on last edited by
        #3

        I have found for the second one. If I want to drive the show/hide state with a QPushButton, i need the active the checkable state of the QPushButton.

        and for the expansion, that sucks that they don't have a simple attribute to allow it... that would be very handy.
        I will have a look on how I can write this expansion thing.

        Thx !

        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