82 |
m_sizeSelector->setValue( 8 ); |
m_sizeSelector->setValue( 8 ); |
83 |
m_board->setSize( 8 ); |
m_board->setSize( 8 ); |
84 |
|
|
85 |
m_storage = StorageMatrix; |
m_storage = StorageInt; |
86 |
m_sortalgo = SortList; |
m_sortalgo = SortList; |
87 |
m_solutions = NULL; |
m_solutions = NULL; |
88 |
m_queens = NULL; |
m_queens = NULL; |
129 |
QueensMain::~QueensMain() |
QueensMain::~QueensMain() |
130 |
{ |
{ |
131 |
delete m_board; |
delete m_board; |
132 |
|
|
133 |
|
if (m_solutions != NULL) |
134 |
|
delete m_solutions; |
135 |
|
if (m_sol != NULL) |
136 |
|
delete m_sol; |
137 |
} |
} |
138 |
|
|
139 |
void QueensMain::start() |
void QueensMain::start() |
149 |
if (m_queens != NULL) { |
if (m_queens != NULL) { |
150 |
m_queens->wait(); |
m_queens->wait(); |
151 |
delete m_queens; |
delete m_queens; |
152 |
|
m_queens = 0; |
153 |
} |
} |
154 |
|
|
155 |
if (m_solutions != NULL) |
if (m_solutions != NULL) |
285 |
{ |
{ |
286 |
QPopupMenu *contextMenu = new QPopupMenu( this ); |
QPopupMenu *contextMenu = new QPopupMenu( this ); |
287 |
contextMenu->setCheckable( true ); |
contextMenu->setCheckable( true ); |
288 |
QLabel *sortCaption = new QLabel("<b><i>Sort algorithm</i></b>", this); |
QLabel *sortCaption = new QLabel("<b><i>Container class</i></b>", this); |
289 |
sortCaption->setAlignment( Qt::AlignCenter ); |
sortCaption->setAlignment( Qt::AlignCenter ); |
290 |
contextMenu->insertItem( sortCaption ); |
contextMenu->insertItem( sortCaption ); |
291 |
|
|
294 |
contextMenu->insertItem("Hash", this, SLOT( sortHash() ), 0, 3); |
contextMenu->insertItem("Hash", this, SLOT( sortHash() ), 0, 3); |
295 |
contextMenu->insertItem("M*N Vector", this, SLOT(sortMNVector()), 0, 4); |
contextMenu->insertItem("M*N Vector", this, SLOT(sortMNVector()), 0, 4); |
296 |
|
|
297 |
QLabel *storageCaption = new QLabel("<b><i>Storage class</i></b>", this); |
QLabel *storageCaption = new QLabel("<b><i>Solution class</i></b>", this); |
298 |
|
storageCaption->setAlignment( Qt::AlignCenter ); |
299 |
contextMenu->insertItem( storageCaption ); |
contextMenu->insertItem( storageCaption ); |
300 |
contextMenu->insertItem("Matrix Solution", this, SLOT( storageMatrix() ), 0, 5); |
contextMenu->insertItem("Matrix Solution", this, SLOT( storageMatrix() ), 0, 5); |
301 |
contextMenu->insertItem("Int Solution", this, SLOT( storageInt() ), 0, 6); |
contextMenu->insertItem("Int Solution", this, SLOT( storageInt() ), 0, 6); |