add debug window

This commit is contained in:
sonichy 2018-06-12 11:47:19 +08:00
parent a2704f788e
commit af1c5b2237
4 changed files with 8 additions and 2 deletions

BIN
HTYEdit

Binary file not shown.

View File

@ -3,7 +3,8 @@ Linux 平台基于 Qt 的文字编辑程序。
已编译好的 HTYEdit 程序适用 64 位 Linux 系统 Qt5 环境,双击运行,其他版本请自行编译。
![alt](preview.png)
![alt](debug.png)
### 1.3 新增调试窗口
### 1.1 [新增语法高亮](http://www.cnblogs.com/lenxvp/p/5475931.html)
高亮类具体工作过程没看懂,因为很好用先用着。

BIN
debug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@ -527,7 +527,12 @@ void MainWindow::updateCommand()
if (suffix == "c" || suffix == "cpp") {
ui->textBrowser->show();
QString s = ((QTextEdit*)(ui->mdiArea->currentSubWindow()->widget()))->toPlainText();
if (s.contains("#include <GL/")) {
QStringList SL;
foreach (const QString &str, s.split("\n")) {
if (str.startsWith("#include"))
SL += str;
}
if (SL.contains("#include <GL/")) {
lineEdit_command->setText("g++ %1 -o %2 -l GL -l GLU -l glut");
} else {
lineEdit_command->setText("g++ %1 -o %2");