Skip to content

Commit

Permalink
Program runs in maximized mode
Browse files Browse the repository at this point in the history
  • Loading branch information
athrvvvv committed Jul 27, 2022
1 parent 16ddd09 commit 061e22e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Minimal-Notepad.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 7.0.2, 2022-07-22T15:11:37. -->
<!-- Written by QtCreator 7.0.2, 2022-07-28T02:01:33. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -240,8 +240,9 @@
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/athar/OneDrive/Documents/hello_cpp/Minimal-Notepad/Minimal-Notepad.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/athar/OneDrive/Documents/hello_cpp/Minimal-Notepad/Minimal-Notepad.pro</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimal-Notepad2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/athar/OneDrive/Documents/hello_cpp/Minimal-Notepad/src/Minimal-Notepad.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/athar/OneDrive/Documents/hello_cpp/Minimal-Notepad/src/Minimal-Notepad.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
Expand Down
10 changes: 10 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->actionDark_mode, &QAction::toggled, [=]{
enable_dark_mode();
});
switch_max_normal();
}

MainWindow::~MainWindow()
Expand Down Expand Up @@ -235,3 +236,12 @@ void MainWindow::on_actionBold_triggered()
ui->textEdit->setText(sFullString);
}

void MainWindow::switch_max_normal(){
if(isMaximized()){
showNormal();
}
else{
showMaximized();
}
}

2 changes: 2 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ private slots:

void on_actionBold_triggered();

void switch_max_normal();

private:
Ui::MainWindow *ui;
QString file_path_;
Expand Down

0 comments on commit 061e22e

Please sign in to comment.