[Interest] Insert without scrolling

Filip Piechocki fpiechocki at gmail.com
Thu Apr 10 11:34:47 CEST 2014


Hi Hugo,

The text edit does not scroll up - it is rather your pasted text which
pushes other lines down, while the current scroll stands still. So if you
want to see exactly the same content as before pasting than you need to
scroll down same amount of lines that have been inserted.

Best regards,
Filip


On Thu, Apr 10, 2014 at 11:29 AM, Hugo Teso <dixieflatl at gmail.com> wrote:

> Hi Tony,
>
> It did partially. Now, instead of scrolling to the top of the document,
> it scrolls up the same amount of lines that have been inserted.
>
> I tried to prevent this "new" scroll but with no success yet. Any ideas?
>
> Thanks,
>
> On 10/04/14 03:05, Tony Rietwyk wrote:
> > Hi Hugo,
> >
> > Try using an explicit QTextCursor rather than the QTextEdit interfaces.
> >
> > Hope that helps,
> >
> > Tony
> >
> >
> >> -----Original Message-----
> >> Sent: Thursday, 10 April 2014 2:23 AM
> >>
> >> Hi,
> >>
> >> I am trying to insert some text at the top of a QPlainTextEdit. To do so
> > I'm am
> >> using this lines of code:
> >>
> >> ui->textEdit->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
> >> ui->textEdit->insertPlainText("Some text here");
> >>
> >> The problem is that, by doing this, the textEdit is scrolled to the top
> in
> > order
> >> to show the new inserted text.
> >>
> >> Is there any way to avoid this scrolling to the top? I need to insert
> this
> > text
> >> silently without the user noticing.
> >>
> >> Thanks for your help,
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140410/e566c22a/attachment.html>


More information about the Interest mailing list