Skip to content

Commit

Permalink
rename QT UI to Qui
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques-chen committed Mar 28, 2024
1 parent 11adf08 commit 0fd01db
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 40 deletions.
Binary file removed example/QFastLLM/bin/Qt5Network.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions example/QFastLLM/src/FastLLM.cpp → example/Qui/src/Qui.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "FastLLM.h"
#include "Qui.h"

FastLLM::FastLLM(QWidget *parent)
Qui::Qui(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
Expand All @@ -12,23 +12,23 @@ FastLLM::FastLLM(QWidget *parent)
ui.edPathModel->setText(modelPath);
updateModelList();

flmPath = QCoreApplication::applicationDirPath() + "/fastllm.exe";
flmPath = QCoreApplication::applicationDirPath() + "/Qui.exe";
ui.edPathFlm->setText(flmPath);

ui.gbDeviceMap->setChecked(false);
ui.btnStopModel->setEnabled(false);
}

void
FastLLM::clearChat()
Qui::clearChat()
{
ui.textEditAI->clear();
}

void
FastLLM::wirteToFile()
Qui::wirteToFile()
{
QString fileName = QFileDialog::getSaveFileName(this, "Save File", "FastLLM", "Markdown (*.md)");
QString fileName = QFileDialog::getSaveFileName(this, "Save File", "Qui", "Markdown (*.md)");

if (!fileName.isEmpty())
{
Expand All @@ -49,7 +49,7 @@ FastLLM::wirteToFile()
}

void
FastLLM::sendAI()
Qui::sendAI()
{
if (ui.textEditUser->toPlainText().isEmpty())
{
Expand All @@ -76,7 +76,7 @@ FastLLM::sendAI()
}

void
FastLLM::onPathSelectModel()
Qui::onPathSelectModel()
{
QString dir = QFileDialog::getExistingDirectory(nullptr, QObject::tr("Open Directory"), modelPath);

Expand All @@ -91,22 +91,22 @@ FastLLM::onPathSelectModel()
}

void
FastLLM::onPathSelectFlm()
Qui::onPathSelectFlm()
{
QString filePath = QFileDialog::getOpenFileName(nullptr, QObject::tr("Open File"),
flmPath, QObject::tr("All Files (*)"));

if (filePath.isEmpty())
{
filePath = QCoreApplication::applicationDirPath() + "/fastllm.exe";
filePath = QCoreApplication::applicationDirPath() + "/Qui.exe";
}

ui.edPathFlm->setText(filePath);
flmPath = filePath;
}

void
FastLLM::runModelWithSetting()
Qui::runModelWithSetting()
{
ui.btnApplyModel->setEnabled(false);
ui.btnStopModel->setEnabled(true);
Expand Down Expand Up @@ -139,7 +139,7 @@ FastLLM::runModelWithSetting()
}

void
FastLLM::stopModelRuning()
Qui::stopModelRuning()
{
process->kill();
ui.btnApplyModel->setEnabled(true);
Expand All @@ -148,7 +148,7 @@ FastLLM::stopModelRuning()
}

bool
FastLLM::eventFilter(QObject *obj, QEvent *event)
Qui::eventFilter(QObject *obj, QEvent *event)
{
if (obj == ui.textEditUser && event->type() == QEvent::KeyPress)
{
Expand Down Expand Up @@ -189,7 +189,7 @@ convToUtf8(const QByteArray &ba)


void
FastLLM::readData()
Qui::readData()
{
QByteArray text = process->readAll();

Expand All @@ -200,14 +200,14 @@ FastLLM::readData()
}

void
FastLLM::finishedProcess()
Qui::finishedProcess()
{
int flag = process->exitCode();
stopModelRuning();
}

void
FastLLM::errorProcess()
Qui::errorProcess()
{
int err_code = process->exitCode();
QString err = process->errorString();
Expand All @@ -217,7 +217,7 @@ FastLLM::errorProcess()
}

void
FastLLM::updateModelList()
Qui::updateModelList()
{
ui.cbModelList->clear();
QDir dir(modelPath);
Expand Down
10 changes: 5 additions & 5 deletions example/QFastLLM/src/FastLLM.h → example/Qui/src/Qui.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#include <QFile>
#include <QTextStream>
#include <QMessageBox>
#include "ui_FastLLM.h"
#include "ui_Qui.h"
#include <QtNetwork>
#include <QKeyEvent>

class FastLLM : public QWidget
class Qui : public QWidget
{
Q_OBJECT

public:
FastLLM(QWidget *parent = nullptr);
~FastLLM() {};
Qui(QWidget *parent = nullptr);
~Qui() {};

private slots:
void clearChat();
Expand All @@ -38,7 +38,7 @@ private slots:
QProcess *process;

private:
Ui::FastLLMClass ui;
Ui::QuiClass ui;

QString modelPath = "";
QString flmPath = "";
Expand Down
9 changes: 4 additions & 5 deletions example/QFastLLM/src/FastLLM.pro → example/Qui/src/Qui.pro
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
QT += core gui svg widgets network
CONFIG += c++17

APP_NAME = QFastLLM
#RC_ICONS = Resource/Main/OSLite256.ico
APP_NAME = Qui
DESTDIR = ../bin


SOURCES += \
FastLLM.cpp \
Qui.cpp \
main.cpp

HEADERS += \
FastLLM.h \
Qui.h \
resource.h

FORMS += \
FastLLM.ui
Qui.ui

22 changes: 11 additions & 11 deletions example/QFastLLM/src/FastLLM.ui → example/Qui/src/Qui.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FastLLMClass</class>
<widget class="QWidget" name="FastLLMClass">
<class>QuiClass</class>
<widget class="QWidget" name="QuiClass">
<property name="geometry">
<rect>
<x>0</x>
Expand All @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>FastLLM</string>
<string>Qui</string>
</property>
<property name="styleSheet">
<string notr="true">QTextEdit
Expand Down Expand Up @@ -502,7 +502,7 @@ QLineEdit
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>FastLLM Path</string>
<string>Qui Path</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -919,7 +919,7 @@ QLineEdit
<connection>
<sender>btnClear</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>clearChat()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -935,7 +935,7 @@ QLineEdit
<connection>
<sender>btnWriteFile</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>wirteToFile()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -951,7 +951,7 @@ QLineEdit
<connection>
<sender>btnSend</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>sendAI()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -967,7 +967,7 @@ QLineEdit
<connection>
<sender>btnApplyModel</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>runModelWithSetting()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -983,7 +983,7 @@ QLineEdit
<connection>
<sender>btnPathModel</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>onPathSelectModel()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -999,7 +999,7 @@ QLineEdit
<connection>
<sender>toolButton</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>onPathSelectFlm()</slot>
<hints>
<hint type="sourcelabel">
Expand All @@ -1015,7 +1015,7 @@ QLineEdit
<connection>
<sender>btnStopModel</sender>
<signal>clicked()</signal>
<receiver>FastLLMClass</receiver>
<receiver>QuiClass</receiver>
<slot>stopModelRuning()</slot>
<hints>
<hint type="sourcelabel">
Expand Down
4 changes: 2 additions & 2 deletions example/QFastLLM/src/main.cpp → example/Qui/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "FastLLM.h"
#include "Qui.h"
#include <QtWidgets/QApplication>

int main(int argc, char* argv[])
Expand All @@ -11,7 +11,7 @@ int main(int argc, char* argv[])
a.installTranslator(&tran);
}

FastLLM w;
Qui w;
w.show();
return a.exec();
}

0 comments on commit 0fd01db

Please sign in to comment.