[PyQt] Re: how to implent a autoscroll text viewer

Marco marco at waven.com
Sun Feb 3 02:52:03 GMT 2008


        self.editor = QtGui.QTextBrowser(self.main_frame)

        self.editor.resize(320, 320)
        self.editor.setFont(QtGui.QFont("Sans", 24, QtGui.QFont.Bold))
        self.editor.setAlignment(QtCore.Qt.AlignTop)

        self.editor.setText(self.text)

        self.editor_timer = QtCore.QTimer()
        self.connect(self.editor_timer, QtCore.SIGNAL('timeout()'),
self.editor_timeout)
        self.editor_timer.start(75)
        #self.editor_timer.setSingleShot(True)

        #self.editor.verticalScrollBar().hide()
        print self.editor.verticalScrollBar().value()
        self.editor.verticalScrollBar().setRange(0, 100)
        self.editor.verticalScrollBar().setSliderPosition(50)

I use the code like it, but hide() works, setSliderPosition() not
work, why? and how can I do?

On 2/2/08, Marco <marco at waven.com> wrote:
> Hi,
>  I want to write a text viewer, when it load a text file, it show
> without scrollbar, but scrolling by timer, i donot know which widget
> should i use..
>
>  Thank you!!
>
>
> --
> LinuX Power
>


-- 
LinuX Power


More information about the PyQt mailing list