hi i'm having some issues to move the scrollbar to the top. I put a image into a QTextEdit and when i open the scrollbar is in the bottom. I need that the scrollbar is on the top
i tried all these but it didn't work for me. still the same.
ui.textEdit->verticalScrollBar()->setValue(0);
myTextEdit -> moveCursor (QTextCursor::Start) ;
myTextEdit -> ensureCursorVisible() ;
QScrollBar *vScrollBar = yourTextEdit->verticalScrollBar();
vScrollBar->triggerAction(QScrollBar::SliderToMinimum);
here is my code.
RulesDialog::RulesDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::RulesDialog)
{
ui->setupUi(this);
setWindowIcon(QIcon(":/images/icon3.png"));
ui->textEdit->insertHtml("<img src=':/images/reglas.png'>");
}