sortingBox = new SortingBox;
connect(clearButton, SIGNAL(clicked()), sortingBox, SLOT(clear()));clearButton->setShortcut(tr("Ctrl+R"));
buttonsLayout->addWidget(clearButton);
connect(clearLinks, SIGNAL(clicked()), sortingBox, SLOT(clearLinks()));
buttonsLayout->addWidget(clearLinks);
connect(clearLastLink, SIGNAL(clicked()), sortingBox, SLOT(clearLastLink()));
buttonsLayout->addWidget(clearLastLink);
connect(dijkstra, SIGNAL(clicked()), sortingBox, SLOT(startDijkstra()));
buttonsLayout->addWidget(dijkstra);
connect(sortingBox,
SIGNAL(showStatus
(QString)), sbar,
SLOT(showMessage
(QString)));
messageLayout->addWidget(sbar);
//gridLayout->addLayout(buttonsLayout, 0, 0);
//gridLayout->addWidget(sbar, 1, 0, 1, 0);
mainLayout->addWidget(sortingBox);
mainLayout->addLayout(buttonsLayout);
mainLayout->addWidget(sbar);
setLayout(mainLayout);
sortingBox = new SortingBox;
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout * buttonsLayout = new QHBoxLayout;
QHBoxLayout * messageLayout = new QHBoxLayout;
QGridLayout * gridLayout = new QGridLayout;
QPushButton * clearButton = new QPushButton("Clear");
connect(clearButton, SIGNAL(clicked()), sortingBox, SLOT(clear()));clearButton->setShortcut(tr("Ctrl+R"));
buttonsLayout->addWidget(clearButton);
QPushButton * clearLinks = new QPushButton("Clear Links");
connect(clearLinks, SIGNAL(clicked()), sortingBox, SLOT(clearLinks()));
buttonsLayout->addWidget(clearLinks);
QPushButton * clearLastLink = new QPushButton("Clear Last Link");
connect(clearLastLink, SIGNAL(clicked()), sortingBox, SLOT(clearLastLink()));
buttonsLayout->addWidget(clearLastLink);
QPushButton * dijkstra = new QPushButton("Calc Shortest Path");
connect(dijkstra, SIGNAL(clicked()), sortingBox, SLOT(startDijkstra()));
buttonsLayout->addWidget(dijkstra);
QStatusBar * sbar = new QStatusBar();
connect(sortingBox, SIGNAL(showStatus(QString)), sbar, SLOT(showMessage(QString)));
messageLayout->addWidget(sbar);
//gridLayout->addLayout(buttonsLayout, 0, 0);
//gridLayout->addWidget(sbar, 1, 0, 1, 0);
mainLayout->addWidget(sortingBox);
mainLayout->addLayout(buttonsLayout);
mainLayout->addWidget(sbar);
setLayout(mainLayout);
To copy to clipboard, switch view to plain text mode
Bookmarks