diff --git a/Text2Console/control.cpp b/Text2Console/control.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d67dcb3678a0481c1ac62b22b43d6bc5ef6ae43d --- /dev/null +++ b/Text2Console/control.cpp @@ -0,0 +1,23 @@ +#include <iostream> + +#include "control.h" +#include <QObject> + +Control::Control(MainWindow *_view) +{ + view = _view; + connect(view->button, SIGNAL(clicked()), this, SLOT(onButton())); +} + +void Control::onButton() +{ + QString text = view->lineEdit->text(); + + std::string str = text.toStdString(); + + std::cout << str << std::endl; +} + +Control::~Control() +{ +} \ No newline at end of file diff --git a/Text2Console/control.h b/Text2Console/control.h new file mode 100644 index 0000000000000000000000000000000000000000..fec1a745ca8f935a9543006468f8dd106b4f2a87 --- /dev/null +++ b/Text2Console/control.h @@ -0,0 +1,22 @@ +#ifndef CONTROL_H +#define CONTROL_H + +#include <QObject> +#include "mainwindow.h" + +class Control : public QObject +{ + Q_OBJECT + +private: + MainWindow *view; + +public: + Control(MainWindow *_view); + ~Control(); + +private slots: + void onButton(); + +}; +#endif // CONTROL_H