summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-03-25 12:59:48 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-03-25 12:59:48 +0100
commit97697af47d881b67b531914e9e47b9d7911178b5 (patch)
tree9d4dde75dc8b5d2146417a387e7f252d62e85ee7
parenta1e3d36dca9c6abf235c7ddf47ab9185c4b748d5 (diff)
downloadIT-Sicherheit-97697af47d881b67b531914e9e47b9d7911178b5.tar.gz
IT-Sicherheit-97697af47d881b67b531914e9e47b9d7911178b5.zip
Implemets the binary file reader and writer
-rw-r--r--src/mainwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 2c6088e..4e52e4a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -97,7 +97,8 @@ void MainWindow::setPlainTextFromFile( QPlainTextEdit* destination, QFile* sourc
void MainWindow::setBinaryDataFromFile( QPlainTextEdit* destination, QFile* source )
{
- QMessageBox::warning(this, "WARNING", "The Method MainWindow::setBinaryDataFromFile is not implemented yet.\nEven the Prototype might change soon!");
+ destination->clear();
+ destination->appendPlainText(source->readAll().toHex());
}
@@ -109,7 +110,7 @@ void MainWindow::writePlainTextToFile( QPlainTextEdit* source, QFile* destinatio
void MainWindow::writeBinaryDataToFile( QPlainTextEdit* source, QFile* destination )
{
- QMessageBox::warning(this, "WARNING", "The Method MainWindow::setBinaryDataFromFile is not implemented yet.\nEven the Prototype will change soon!");
+ destination->write(QByteArray::fromHex(QByteArray().append(source->toPlainText())));
}