Results 1 to 3 of 3

Thread: create QApplication in a dll for uni tests

  1. #1
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: create QApplication in a dll for uni tests

    Hi,

    I am creating unit tests for my Qt project using cppunit and my goal is to be able to initiate a map control, add graphics and other objects to map control when unit tests are run. Basically trying to make it UI based automated tests.

    I have created a map widget application and wrapped it in to a dll. This is what I want to consume in my tests and draw stuff on it on the fly while running UI tests. My issue is that now I have QApplication inside a dll and once the exec has been called on QApplication it goes out of my control. What should I do to get control back so that I can get hold of map object and add stuff to it.


    Regards,
    Raj


    Added after 13 minutes:


    Is there any kind of Signal that QApplication emits, once it is done creation of the application(i.e. UI has been created) ?????
    Last edited by rajji_saini; 13th July 2012 at 17:58.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: create QApplication in a dll for uni tests

    You can call QMetaObject::invokeMethod() to schedule execution of a method (slot) once the application enters the event loop.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2010
    Posts
    36
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: create QApplication in a dll for uni tests

    Hey Thanks ... that should help.

Similar Threads

  1. How to write automated tests for my app?
    By oficjalne100 in forum Qt Programming
    Replies: 4
    Last Post: 13th March 2012, 06:06
  2. I do not understand as to start qt tests for gui
    By Chexov in forum Qt Programming
    Replies: 0
    Last Post: 15th April 2010, 15:50
  3. Unit tests
    By leoalvesmachado in forum Newbie
    Replies: 1
    Last Post: 13th April 2010, 20:50
  4. how to best separate tests from source
    By Rockem in forum Qt Programming
    Replies: 0
    Last Post: 24th September 2009, 23:06
  5. Can I create a QApplication inside a DLL?
    By oob2 in forum Qt Programming
    Replies: 6
    Last Post: 1st July 2006, 10:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.