PDA

View Full Version : QTextBrowser, how to scroll ?



probine
21st December 2006, 21:56
I have a QTextBrowser and when I have a lot of data in it, then I can see the scroll bar, but I cannot scroll.

How do I set the QTextBrowser to scroll ?

jpn
22nd December 2006, 07:57
How can you not scroll? Is the scroll bar scrollable but the contents don't follow or what?

I'm pretty sure the problem is not with QTextBrowser. Qt Assistant uses QTextBrowser. Launch it and see yourself that the scrolling works there.

Or you can check with a minimal example:


#include <QtGui>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTextBrowser browser;
for (int i = 0; i < 100; ++i)
browser.append(QString("Line %1").arg(i));
browser.show();
return a.exec();
}

So if the scrolling works with this, the problem must be elsewhere, right?

PS. Are you possibly overriding any event handlers or using event filters?