Results 1 to 4 of 4

Thread: create QMetaCallEevnt

  1. #1
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default create QMetaCallEevnt

    since qmetacallevent is private defined, i dont find any documentation so far.
    but for the project test purpose i need to create one for testing.

    has anyone idea?

    In my project, i need to grab the information of each queued signal/slot message for testing.
    The messages are for debugging purpose in run time.
    Therefore i have modified the notify function.

    Qt Code:
    1. bool MyApplication::notify(QObject* receiver, QEvent* event)
    2. {
    3. TEST_FLAG(SIGNAL_PROTOCOL)
    4. // test function goes here
    5. END
    6.  
    7. return QApplication::notify(receiver, event);
    8. }
    To copy to clipboard, switch view to plain text mode 

    Since there would be mass of event go through, the performance impact of the function is also of my concern.
    That's why i want to test it.

    The test function entry is defined with QMetaCallEvent.

    In my test environment, I simply setup a loop to see the run time consumption of the test function.

    Qt Code:
    1. GTEST_XXX()
    2. {
    3. for (int i = 0; i < TEN_MILLION; i++){
    4. // test function
    5. }
    6. }
    To copy to clipboard, switch view to plain text mode 

    I used to think by only accessing QMetaObject, QMetaMethod. But it is not able to fulfill my need since the argument value of the signal transmitted is also for me important.
    Last edited by cic; 21st August 2013 at 13:59.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: create QMetaCallEevnt

    QMetaCallEvent is used internally by Qt's QMetaMethod::invoke() system, usually used through either signal/slot connection or QMetaObject::invokeMethod().

    Can you explain what you are trying to test or why you would have to explicitly create such an event instance yourself?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2011
    Location
    Karlsruhe, Germany
    Posts
    57
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: create QMetaCallEevnt

    @anda_skoa,

    hello, i have modified my post above.

    but is there any problem, i ve tried to post 3 times failed always.!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: create QMetaCallEevnt

    I am not sure I understand yet, but if you are looking for a way to test signal emits in a test program then have a look a QSignalSpy

    Cheers,
    _

Similar Threads

  1. How to Create lib in Qt.
    By shyam prasad in forum Qt Programming
    Replies: 6
    Last Post: 14th August 2012, 10:02
  2. Need to create a dll
    By DDHarLiN in forum Qt Programming
    Replies: 8
    Last Post: 14th August 2012, 09:30
  3. Replies: 4
    Last Post: 1st May 2009, 11:00
  4. How to create a SDK?
    By blackfox in forum Qt Programming
    Replies: 0
    Last Post: 10th September 2008, 10:23
  5. how to create pop-ups
    By miguel_mark in forum Newbie
    Replies: 1
    Last Post: 22nd October 2007, 06:16

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.