-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c37904c
commit 4ad97dc
Showing
11 changed files
with
337 additions
and
277 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,25 @@ | ||
#include "console.h" | ||
#include "ui_console.h" | ||
|
||
Console::Console(QWidget *parent) : | ||
QWidget(parent), | ||
ui(new Ui::Console) | ||
{ | ||
ui->setupUi(this); | ||
} | ||
|
||
Console::~Console() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void Console::changeText(std::string s) | ||
{ | ||
QString previousText = ui->text->toPlainText(); | ||
ui->text->setPlainText(previousText + s.c_str()); | ||
} | ||
|
||
void Console::clearText() | ||
{ | ||
ui->text->setPlainText(""); | ||
} |
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,24 @@ | ||
#ifndef CONSOLE_H | ||
#define CONSOLE_H | ||
|
||
#include <QWidget> | ||
|
||
namespace Ui { | ||
class Console; | ||
} | ||
|
||
class Console : public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit Console(QWidget *parent = nullptr); | ||
~Console(); | ||
Ui::Console *ui; | ||
|
||
public slots: | ||
void changeText(std::string s); | ||
void clearText(); | ||
}; | ||
|
||
#endif // CONSOLE_H |
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,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Console</class> | ||
<widget class="QWidget" name="Console"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>437</width> | ||
<height>356</height> | ||
</rect> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>437</width> | ||
<height>356</height> | ||
</size> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>437</width> | ||
<height>356</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Console</string> | ||
</property> | ||
<widget class="QPlainTextEdit" name="text"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>441</width> | ||
<height>361</height> | ||
</rect> | ||
</property> | ||
<property name="readOnly"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="plainText"> | ||
<string/> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
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
Oops, something went wrong.