Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkanpakdil committed May 12, 2024
1 parent 9f21dbb commit 2348eba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Install build tools
run: choco install -y InnoSetup qt5-default make #visualstudio2022buildtools windows-sdk-10.1 VisualCppBuildTools vcredist140
run: |
choco install -y InnoSetup qt5-default make pip
- name: Build
shell: cmd
run: |
SET PATH=%PATH%;C:\Qt\5.15.2\mingw81_64\bin;
SET PATH=%PATH%;C:\Qt\5.15.2\mingw81_64\bin;C:\Qt\5.15.2\mingw81_64\lib;
qmake big-file-editor.pro
make
del /q release\*.h release\*.cpp release\*.o
Expand Down
9 changes: 6 additions & 3 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ void MainWindow::on_actionOpen_triggered()
qDebug() << "file opened:" << file->open(QIODevice::ReadOnly | QIODevice::Text);
currentFileLineNumber = 0;

QString buffer;
for (int i = 0; i < pageSize; i++)
{
ui->textEdit->appendPlainText(this->readLineFromFile());
buffer.append(this->readLineFromFile());
buffer.append('\n');
}
ui->textEdit->setWordWrapMode(QTextOption::NoWrap);
ui->textEdit->setPlainText(buffer);

qDebug() << "file:" << fileName;
qDebug() << "lineCount:" << pageSize;
Expand Down Expand Up @@ -161,8 +165,7 @@ void MainWindow::wheelEvent(QWheelEvent* turning)
{
if (!isFileOpened())
return;
//qDebug()<<"wheel:"<<turning->delta();
if (turning->delta() > 0)
if (turning->angleDelta().y() > 0)
{
//mouse wheel up
}
Expand Down
1 change: 0 additions & 1 deletion mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
<customwidgets>
<customwidget>
<class>TextEditor</class>
<extends>QTextEdit</extends>
<header>texteditor.h</header>
</customwidget>
</customwidgets>
Expand Down
2 changes: 1 addition & 1 deletion texteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ void TextEditor::keyPressEvent ( QKeyEvent * event ){
if(event->key()==Qt::Key_End && event->modifiers()==Qt::ControlModifier){
emit goToEOF();
}

}


1 change: 0 additions & 1 deletion texteditor.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef TEXTEDITOR_H
#define TEXTEDITOR_H

#include <QTextEdit>
#include <QPlainTextEdit>

class TextEditor : public QPlainTextEdit
Expand Down

0 comments on commit 2348eba

Please sign in to comment.