aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/howto/creator-tips.qdoc
blob: ba30fd33cc4e70801a7cc438efa3e9685136856c (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
/****************************************************************************
**
** Copyright (c) 2014 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 {Qt Creator Manual}
    \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

        \li \uicontrol Welcome mode \key Ctrl+1
        \li \uicontrol Edit mode \key Ctrl+2
        \li \uicontrol Design mode \key Ctrl+3
        \li \uicontrol Debug mode \key Ctrl+4
        \li \uicontrol Projects mode \key Ctrl+5
        \li \uicontrol Analyze mode \key Ctrl+6
        \li \uicontrol 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 OS X). To move backward, press \key {Alt+Left}
    (\key {Cmd+Opt+Left} on OS X). For example, if you use the \uicontrol 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 \uicontrol Edit mode and currently active file, press
    \key Esc.

    If you already are in the \uicontrol Edit mode:

    \list

        \li The first press moves focus to the editor

        \li The second press closes secondary windows

    \endlist

    \section1 Using the Filter in Options Dialog

    To find specific settings you require in \uicontrol{Tools} > \uicontrol{Options}
    use the filter located at the top left of the \uicontrol 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

        \li \uicontrol{Issues} pane Alt+1 (Cmd+1 on OS X)

        \li \uicontrol{Search Results} pane Alt+2 (Cmd+2 on OS X)

        \li \uicontrol{Application Output} pane Alt+3 (Cmd+3 on OS X)

        \li \uicontrol{Compile Output} pane Alt+4 (Cmd+4 on OS X)

    \endlist

    To open the other output panes, such as \uicontrol{General Messages} and
    \uicontrol{Version Control}, select \uicontrol Window > \uicontrol {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 \uicontrol Tools >
    \uicontrol Options > \uicontrol Environment > \uicontrol 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.

    For more information, see \l{Using Command Line Options}.

    \section1 Showing and Hiding the Sidebar

    To toggle the sidebar in the \uicontrol Edit and \uicontrol Debug modes, click
    \inlineimage qtcreator-togglebutton.png
    or press \key Alt+0 (\key Cmd+0 on 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
    \uicontrol 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
    \uicontrol 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 OS X) and click a symbol to move directly to
    the definition or the declaration of the symbol. You can also move the
    cursor on the symbol and press \key {F2}. For more information, see
    \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 \uicontrol Tools > \uicontrol Options
    > \uicontrol{Debugger} > \uicontrol{Locals and Expressions} >
    \uicontrol{Use Debugging Helper}.

    In the \uicontrol{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 \uicontrol{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

        \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Debugger >
            \uicontrol{Locals and Expressions}.

        \li Uncheck the \uicontrol{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

        \li Select \uicontrol Tools > \uicontrol Options >
            \uicontrol Debugger > \uicontrol General.

        \li Select the \uicontrol {Use tooltips in main editor while debugging} check
            box.

    \endlist

    When you hover over a variable in the code editor in \uicontrol 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 \uicontrol {Close Editor Tooltips} in the context menu in the \uicontrol {Locals
    and Expressions} view.

    \section1 Locating Files

    The \uicontrol Locator provides one of the easiest ways in \QC to browse
    through projects, files, classes, functions, 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 \uicontrol {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
    \uicontrol{Tools > Options > C++ > License Template}. It may contain special
    placeholders enclosed in \c{%%} that are replaced when generating a
    new file:

    \list 1

        \li \c %YEAR%: Year
        \li \c %MONTH%: Month
        \li \c %DAY%: Day of the month
        \li \c %DATE%: Date
        \li \c %USER%: Username
        \li \c %FILENAME%: File name
        \li \c %CLASS%: Class name (if applicable)
        \li \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.

*/