Author Topic: Problem With Code  (Read 3286 times)

siggy

  • Newbie
  • *
  • Posts: 20
    • View Profile
Problem With Code
« on: December 21, 2004, 07:21:55 am »
Hi Guys

just a quick question.

I've got a GUI up & running on windows & it seems to (generally) work on the Z.

I've got a QCanvasView on a tab and I'm trying to get the size of it.
Anyway, I get the size and I'm printing it to a QTextView window I have in the same app (located below the QCanvasView).
The text seems to be being printed to the QTextView window okay, but the VScrollBar isn't allowing me to scroll down to see the whole of the text on the Z!!  The scroll bar & app seem to be working okay when being run on windows.

I tried using 'updateScrollBars()' after printing the text, but no joy.

Any ideas

Cheers

Pete

PS.  I've attached the app files I'm working on.
PPS.  Go easy, it's my first Python app - so I'm trying to learn Python & pyQt at the same time plus it's still early days in the dev

slapout

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Problem With Code
« Reply #1 on: December 21, 2004, 11:37:04 am »
I'm just a beginner myself but I did notice one thing. I think the QApplication should be QPEApplication for use on the Z. I doubt that's causing you're problem though. I'm sure someone here knows the answer.
SL-5600
Watapon 1.2 Rom

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
Problem With Code
« Reply #2 on: December 22, 2004, 01:44:35 am »
QTextView is obsolete under PyQt and you should use QListBox.

I have modified the code as follows and it works both in Windows XP and my Zaurus SL-5600 after compiling:

          .
          .
          .

        # comment read window - QTextView
        self.textview = QListBox(self.tab2)
       self.textview.setSizePolicy(QSizePolicy(7,5,self.textview.sizePolicy().hasHeight
orWidth()))
        self.textview.setMinimumSize(QSize(0,50))
        #self.textview.setHScrollBarMode(QTextView.AlwaysOff)
        #self.textview.setVScrollBarMode(QTextView.AlwaysOn)
        #self.textview.verticalScrollBar().setTracking(1)
          .
          .
          .
        self.textview.insertItem(QString(txt))
        self.textview.insertItem(QString("end of guiDB"))
        #self.textview.updateScrollBars()
« Last Edit: December 22, 2004, 01:46:22 am by freizugheit »

siggy

  • Newbie
  • *
  • Posts: 20
    • View Profile
Problem With Code
« Reply #3 on: December 22, 2004, 05:48:07 am »
Hi Guys

many thanks for the help, I'll implement both right now.

What documentation are you guys using?
I ask because the documentation that came with pyQt (ie. pyQt.html) states that
'QTextView (Qt v2+)
QTextView is fully implemented.'
So if my documentation is wrong, where can I /where did you get a correct set?

Many thanks again for your help.  It's much appreciated.

Siggy
« Last Edit: December 22, 2004, 06:31:36 am by siggy »

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
Problem With Code
« Reply #4 on: December 22, 2004, 11:44:51 am »
Advise to purchase PyQtDoc from theKompany.