testgui.cpp Example File
tutorial3/testgui.cpp
/***************************************************************************
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
*/
#include <QtGui>
#include <QtTest>
class TestGui: public QObject
{
Q_OBJECT
private slots:
void testGui();
};
void TestGui::testGui()
{
QLineEdit lineEdit;
QtTest::keyClicks(&lineEdit, "hello world");
COMPARE(lineEdit.text(), QString("hello world"));
}
QTTEST_MAIN(TestGui)
#include "testgui.moc"
Copyright © 2008 Nokia Corporation and/or its subsidiary(-ies) |
Trademarks |
Qt Solutions |