-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Swistusmen/qt
Qt
- Loading branch information
Showing
4 changed files
with
153 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Library with whole the buttons used in my interfaces | ||
*/ | ||
|
||
enum class AppButton { | ||
None, | ||
SwitchToAlgorithms, | ||
SwitchToData | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,50 @@ | ||
#include "QMainInterface.h" | ||
#include <qpushbutton.h> | ||
#include <iostream> | ||
|
||
QMainInterface::QMainInterface(QWidget* parent) : QWidget(parent) | ||
{ | ||
//setFixedSize(366, 300); | ||
|
||
ui.setupUi(this); | ||
ui.label->setParent(this); | ||
ui.algoInterface->setParent(this); | ||
connect(this, SIGNAL(algoWasClicked()), | ||
this, SLOT(changeTitle(QString))); | ||
connect(this, SIGNAL(this->dataWasClicked()), | ||
this, SLOT(changeTitle(QString))); | ||
ui.algoInterface->setCheckable(true); | ||
ui.creativInterface->setCheckable(true); | ||
//connect(this, SIGNAL(QMainInterface::algoWasClicked()), | ||
// this, SLOT(QMainInterface::changeTitle(QString))); | ||
connect(ui.algoInterface, &QPushButton::pressed, | ||
this, &QMainInterface::changeTitle); | ||
connect(ui.creativInterface, &QPushButton::pressed, | ||
this, &QMainInterface::changeTitle); | ||
|
||
//initializing main image | ||
|
||
} | ||
|
||
//very temporarly- when ui will be finished there will be no need to use such a circus solution, it's for test | ||
//and until all the ui will be created | ||
AppButton QMainInterface::WhichButton() { | ||
auto buttons = ui.interfaceButtons->buttons(); | ||
const int noButtons = buttons.size(); | ||
int destination = -1; | ||
for (int i = 0; i < noButtons; i++) | ||
{ | ||
if (buttons.at(i)->isChecked() == true) | ||
{ | ||
destination = i; | ||
break; | ||
} | ||
buttons.at(i)->setChecked(false); | ||
} | ||
for (int i = 0; i < noButtons; i++) | ||
{ | ||
buttons.at(i)->setChecked(false); | ||
} | ||
if (destination == -1) | ||
return AppButton::None; | ||
if (buttons.at(destination)->text() == "Data") | ||
return AppButton::SwitchToData; | ||
else if (buttons.at(destination)->text() == "algorithms") | ||
return AppButton::SwitchToAlgorithms; | ||
else | ||
return AppButton::None; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters