Solved Can't seem to auto-scroll a VerticalScrollBar?
-
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 typeAny info on this?
-
#include <QScrollBar> ?
-
#include <QScrollBar> ?
-
That worked! Wondering why I had to include that specifically? I'm still new to C++ and definitely still new to the Qt classes.
-
@Darkloud That's too c++ basic.
Without the including, the compiler don't know what is aQScrollBar
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. -
Right, I thought it was inhereted from QMainWindow. I see now. Thanks