Results 1 to 4 of 4

Thread: printing problem

  1. #1
    Join Date
    Dec 2007
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default printing problem

    hi

    i am new to Qt Designer


    i want to display the output to a screen(console like) and print it using C code

    i have no idea about where to display it using printf statements....

    is it possible to open a screen by clicking a pushbutton ?and then print the contents using C code?

    please reply...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: printing problem

    Do you compile that C code along with Qt-based code or does it come as a library? Because you can simply implement your own printf that would be called by C code. Otherwise you will have to somehow plug into stdout and stderr and read the data from there.

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

    vishnu5 (17th December 2007)

  4. #3
    Join Date
    Dec 2007
    Posts
    4
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: printing problem

    thanks jacek for replying!

    the C code will be compiled with qt based code.

    i want to disply it somewhere.
    atleast i need to send the contents of a file to a printer using C code.if u know how to do it please tell me.


    vishnu

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: printing problem

    First write a stub of int printf( const char * format, ... ) function and see if you can convince the linker to use it instead of standard printf() (it might not work for libraries). Then you will need a singleton QObject that will emit a signal each time your custom printf() is invoked.

  6. The following user says thank you to jacek for this useful post:

    vishnu5 (18th December 2007)

Similar Threads

  1. Printing problem in windows
    By joseph in forum Qt Programming
    Replies: 6
    Last Post: 12th July 2007, 08:04
  2. experiencing problem at printing out QTableWidget
    By rmagro in forum Qt Programming
    Replies: 9
    Last Post: 27th June 2007, 16:04
  3. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.