summaryrefslogtreecommitdiff
path: root/doc/src/howto/creator-tips.qdoc
blob: 7fef2f893ef731b6f1c992dfea8626156a03087e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
/****************************************************************************
**
** Copyright (c) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!
    \contentspage index.html
    \previouspage creator-faq.html
    \page creator-tips.html
    \nextpage creator-known-issues.html

    \title Tips and Tricks

    \section1 Switching Between Modes

    \QC uses different modes for different purposes. You can quickly
    switch between these modes with the following keyboard shortcuts:

    \list

        \o  \gui Welcome mode \key Ctrl+1
        \o  \gui Edit mode \key Ctrl+2
        \o  \gui Design mode \key Ctrl+3
        \o  \gui Debug mode \key Ctrl+4
        \o  \gui Projects mode \key Ctrl+5
        \o  \gui Analyze mode \key Ctrl+6
        \o  \gui Help mode \key Ctrl+7

    \endlist

    For more information about \QC modes, see \l {Modes}.

    \section1 Moving Between Open Files

    To quickly move between currently open files, press
    \key Ctrl+Tab.

    To move forward in the location history, press \key {Alt+Right}
    (\key {Cmd+Opt+Right} on Mac OS). To move backward, press \key {Alt+Left}
    (\key {Cmd+Opt+Left} on Mac OS). For example, if you use the \gui Locator
    to jump to a symbol in the same file, you can jump back to your original
    location in that file by pressing \key {Alt+Left}.

    \section1 Moving To the Edit Mode

    To move to the \gui Edit mode and currently active file, press
    \key Esc.

    If you already are in the \gui Edit mode:

    \list

        \o  The first press moves focus to the editor

        \o  The second press closes secondary windows

    \endlist

    \section1 Using the Filter in Options Dialog

    To find specific settings you require in \gui{Tools} > \gui{Options}
    use the filter located at the top left of the \gui Options dialog box.

    \section1 Opening Output Panes

    The output panes provide a list of errors and warnings encountered during
    a build, detailed output from the compiler, status of a program when it is
    executed and debug output, as well as search results.

    To open output panes, use the following shortcuts:

    \list

        \o  \gui{Issues} pane Alt+1 (Cmd+1 on Mac OS X)

        \o  \gui{Search Results} pane Alt+2 (Cmd+2 on Mac OS X)

        \o  \gui{Application Output} pane Alt+3 (Cmd+3 on Mac OS X)

        \o  \gui{Compile Output} pane Alt+4 (Cmd+4 on Mac OS X)

    \endlist

    To open the other output panes, such as \gui{General Messages} and
    \gui{Version Control}, select \gui Window > \gui {Output Panes}. The menu
    items also display the keyboard shortcuts that you can use.

    For more information about output panes, see \l{Viewing Output}.

    \section1 Using Keyboard Shortcuts

    \QC provides \l{Keyboard Shortcuts}{many useful keyboard shortcuts}.
    You can see the keyboard shortcut for a menu command in the menu
    or the tooltip for a button.

    To customize, import or export keyboard shortcuts, select \gui Tools >
    \gui Options > \gui Environment > \gui Keyboard.

    \section1 Running \QC From Command Line

    You can launch \QC from command line using the name of an
    existing session or \c .pro file by giving the name as the command
    argument.

    For example, running \tt{qtcreator somesession}, launches \QC and
    loads session somesession.

    \note Make sure \QC is included in the PATH environment variable.
    This can be done by typing the following in the command line:
    \code
    set PATH=c:\qtsdk\mingw\bin;c:\qtsdk\qt\bin;%PATH%
    \endcode

    \section1 Showing and Hiding the Sidebar

    To toggle the sidebar in the \gui Edit and \gui Debug modes, click
    \inlineimage qtcreator-togglebutton.png
    or press \key Alt+0 (\key Cmd+0 on Mac OS X).

    For more information on using the sidebar, see
    \l {Browsing Project Contents}.

    \section1 Moving To Symbols

    To move straight to a symbol used in a project, select the symbol in the
    \gui Editor toolbar drop-down menu. For more information on the editor
    toolbar, see \l {Using the Editor Toolbar}.

    To jump to a symbol in the current file, press \key {Ctrl+K} to open the
    \gui Locator, enter a period (.), and start typing the symbol name. Then
    select the symbol in the list. For more information on using the locator,
    see \l{Searching with the Locator}.

    Press \key Ctrl (\key Cmd on Mac OS) and click a symbol to move directly to
    the definition or the declaration of the symbol. You can also move the
    on the symbol and press \key {F2}. For more information, see
    cursor \l{Moving to Symbol Definition or Declaration}.

    \section1 Displaying Signals and Slots

    If an instance of a class is derived from QObject, and you would like to
    find all other objects connected to one of your object's slots using
    Qt's signals and slots mechanism, select \gui Tools > \gui Options
    > \gui{Debugger} > \gui{Debugging Helper} > \gui{Use Debugging Helper}.

    In the \gui{Locals and Expressions} view, expand the object's entry and open
    the slot in the \e slots subitem. The objects connected to this slot are
    shown as children of the slot. This method works with signals too.

    For more information about the \gui{Locals and Expressions} view, see
    \l{Locals and Expressions}.

    \section1 Displaying Low Level Data

    If special debugging of Qt objects fails due to data corruption within the
    debugged objects, you can switch off the debugging helpers. When debugging
    helpers are switched off low-level structures become visible.

    To switch off the debugging helpers:
    \list 1

        \o  Select \gui Tools > \gui Options > \gui Debugger >
            \gui{Debugging Helper}.

        \o  Uncheck the \gui{Use Debugging Helper} checkbox.

    \endlist

    \section1 Showing Tooltips in Debug Mode

    To inspect the value of variables from the editor, you can turn
    on tooltips. Tooltips are hidden by default for performance reasons.

    \list 1

        \o  Select \gui Tools > \gui Options > \gui Debugger > \gui General.

        \o  Select the \gui {Use tooltips in main editor while debugging} check
            box.

    \endlist

    When you hover over a variable in the code editor in \gui Debug mode, a
    tooltip is displayed. To keep the tooltip visible, click the pin button.
    You can expand pinned tooltips to view their full content.

    \image qtcreator-pin-tooltip.png

    Pinned tooltips are stored in the session. To close all pinned tooltips,
    select \gui {Close Editor Tooltips} in the context menu in the \gui {Locals
    and Expressions} view.

    \section1 Locating Files

    The \gui Locator provides one of the easiest ways in \QC to browse
    through projects, files, classes, methods, documentation and file systems.
    To quickly access files not directly mentioned in your project, you can
    create your own locator filters. That way you can locate files in a
    directory structure you have defined.

    To create locator filters, select \gui {Tools > Options > Locator > Add}.

    For more information, see \l{Creating Locator Filters}.

    \section1 Adding a License Header Template for C++ Code

    A file containing a license header for C++ can be specified under
    \gui{Tools > Options > C++ > License Template}. It may contain special
    placeholders enclosed in \c{%%} that are replaced when generating a
    new file:

    \list 1

        \o  \c %YEAR%: Year
        \o  \c %MONTH%: Month
        \o  \c %DAY%: Day of the month
        \o  \c %DATE%: Date
        \o  \c %USER%: User name
        \o  \c %FILENAME%: File name
        \o  \c %CLASS%: Class name (if applicable)
        \o  \c %$VARIABLE%: Contents of environment variable \c{VARIABLE}.

    \endlist

    \section1 Pasting from Clipboard History

    \QC stores copied text in clipboard history. To retrieve clips from the
    history, press \key {Ctrl+Shift+V} until the clip appears.

*/