Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-11

TCustomApplication and QApplication

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

I'm trying to write a console program that uses some features of QT (webkit and printing from webkit) using FPC 2.2.5
QT have QApplication that I require to use because that I require the printing issues and settings the URL.

QApplication is very similar to TCustomApplication in it's approach, so my question is how can I bind between the two so when I'm making QApplication_exec, it will execute the code of TCustomApplication.run and do what I require from it to do ?

Thanks,
Ido

http://ik.homelinux.org/

Reply by email

ik
to leledumbo

I'm using the binding, but it still does not answer the question (that I already found the answer on my own, but I do not like it). In order to work with QT widgets, you must initialize it also by using QApplication and it's family... Why ? well it's the same as TApplication in Lazarus/Delphi, it handles all of the events etc.. If I'm writing an application that uses TCustomApplication, the "run" (DoRun for your code) procedure does a loop for you, so you must Terminate it after you make your code (unless you need it to continue running). QApplication.exec, does the same thing, and it is mandatory, so you must use signals and slots using QObject.connect in order to make sure it will break it's loop.

Ido
http://ik.homelinux.org/

leledumbo wrote 12 lines
FPC already has QT binding, just use it: http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html -- View this message in context: http://old.nabble.com/TCustomApplication-and-QApplication-tp26248446p26261584.html Sent from the Free Pascal - General mailing list . _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email