Results 1 to 1 of 1

Thread: I do not understand as to start qt tests for gui

  1. #1
    Join Date
    Apr 2010
    Location
    Russia
    Posts
    6
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy I do not understand as to start qt tests for gui

    In all examples write examples of a code for the description, and an example how to start it is not described for console programs all dares qExec, and here in case of GUI it is not clear. Especially in many examples in functions for tests create local objects and if for example I have to test objects to which I I can to address only through ui, how then to be?
    I have simple example
    Qt Code:
    1. #ifndef TESTGUI_H
    2. #define TESTGUI_H
    3.  
    4. #include <QtGui/QMainWindow>
    5. #include "ui_testgui.h"
    6. #include <QtTest>
    7. #include <QTest>
    8. #include "test.h"
    9.  
    10. class testGui : public QMainWindow
    11. {
    12. Q_OBJECT
    13.  
    14. public:
    15. testGui(QWidget *parent = 0, Qt::WFlags flags = 0);
    16. ~testGui();
    17.  
    18. private:
    19. Ui::testGuiClass ui;
    20. private slots:
    21. void on_click_button();
    22. };
    23.  
    24. #endif // TESTGUI_H
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. #include "testgui.h"
    2.  
    3. testGui::testGui(QWidget *parent, Qt::WFlags flags)
    4. : QMainWindow(parent, flags)
    5. {
    6. ui.setupUi(this);
    7. connect(ui.pushButton,SIGNAL(clicked()),this,SLOT(on_click_button()));
    8. }
    9.  
    10. testGui::~testGui()
    11. {
    12.  
    13. }
    14. void testGui::on_click_button()
    15. {
    16. ui.lineEdit->setText(QString("Hello world!"));
    17. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. #include "testgui.h"
    2. #include <QtGui/QApplication>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. testGui w;
    8. w.show();
    9. return a.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    What should I make to write tests for of this kind programs?
    Last edited by Chexov; 15th April 2010 at 16:12.

Similar Threads

  1. Unit tests
    By leoalvesmachado in forum Newbie
    Replies: 1
    Last Post: 13th April 2010, 20:50
  2. Something i am not understand about Qt.
    By HeX0R in forum Newbie
    Replies: 8
    Last Post: 12th February 2010, 04:37
  3. how to best separate tests from source
    By Rockem in forum Qt Programming
    Replies: 0
    Last Post: 24th September 2009, 23:06
  4. need help .not able to understand.......
    By sh123 in forum Qt Programming
    Replies: 1
    Last Post: 20th January 2009, 01:50
  5. don't understand Qt's setCodecForCStrings
    By ber_44 in forum Qt Programming
    Replies: 1
    Last Post: 9th July 2007, 01:19

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.