Initial support for a qt gui to show search.
[rattatechess.git] / search_gui.cpp
blob6927929388d77f7bddc0512daf44e2ace62940cc
1 /***************************************************************************
2 search_gui.cpp - Gui to view the search tree
3 -------------------
4 begin : Sat Oct 06 2007
5 copyright : (C) 2007 by Maurizio Monge
6 email : monge@linuz.sns.it
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #include "search_gui.h"
19 #include <QWidget>
20 #include <QApplication>
21 #include <QTreeView>
22 #include <QSocketNotifier>
24 SearchGui::SearchGui(int& argc, char** argv)
26 printf("Hello!\n");
27 app = new QApplication(argc, argv);
28 treeview = new QTreeView();
29 treeview->resize(640, 480);
30 treeview->show();
32 new QSocketNotifier( fileno(stdin), QSocketNotifier::Read, this);
33 new QSocketNotifier( fileno(stdin), QSocketNotifier::Exception, this);
36 SearchGui::~SearchGui()
38 delete treeview;
39 delete app;
42 void SearchGui::wait_input()
44 while(1)
46 if(input_available())
47 return;
48 app->processEvents(QEventLoop::WaitForMoreEvents);
52 #include "search_gui.moc"