You are not logged in.



  • "jaemate21" is male
  • "jaemate21" started this thread

Posts: 1

Location: South Africa

Occupation: Aircraft technician

  • Send private message


Friday, January 21st 2011, 2:53pm

Printing in Qt

Hey to everyone,Ok I have been developing an application using both the std c++ and Qt under Kde.This is a program im doing for a friend's mom who is what the program does is,it enables her to be able to create as many classes as she wants,and in those classes she can add as many kids as is necessary.The basic fuctionality of the program is done,meaning you can create classes,add the students and enter their marks,but the biggest challenge Im having so far is figuring out how to print each leaner's progress report.I have thought of a couple of solutions,one: I have made a widget with qt designer,and would then make labels where the marks and the string variables would go and let the program change the labels as required,but i dont know how to print a widget with the QPainter class.the second solution was that I would decide on the dimensions of the report page,and use the methods in the Qpainter class like drawText() to draw on the QPrinter object and use drawLine() to draw the required lines.but this looks like a round about and very inelegant way of doing it.I was just wondering if anyone can offer some solution or tell of better ways and tools.or tell if the second solution is the only way to go please,thankx.



  • "ernestus" is male

Posts: 5

Location: Cambridge

Occupation: Doing interesting stuff

  • Send private message


Saturday, July 9th 2011, 3:05pm

(My 1st post, just registered now)

I don't understand your question very well, but there is a bit in the Qt documentation about that:
Near the end of the page there are to paragraphs that might be of your interest (with code examples): "Printing Widgets", and "Printing from Complex Widgets".



Tuesday, June 23rd 2015, 4:51pm

I solved the problem. It turns out that the (supposedly thread safe rand_r() function was causing kde to crash) I still don't know what it is about that function that crashed kde but it does! When I wrote my own