From ff6dd7c7d8939aece61a40f7d3ded1643949d2f2 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 22 Jul 2018 16:53:51 -0700 Subject: [PATCH] link qt with vnrhost --- .gitignore | 1 + GUI/GUI.pro | 4 ++++ GUI/mainwindow.cpp | 12 ++++++++++++ GUI/mainwindow.h | 2 ++ GUI/mainwindow.ui | 40 ++++++++++++++++++++++------------------ 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 92576db..5900057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ Builds/ *.vs/ +*.pro.user \ No newline at end of file diff --git a/GUI/GUI.pro b/GUI/GUI.pro index 4dede0a..dcccb00 100644 --- a/GUI/GUI.pro +++ b/GUI/GUI.pro @@ -32,7 +32,11 @@ HEADERS += \ FORMS += \ mainwindow.ui +win32: LIBS += \ + -L$$PWD/../Builds/Debug/texthook/ -lvnrhost + # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target + diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 49d64fc..2917b96 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -1,14 +1,26 @@ #include "mainwindow.h" #include "ui_mainwindow.h" +#include "QMessageBox" +#include "qlineedit.h" +#include +#include "../texthook/host.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); + connect(ui->centralWidget->children().at(0), SIGNAL(returnPressed()), this, SLOT(onCommand())); + StartHost(); } MainWindow::~MainWindow() { delete ui; } + +void MainWindow::onCommand() +{ + QLineEdit* lineEdit = (QLineEdit*)sender(); + QMessageBox::information(this, "called", lineEdit->text()); +} diff --git a/GUI/mainwindow.h b/GUI/mainwindow.h index 9353441..a4af74b 100644 --- a/GUI/mainwindow.h +++ b/GUI/mainwindow.h @@ -15,6 +15,8 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); +public slots: + void onCommand(); private: Ui::MainWindow *ui; }; diff --git a/GUI/mainwindow.ui b/GUI/mainwindow.ui index 50dc006..d260328 100644 --- a/GUI/mainwindow.ui +++ b/GUI/mainwindow.ui @@ -13,7 +13,28 @@ NextHooker - + + + + + 252 + 0 + 241 + 20 + + + + + + + 3 + 40 + 491 + 291 + + + + @@ -23,23 +44,6 @@ 21 - - - NextHooker - - - - - - - NextHooker - - - TopToolBarArea - - - false -