]> git.sesse.net Git - vlc/blob - modules/gui/qt4/HACKING
Fix potential segfault.
[vlc] / modules / gui / qt4 / HACKING
1 Small Hacking file for the Qt Interface
2
3 If you ever code for Qt4 interface, please read this before.
4
5 ** Code Convetions **
6
7 Please respect VLC code conventions here:
8  - NO trailing spaces
9  - NO tab
10  - Indentation is 4 spaces
11  - Braces ARE indented
12  - Space before and after operators
13  - Case labels are on the same column as the switch
14
15 Refer to http://wiki.videolan.org/Code_Conventions it should be up to date
16
17 ** Include order **
18
19 - VLC include/*.h includes
20 - Other VLC .h includes (gruiking :D)
21 - Qt4 module includes
22 - Qt includes
23
24 ** Naming **
25 This naming is stupid and inconsistent :D
26
27 Try to prefix with psz_, i_, b_, ui_ for the normal basic C/C++ styles.
28
29 If you have spare time, prefix QString with qs_.
30
31 Use aPointerName over a_pointer_name for long names.
32
33 ** QVLCFrame vs QVLCDialog **
34
35 A QVLCFrame is just a QWidget, without any parent and used as a Qt::Windows
36 A QVLCDialog is a QDialog.
37
38 This mean that the QVLCDialog is centered on the parent and ABOVE it, will be destroyed by the parent automatically.
39 This also mean that you have to destroy the QVLCFrame and to save its position/size.
40
41 So if your dialog is a dialog you are used to keep during a playing of a video, then use a QVLCFrame, else use a QVLCDialog, if this is something you do over anything else.
42
43 QVLCFrame: extended panel, messages...
44 QVLCDialog: preferences, open...
45
46 ** HIG for Qt4 **
47 We tend to use GNOME/KDE specs over Vista ones for capitalizations:
48 We use Header for:
49  - Menu
50  - Menu items
51  - GroupBox Titles
52  - Windows and dialog Titles
53 We use Sentence for:
54  - CheckBoxes
55  - ComboBox list
56  - ComboBox labels
57  - Tooltips
58
59 We use "..." after a menu item if it opens another dialog.