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. Can't seem to auto-scroll a VerticalScrollBar?

Can't seem to auto-scroll a VerticalScrollBar?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 554 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.
  • D Offline
    D Offline
    Darkloud
    wrote on last edited by Darkloud
    #1

    Hello ladies and gents!

    I am having an issue automatically scrolling a vertical bar in my TextEditor widget. The line which I think is correct is as such:

    ui->outLine->verticalScrollBar()->setValue(ui.outLine->verticalScrollBar()->maximum());
    

    But for some reason before the setValue call, the -> is underlined and the error is:
    member access into incomplete type

    Any info on this?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      #include <QScrollBar> ?

      1 Reply Last reply
      2
      • D Offline
        D Offline
        Darkloud
        wrote on last edited by
        #3

        That worked! Wondering why I had to include that specifically? I'm still new to C++ and definitely still new to the Qt classes.

        B 1 Reply Last reply
        0
        • D Darkloud

          That worked! Wondering why I had to include that specifically? I'm still new to C++ and definitely still new to the Qt classes.

          B Offline
          B Offline
          Bonnie
          wrote on last edited by
          #4

          @Darkloud That's too c++ basic.
          Without the including, the compiler don't know what is a QScrollBar and what functions does it have.
          Other classes which you can use their functions without including them, may actually be included in some other files you've included.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Darkloud
            wrote on last edited by
            #5

            Right, I thought it was inhereted from QMainWindow. I see now. Thanks

            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