Results 1 to 11 of 11

Thread: qpainter "drawText() problem

  1. #1
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default qpainter "drawText() problem

    Hi I have just installed linux on a new computer.
    I am using Kubuntu 610 (and 704 on an another HD in the same box)
    same problem on both installations .

    I had intalled "g++" , "gliv, glutq3" ,"glut.doc" and nothing else before I Installed Qt4.
    I did all the prescribed updates etc. I installed
    Qt4-4.2.2 on the disk with 610
    Qt4-4.2.3 on the disk with 704

    Both installations were text book clean.

    I have a graphic program which uses QPainter to draw lines and text on the screen.

    when compiled on either disks , the lines draw fine, but the "p.drawText(int, int, QString);" command locks up the computer for a short time then kicks me out sets up the "User input" screen.

    Now I have another computer that is also running Kubuntu 610 using "Qt-4.2.1" or "Qt-4.2.2, (not sure which) "Running the exact same program. It has no problem with the "p.drawText(int, int, QString);"

    I used the same "tar" of the program on each installations, ran "qmake -project", added "CONFIG += opengl qt warn_on debug" in the generated ".pro" file. Ran "qmake foo.pro" and the "make".
    No errors or significant warnings on any of the 3 installations.

    If I optioned out the one "p.drawText(...)" line in the two new installations, everything everything else ran
    the same on all three installations.

    Am I missing some other packages?

    I certainly would appreciate help, thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qpainter "drawText() problem

    Do all the demos bundled with Qt work fine? If so, then the problem is probably within your application. Do you use threads? What does your ~/.xsession-errors contain (last few lines)?

  3. The following user says thank you to wysota for this useful post:

    impeteperry (24th March 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Angry Re: qpainter "drawText() problem

    Thanks , sorry about the delay
    all the Demos run fine
    I don't think I am using "threads"
    I don't know how to get "~/.xsession-errors"

    I have just tried to compile some of the examples and I get
    pete@myComputer:/usr/local/Trolltech/Qt-4.2.3/examples/dialogs$ qmake dialogs.pro
    Failure to open file: /usr/local/Trolltech/Qt-4.2.3/examples/dialogs/Makefile
    Unable to generate makefile for: dialogs.pro
    pete@myComputer:/usr/local/Trolltech/Qt-4.2.3/examples/dialogs$
    I do have
    Qt Code:
    1. PATH=/usr/local/Trolltech/Qt-4.2.3/bin:$PATH
    2. export PATH
    To copy to clipboard, switch view to plain text mode 
    in my .bash_profile file.
    so I must be missing something in my "Qt" installation.

    My program generates "Makefile" files OK, however

    Thank for any help and your patience with an old man.
    Last edited by impeteperry; 24th March 2007 at 04:08.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qpainter "drawText() problem

    Quote Originally Posted by impeteperry View Post
    I don't know how to get "~/.xsession-errors"
    "less ~/.xsession-errors" - make sure to do it before you restart the X server.

    I have just tried to compile some of the examples and I get I do have
    Qt Code:
    1. PATH=/usr/local/Trolltech/Qt-4.2.3/bin:$PATH
    2. export PATH
    To copy to clipboard, switch view to plain text mode 
    in my .bash_profile file.
    so I must be missing something in my "Qt" installation.
    Did you install Qt from an RPM?

  6. #5
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qpainter "drawText() problem

    Thanks
    i ran the less... command and the first time through I got a request to install "kpersoni..." which I did and then ran the less.. command again and got
    Xsession: X session started for pete at Sat Mar 24 09:32:30 EDT 2007
    startkde: Starting up...
    startkde: Running kpersonalizer...
    X Error: BadDevice, invalid or uninitialized input device 167
    Major opcode: 144
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 167
    Major opcode: 144
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 167
    Major opcode: 144
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 167
    Major opcode: 144
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 167
    Major opcode: 144
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 167
    Major opcode: 144
    Minor opcode: 3
    Resource id: 0x0
    Failed to open device
    X Error: BadDevice, invalid or uninitialized input device 167
    I installed Qt as I always have by downloading it from the Trolltech "mirror", and then the "tar", "./configure -xshape", "make", "sudo make install" and entered the "path..." text item in my "profile" as instructed
    All without errors of course.

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qpainter "drawText() problem

    Is that the last screen of errors from the file?

    Try to see if you can install Qt using an rpm. This will make sure you have all needed dependencies.

    Do I understand correctly that the X server crashes when you run the application?

  8. #7
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qpainter "drawText() problem

    yes it is. I shall try the "rpm" I will delete the present installation first.

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qpainter "drawText() problem

    You don't have to delete it, just make sure the RPM based one comes before the compiled one in your $PATH.

  10. #9
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qpainter "drawText() problem

    Thanks for all your help. I know I've been a pest.

    i tried to find an RPM download. but gave up. (I really didn't spend too much time as I had so much trouble with RPM packages when I was using RH/Fedora before I switched to Ubuntu/Bubuntu.)

    I did, however install a debian version of Qt4. and had even more problems.

    I went back to my original thought and installed all the "gcc" packages that seemed reasonable.

    Re-installed Qt4 from the downloaded source code.

    Restarted my computer. re-compiled my program. NOW IT RUNS!!!

    I went back to the installed Qt examples in /usr/local/Trolltech/examples and tried "qmake examples.pro" and got
    pete@myComputer:/usr/local/Trolltech/Qt-4.2.3/examples$ qmake examples.pro
    Failure to open file: /usr/local/Trolltech/Qt-4.2.3/examples/Makefile
    Unable to generate makefile for: examples.pro
    pete@myComputer:/usr/local/Trolltech/Qt-4.2.3/examples$
    so now i want to fix that, but it is not criticca at this point.

    Thanks again

    I tried the examples in the Trolltech documentation . they all compiled and ran OK.
    Last edited by impeteperry; 24th March 2007 at 22:08.

  11. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qpainter "drawText() problem

    Do you have file access permissions for that directory? You may need to compile the example as root.

  12. #11
    Join Date
    Jan 2006
    Location
    Riverside, Rhode Island, USA
    Posts
    245
    Thanks
    52
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qpainter "drawText() problem

    Quote Originally Posted by wysota View Post
    Do you have file access permissions for that directory? You may need to compile the example as root.
    That did it, thanks

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Replies: 7
    Last Post: 20th March 2006, 20:03
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. QPainter rotate function
    By ir210 in forum Newbie
    Replies: 3
    Last Post: 17th January 2006, 04:31
  5. passing a QPainter object to widgets
    By vratojr in forum Qt Programming
    Replies: 9
    Last Post: 11th January 2006, 15:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.