Skip to content

Commit 06b9cdb

Browse files
author
Daniel Marjamäki
committed
GUI: Updated online-help. This is still under work.
1 parent 7b2b844 commit 06b9cdb

30 files changed

Lines changed: 351 additions & 20 deletions

gui/gui.pro

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
TEMPLATE = app
22
TARGET = gui
33
QT += xml
4-
CONFIG += warn_on
4+
CONFIG += warn_on help
55
DEPENDPATH += . \
66
../lib
77
INCLUDEPATH += . \
@@ -29,7 +29,8 @@ FORMS = main.ui \
2929
file.ui \
3030
projectfile.ui \
3131
about.ui \
32-
logview.ui
32+
logview.ui \
33+
helpwindow.ui
3334

3435
TRANSLATIONS = cppcheck_fi.ts \
3536
cppcheck_nl.ts \
@@ -65,7 +66,8 @@ HEADERS += mainwindow.h \
6566
translationhandler.h \
6667
csvreport.h \
6768
logview.h \
68-
filelist.h
69+
filelist.h \
70+
helpwindow.h
6971

7072
SOURCES += main.cpp \
7173
mainwindow.cpp\
@@ -89,7 +91,8 @@ SOURCES += main.cpp \
8991
translationhandler.cpp \
9092
csvreport.cpp \
9193
logview.cpp \
92-
filelist.cpp
94+
filelist.cpp \
95+
helpwindow.cpp
9396

9497
win32 {
9598
DEFINES += _CRT_SECURE_NO_WARNINGS

gui/gui.qrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
<file>images/view-refresh.png</file>
1515
<file>images/showerrors.png</file>
1616
<file>images/showstylewarnings.png</file>
17-
18-
<file>help/online-help.qhc</file>
1917

2018
<file alias="COPYING">../COPYING</file>
2119
<file alias="AUTHORS">../AUTHORS</file>

gui/help/ch01.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 1. Introduction</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="index.html" title="Cppcheck 1.44"><link rel="prev" href="index.html" title="Cppcheck 1.44"><link rel="next" href="ch02.html" title="Chapter 2. Getting started"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="id2602221"></a>Chapter 1. Introduction</h2></div></div></div><p>Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers
2+
and many other analysis tools, it doesn't detect syntax errors. Cppcheck
3+
only detects the types of bugs that the compilers normally fail to detect.
4+
The goal is no false positives.</p><p>Supported code and platforms:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>You can check non-standard code that includes various compiler
5+
extensions, inline assembly code, etc.</p></li><li class="listitem"><p>Cppcheck should be compilable by any C++ compiler that handles
6+
the latest C++ standard.</p></li><li class="listitem"><p>Cppcheck should work on any platform that has sufficient cpu and
7+
memory.</p></li></ul></div><p>Accuracy</p><p>Please understand that there are limits of Cppcheck. Cppcheck is
8+
rarely wrong about reported errors. But there are many bugs that it
9+
doesn't detect.</p><p>You will find more bugs in your software by testing your software
10+
carefully, than by using Cppcheck. You will find more bugs in your
11+
software by instrumenting your software, than by using Cppcheck. But
12+
Cppcheck can still detect some of the bugs that you miss when testing and
13+
instrumenting your software.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Cppcheck 1.44 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Getting started</td></tr></table></div></body></html>

gui/help/ch02.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 2. Getting started</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="index.html" title="Cppcheck 1.44"><link rel="prev" href="ch01.html" title="Chapter 1. Introduction"><link rel="next" href="ch02s02.html" title="Checking all files in a folder"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Getting started</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 2. Getting started"><div class="titlepage"><div><div><h2 class="title"><a name="id2607467"></a>Chapter 2. Getting started</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch02.html#id2623157">First test</a></span></dt><dt><span class="section"><a href="ch02s02.html">Checking all files in a folder</a></span></dt><dt><span class="section"><a href="ch02s03.html">Excluding a file or folder from checking</a></span></dt><dt><span class="section"><a href="ch02s04.html">Stylistic issues</a></span></dt><dt><span class="section"><a href="ch02s05.html">Saving results in file</a></span></dt><dt><span class="section"><a href="ch02s06.html">Unused functions</a></span></dt><dt><span class="section"><a href="ch02s07.html">Enable all checks</a></span></dt><dt><span class="section"><a href="ch02s08.html">Multithreaded checking</a></span></dt></dl></div><div class="section" title="First test"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2623157"></a>First test</h2></div></div></div><p>Here is a simple code</p><pre class="programlisting">int main()
2+
{
3+
char a[10];
4+
a[10] = 0;
5+
return 0;
6+
}</pre><p>If you save that into <code class="filename">file1.c</code> and
7+
execute:</p><pre class="programlisting">cppcheck file1.c</pre><p>The output from cppcheck will then be:</p><pre class="programlisting">Checking file1.c...
8+
[file1.c:4]: (error) Array 'a[10]' index 10 out of bounds</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Checking all files in a folder</td></tr></table></div></body></html>

gui/help/ch02s02.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Checking all files in a folder</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="ch02.html" title="Chapter 2. Getting started"><link rel="prev" href="ch02.html" title="Chapter 2. Getting started"><link rel="next" href="ch02s03.html" title="Excluding a file or folder from checking"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Checking all files in a folder</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Getting started</th><td width="20%" align="right"> <a accesskey="n" href="ch02s03.html">Next</a></td></tr></table><hr></div><div class="section" title="Checking all files in a folder"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2622001"></a>Checking all files in a folder</h2></div></div></div><p>Normally a program has many sourcefiles. And you want to check
2+
them all. Cppcheck can check all sourcefiles in a directory:</p><pre class="programlisting">cppcheck path</pre><p>If "path" is a folder then cppcheck will check all sourcefiles in
3+
this folder.</p><pre class="programlisting">Checking path/file1.cpp...
4+
1/2 files checked 50% done
5+
Checking path/file2.cpp...
6+
2/2 files checked 100% done</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Getting started </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Excluding a file or folder from checking</td></tr></table></div></body></html>

gui/help/ch02s03.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Excluding a file or folder from checking</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="ch02.html" title="Chapter 2. Getting started"><link rel="prev" href="ch02s02.html" title="Checking all files in a folder"><link rel="next" href="ch02s04.html" title="Stylistic issues"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Excluding a file or folder from checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Getting started</th><td width="20%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr></table><hr></div><div class="section" title="Excluding a file or folder from checking"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2634899"></a>Excluding a file or folder from checking</h2></div></div></div><p>There is no command to exclude a file or folder from checking. But
2+
you can exclude a file or folder by being more careful when including
3+
files and folders in the checking.</p><p>Imagine for example that the folder "src" contain the folders "a",
4+
"b" and "c". To exclude "c" this command can be used:</p><pre class="programlisting">cppcheck src/a src/b</pre><p>All files under "src/a" and "src/b" are then checked.</p><p>The flag <code class="literal">--file-list</code> might also be
5+
useful.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Checking all files in a folder </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Stylistic issues</td></tr></table></div></body></html>

gui/help/ch02s04.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Stylistic issues</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="ch02.html" title="Chapter 2. Getting started"><link rel="prev" href="ch02s03.html" title="Excluding a file or folder from checking"><link rel="next" href="ch02s05.html" title="Saving results in file"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Stylistic issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Getting started</th><td width="20%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr></table><hr></div><div class="section" title="Stylistic issues"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2634936"></a>Stylistic issues</h2></div></div></div><p>By default Cppcheck will only check for bugs. There are also a few
2+
checks for stylistic issues.</p><p>Here is a simple code example:</p><pre class="programlisting">void f(int x)
3+
{
4+
int i;
5+
if (x == 0)
6+
{
7+
i = 0;
8+
}
9+
}</pre><p>To enable stylistic checks, use the --style flag:</p><pre class="programlisting">cppcheck --enable=style file1.c</pre><p>The reported error is:</p><pre class="programlisting">[file3.c:3]: (style) The scope of the variable i can be limited</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Excluding a file or folder from checking </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Saving results in file</td></tr></table></div></body></html>

gui/help/ch02s05.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Saving results in file</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="ch02.html" title="Chapter 2. Getting started"><link rel="prev" href="ch02s04.html" title="Stylistic issues"><link rel="next" href="ch02s06.html" title="Unused functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Saving results in file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Getting started</th><td width="20%" align="right"> <a accesskey="n" href="ch02s06.html">Next</a></td></tr></table><hr></div><div class="section" title="Saving results in file"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2588297"></a>Saving results in file</h2></div></div></div><p>Many times you will want to save the results in a file. You can
2+
use the normal shell redirection for piping error output to a
3+
file.</p><pre class="programlisting">cppcheck file1.c 2&gt; err.txt</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Stylistic issues </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Unused functions</td></tr></table></div></body></html>

gui/help/ch02s06.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Unused functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="ch02.html" title="Chapter 2. Getting started"><link rel="prev" href="ch02s05.html" title="Saving results in file"><link rel="next" href="ch02s07.html" title="Enable all checks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Unused functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Getting started</th><td width="20%" align="right"> <a accesskey="n" href="ch02s07.html">Next</a></td></tr></table><hr></div><div class="section" title="Unused functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2588316"></a>Unused functions</h2></div></div></div><p>This check will try to find unused functions. It is best to use
2+
this when the whole program is checked, so that all usages is seen by
3+
cppcheck.</p><pre class="programlisting">cppcheck --enable=unusedFunctions path</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Saving results in file </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Enable all checks</td></tr></table></div></body></html>

gui/help/ch02s07.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Enable all checks</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.1"><link rel="home" href="index.html" title="Cppcheck 1.44"><link rel="up" href="ch02.html" title="Chapter 2. Getting started"><link rel="prev" href="ch02s06.html" title="Unused functions"><link rel="next" href="ch02s08.html" title="Multithreaded checking"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Enable all checks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s06.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Getting started</th><td width="20%" align="right"> <a accesskey="n" href="ch02s08.html">Next</a></td></tr></table><hr></div><div class="section" title="Enable all checks"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2588334"></a>Enable all checks</h2></div></div></div><p>To enable all checks your can use the
2+
<code class="literal">--enable=all</code> flag:</p><pre class="programlisting">cppcheck --enable=all path</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Unused functions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Multithreaded checking</td></tr></table></div></body></html>

0 commit comments

Comments
 (0)