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. where i can find ScrollDownToBottom signal for QtextEdit

where i can find ScrollDownToBottom signal for QtextEdit

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.6k Views
  • 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
    moyin
    wrote on last edited by
    #1

    Actually, i have a qtextedit consists of license acceptance text for my gui tool, i want to make "accept" button enable when user scroll down to bottom, to make sure that user have read whole text. so all i need is to have signal that i can emit when scroll comes down to bottom,
    Is there any available slots for this or we hav to implement, in any case please help me out.

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

      Hi,

      One way I see is to connect to the valueChanged of the vertical scroll bar and enable the button once it has reach the maximum value set on it.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        One way I see is to connect to the valueChanged of the vertical scroll bar and enable the button once it has reach the maximum value set on it.

        M Offline
        M Offline
        moyin
        wrote on last edited by
        #3

        @SGaist
        thnks for reply, but i couldn't find such slot (valuechanged()),
        i'm getting error saying that, there is no such slots

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

          It's a signal

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            It's a signal

            M Offline
            M Offline
            moyin
            wrote on last edited by
            #5

            @SGaist
            i'm getting error saying that, there is no such signal

            jsulmJ 1 Reply Last reply
            0
            • M moyin

              @SGaist
              i'm getting error saying that, there is no such signal

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @moyin Do you read documentation? The name of the signal is valueChanged as pointed out in the documentation @SGaist pointed to. Can you show the code?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #7

                Hi
                Just to be clear.
                Its the scrollbar that has signal. not directly the TextEdit
                so basically its

                #include <QScrollBar>
                ...
                QScrollBar* sbar = ui->textEdit->verticalScrollBar();
                QPushButton* Acceptbutton = ui->pushButton;
                Acceptbutton->setEnabled(false); // make it start off
                connect(sbar, &QScrollBar::valueChanged, [sbar, Acceptbutton]() {
                    Acceptbutton->setEnabled( sbar->value() == sbar->maximum() );
                  } );
                

                Note that if u scroll up again it becomes disabled again but
                it might not matter for this use case :)

                1 Reply Last reply
                2

                • Login

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