Results 1 to 4 of 4

Thread: Problem Qt really needs a X server, can't use QCoreApplication...

  1. #1
    Join Date
    Sep 2007
    Posts
    31
    Thanked 1 Time in 1 Post

    Default Problem Qt really needs a X server, can't use QCoreApplication...

    Hi,

    I get "cannot connect to X server :0.0" which is normal because I don't have a X server on my server.

    But when I use QCoreApplication, it says that it needs a QApplication!
    It's because I'm using QPainter to paint into a pdf file...
    I'm stuck!

    Any idea?

    Thanks
    Best regards,
    Oscar

  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: Problem Qt really needs a X server, can't use QCoreApplication...

    Most painting operations unfortunately need a QApplication object. I think only painting on QImage doesn't and only if you don't use text rendering (I'm not sure about the last one though). Try painting on QImage and see if that goes through.

  3. #3
    Join Date
    Sep 2007
    Posts
    31
    Thanked 1 Time in 1 Post

    Default Re: Problem Qt really needs a X server, can't use QCoreApplication...

    I finally installed a little X Server just for my Qt application.
    That's really abnormal but this is the only quick way I found.

    I didn't tried drawing on a QImage, that would change to many of my code...

    Thanks wysota for your quick reply
    Best regards,
    Oscar

  4. #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: Problem Qt really needs a X server, can't use QCoreApplication...

    I'm sure making a quick test wouldn't have hurt...

Similar Threads

  1. Very strange socket programming problem
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2008, 12:05
  2. Some Problem with Qt4 link to sql server 2000 Database
    By bangqianchen in forum Qt Programming
    Replies: 0
    Last Post: 29th August 2008, 11:43
  3. Network Threaded server problem
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2008, 09:08
  4. Problem getting an image from a web server
    By probine in forum Qt Programming
    Replies: 3
    Last Post: 12th January 2007, 23:05
  5. QCoreApplication problem
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2006, 20:18

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.