PDA

View Full Version : printing problem



vishnu5
17th December 2007, 13:47
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...

jacek
17th December 2007, 13:56
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.

vishnu5
17th December 2007, 16:30
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

jacek
17th December 2007, 19:22
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.