[Qt-interest] Force emitting a signal in a test?

Hong Jiang kmldqj at gmail.com
Sun Nov 15 08:01:43 CET 2009


Hi All,

I'm writing some tests for my application. In the tests, I need to
programmatically force emit some signals. For example, I'd like to
trigger QListWidget::itemActivated from outside the widget. Is there a
good way to do it (without changing too much non-test code)? I know
about the functions in QTest::, but I don't want all tests to be
driven by simulated mouse or keyboard events (and thus having the
tests depend on the exact placement of the widgets). Sometimes it's
much easier to just trigger the signals directly.

Thanks.
--Hong



More information about the Qt-interest-old mailing list