Pārlūkot izejas kodu

now we don`t have to use a custom text edit

logicp 5 gadi atpakaļ
vecāks
revīzija
a3c911944a
5 mainītis faili ar 8 papildinājumiem un 16 dzēšanām
  1. 0 1
      include/mainwindow.h
  2. 3 2
      ky_gui.pro
  3. 3 11
      src/mainwindow.cpp
  4. 1 1
      ui_argdialog.h
  5. 1 1
      ui_consoledialog.h

+ 0 - 1
include/mainwindow.h

@@ -9,7 +9,6 @@
 #include <QStandardItemModel>
 #include <QStandardItem>
 #include <include/client.hpp>
-#include <headers/ktextedit.hpp>
 #include <include/argdialog.h>
 #include <include/consoledialog.h>
 #include <QTableView>

+ 3 - 2
ky_gui.pro

@@ -5,7 +5,6 @@
 #-------------------------------------------------
 
 QT       += core gui
-QT       += designer
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
@@ -24,6 +23,9 @@ DEFINES += QT_DEPRECATED_WARNINGS
 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
 
 CONFIG += c++17
+CONFIG += static
+
+QMAKE_CXXFLAGS += "-fno-sized-deallocation"
 
 SOURCES += \
         src/argdialog.cpp \
@@ -37,7 +39,6 @@ HEADERS += \
         include/consoledialog.h \
         include/mainwindow.h \
         include/client.hpp \
-        headers/ktextedit.hpp \
         headers/kmessage_codec.hpp \
         headers/instatask_generated.h \
         headers/json.hpp \

+ 3 - 11
src/mainwindow.cpp

@@ -5,7 +5,6 @@
 #include <QTextStream>
 #include <QString>
 #include <QLayout>
-#include <headers/ktextedit.hpp>
 #include <QDateTime>
 #include <vector>
 #include <headers/util.hpp>
@@ -74,14 +73,11 @@ void MainWindow::connectClient() {
         progressBar->setValue(i);
     }
 
-    KTextEdit* send_message_box = reinterpret_cast<KTextEdit*>(ui->inputText);
-    send_message_box->show();
-
     QPushButton* send_message_button = this->findChild<QPushButton*>("sendMessage");
     // Handle mouse
-    QObject::connect(send_message_button, &QPushButton::clicked, this, [this, send_message_box]() {
-        q_client->sendMessage(escapeText(send_message_box->toPlainText()));
-        send_message_box->clear();
+    QObject::connect(send_message_button, &QPushButton::clicked, this, [this]() {
+        q_client->sendMessage(escapeText(ui->inputText->toPlainText()));
+        ui->inputText->clear();
     });
 
     QObject::connect(ui->appList,  static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]() {
@@ -140,10 +136,6 @@ void MainWindow::connectClient() {
         console_ui.show();
     });
 
-    // TODO: Handle enter key
-    //    QObject::connect(static_cast<KTextEdit*>(ui->inputText), &KTextEdit::textInputEnter, this, &MainWindow::handleInputEnterKey);
-    QObject::connect(static_cast<KTextEdit*>(ui->inputText), &KTextEdit::textInputEnter, this, &MainWindow::handleKey);
-
     QObject::connect(ui->processList, &QListView::clicked, this, [this](const QModelIndex &index) {
         auto process = m_processes.at(index.row());
         QString process_info_text = m_processes.at(index.row()).name.toUtf8() + "\n";

+ 1 - 1
ui_argdialog.h

@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'argdialog.ui'
 **
-** Created by: Qt User Interface Compiler version 5.13.0
+** Created by: Qt User Interface Compiler version 5.13.2
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
 ********************************************************************************/

+ 1 - 1
ui_consoledialog.h

@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'consoledialog.ui'
 **
-** Created by: Qt User Interface Compiler version 5.13.0
+** Created by: Qt User Interface Compiler version 5.13.2
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
 ********************************************************************************/