/[projects]/queensgui/src/queensmain.h
ViewVC logotype

Annotation of /queensgui/src/queensmain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 327 - (hide annotations) (download)
Wed Sep 16 18:53:22 2009 UTC (14 years, 8 months ago) by torben
File MIME type: text/plain
File size: 2896 byte(s)
Compile with qt 4.5

1 torben 1 /***************************************************************************
2     * Copyright (C) 2005 by Torben Nielsen *
3     * torben@t-hoerup.dk *
4     * *
5     * This program is free software; you can redistribute it and/or modify *
6     * it under the terms of the GNU General Public License as published by *
7     * the Free Software Foundation; either version 2 of the License, or *
8     * (at your option) any later version. *
9     * *
10     * This program is distributed in the hope that it will be useful, *
11     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13     * GNU General Public License for more details. *
14     * *
15     * You should have received a copy of the GNU General Public License *
16     * along with this program; if not, write to the *
17     * Free Software Foundation, Inc., *
18     * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19     ***************************************************************************/
20     #ifndef QUEENSMAIN_H
21     #define QUEENSMAIN_H
22    
23     #include <qdialog.h>
24     #include <qdatetime.h>
25     #include <qtimer.h>
26 torben 327 //Added by qt3to4:
27     #include <QLabel>
28     #include <QContextMenuEvent>
29 torben 1
30     #include "guiupdate.h"
31    
32     class QPushButton;
33     class QSpinBox;
34 torben 327 class Q3ListBox;
35 torben 1 class QLabel;
36     class QString;
37 torben 2 class Solution;
38 torben 1
39     class SolutionContainer;
40     class Queens;
41     class Board;
42    
43 torben 13 enum SortingAlgorithm{SortVector, SortList, SortHash, SortMNVector, SortMinimalVector};
44 torben 2 enum StorageClass{ StorageInt, StorageMatrix };
45 torben 1
46 torben 2
47 torben 1 /**
48     @author Torben Nielsen
49     */
50     class QueensMain : public QDialog, public GUIUpdate
51     {
52     Q_OBJECT
53     private:
54     Board *m_board;
55     QPushButton *m_quit;
56     QPushButton *m_start;
57     QPushButton *m_stop;
58 torben 327 Q3ListBox *m_list;
59 torben 1 QSpinBox *m_sizeSelector;
60     QLabel *m_status;
61     QTime m_time;
62    
63 torben 2 Solution* m_sol;
64 torben 1 SolutionContainer *m_solutions;
65     Queens *m_queens;
66     SortingAlgorithm m_sortalgo;
67 torben 2 StorageClass m_storage;
68 torben 1
69     QTime m_elapsed;
70     int m_totalcount;
71    
72    
73     void contextMenuEvent(QContextMenuEvent *);
74    
75     public:
76     QueensMain(QWidget *parent = 0, const char *name = 0);
77    
78     ~QueensMain();
79     QString elapsed();
80     void uniqueSolutions();
81    
82     public slots:
83     void start();
84     void stop();
85     void foundSolution();
86     void finishedSearch();
87     void showSolution();
88     void resize(int size);
89     void duplicateRemoved();
90    
91     void sortList();
92     void sortVector();
93     void sortHash();
94     void sortMNVector();
95 torben 13 void sortMinimalVector();
96 torben 2
97     void storageInt();
98     void storageMatrix();
99    
100 torben 1 };
101    
102     #endif

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20