Cppcheck
gui
scratchpad.cpp
Go to the documentation of this file.
1
/*
2
* Cppcheck - A tool for static C/C++ code analysis
3
* Copyright (C) 2007-2023 Cppcheck team.
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#include "
scratchpad.h
"
20
21
#include "
codeeditor.h
"
22
#include "
mainwindow.h
"
23
24
#include "ui_scratchpad.h"
25
26
#include <QLineEdit>
27
#include <QPushButton>
28
29
ScratchPad::ScratchPad
(
MainWindow
& mainWindow)
30
: QDialog(&mainWindow)
31
, mUI(new
Ui
::
ScratchPad
)
32
, mMainWindow(mainWindow)
33
{
34
mUI
->setupUi(
this
);
35
36
connect(
mUI
->mCheckButton, &QPushButton::clicked,
this
, &
ScratchPad::checkButtonClicked
);
37
}
38
39
ScratchPad::~ScratchPad
()
40
{
41
delete
mUI
;
42
}
43
44
void
ScratchPad::translate
()
45
{
46
mUI
->retranslateUi(
this
);
47
}
48
49
void
ScratchPad::checkButtonClicked
()
50
{
51
QString filename =
mUI
->lineEdit->text();
52
if
(filename.isEmpty())
53
filename =
"test.cpp"
;
54
mMainWindow
.
analyzeCode
(
mUI
->plainTextEdit->toPlainText(), filename);
55
}
MainWindow
Main window for cppcheck-gui.
Definition:
mainwindow.h:58
MainWindow::analyzeCode
void analyzeCode(const QString &code, const QString &filename)
Analyze given code.
Definition:
mainwindow.cpp:625
ScratchPad
A window with a text field that .
Definition:
scratchpad.h:37
ScratchPad::~ScratchPad
~ScratchPad() override
Definition:
scratchpad.cpp:39
ScratchPad::ScratchPad
ScratchPad(MainWindow &mainWindow)
Definition:
scratchpad.cpp:29
ScratchPad::mUI
Ui::ScratchPad * mUI
Definition:
scratchpad.h:55
ScratchPad::translate
void translate()
Translate dialog.
Definition:
scratchpad.cpp:44
ScratchPad::mMainWindow
MainWindow & mMainWindow
Definition:
scratchpad.h:56
ScratchPad::checkButtonClicked
void checkButtonClicked()
Called when check button is clicked.
Definition:
scratchpad.cpp:49
codeeditor.h
mainwindow.h
Ui
Definition:
aboutdialog.h:27
scratchpad.h
Generated on Tue May 14 2024 11:53:15 for Cppcheck by
1.9.1