You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jaemate21

Beginner

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

Posts: 1

Location: South Africa

Occupation: Aircraft technician

  • Send private message

1

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 teacher.now 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

Beginner

  • "ernestus" is male

Posts: 5

Location: Cambridge

Occupation: Doing interesting stuff

  • Send private message

2

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:
http://doc.qt.nokia.com/latest/printing.html
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".

Cheers

3

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