![]() Registered Member ![]()
|
Hi,
I run into trouble with QtTest when I want to use classes which call the KGlobal::locale() method (e.g. the constructor of KPIM::KDateEdit). The Problem is KGlobal::locale() returns a null pointer if it is called outside of a KApplication context and so the test will crash. Is there a way how to deal with such classes when working with the test framework of Qt? Thanks |
![]() Administrator ![]()
|
You need to create a KAboutData and then initialise KCmdLineArgs, using init()
The following code in main() should do the job.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() KDE Developer ![]()
|
|
![]() Registered Member ![]()
|
Great. |
![]() Registered Member ![]()
|
Hi,
it's me again. Thanks for the QTEST_KDEMAIN advice it solved the null pointer problem. But a new problem with KDateTime occured: the KDateTime::toUtc() method doesn't convert the date time to UTC. A short example (my time zone is CET):
With the QTEST_MAIN macro it works correct:
Is this a feature or bug of the QTEST_KDEMAIN macros? |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient