Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f65c2a50
Commit
f65c2a50
authored
Mar 31, 2009
by
dt
Browse files
Merge commit 'origin/master'
parents
e042c4d0
dcbe9115
Changes
51
Hide whitespace changes
Inline
Side-by-side
bin/qtcreator
View file @
f65c2a50
...
...
@@ -6,4 +6,4 @@ if test "$(uname -m)" = "x86_64" ; then
else
libdir
=
$(
cd
${
bindir
}
/../lib
;
pwd
)
fi
LD_LIBRARY_PATH
=
"
${
libdir
}
:
${
LD_LIBRARY_PATH
}
"
"
${
bindir
}
/qtcreator.bin"
${
1
+
"
$@
"
}
LD_LIBRARY_PATH
=
"
${
libdir
}
/qtcreator
:
${
LD_LIBRARY_PATH
}
"
exec
"
${
bindir
}
/qtcreator.bin"
${
1
+
"
$@
"
}
doc/qtcreator.qdoc
View file @
f65c2a50
...
...
@@ -11,12 +11,11 @@
Development Environment (IDE) to develop Qt projects. It is available for
the Linux, Mac OS X and Windows platforms.
\note Please report bugs and
suggestions to the Qt Software task tracker at
http://www.qtsoftware.com/developer/task-tracker.
You can also join the discussion list qt-creator@trolltech.com. To subscribe, send a
message with the word \e subscribe to qt-creator-request@trolltech.com.
For more information on Qt mailing lists, visit http://lists.trolltech.com
\note Please report bugs and suggestions to the Qt Software task tracker at
http://www.qtsoftware.com/developer/task-tracker. You can also join the
qt-creator@trolltech.com mailing list. To subscribe, send a message with
the word \e subscribe to qt-creator-request@trolltech.com. For more
information on Qt mailing lists, visit http://lists.trolltech.com
\image qtcreator-screenshots.png
...
...
@@ -105,7 +104,7 @@
description of how to use this mode.
\o \gui{Projects Mode} - Lets you configure how projects can be built and
executed. Under the list of projects, there are tabs to configure the
executed. Under the list of projects, there are tabs to configure the
build, run, and editor settings.
\o \gui{Help Mode} - Shows any documentation registered by Qt Assistant,
...
...
@@ -161,8 +160,8 @@
In Qt Creator, a session is a collection of loaded projects, opened files,
editor settings, and so on. When you run Qt Creator, you have a default
session. You can create a new session using the \gui{Session Manager...}
,
available in the \gui{File -> Session} menu.
session. You can create a new session using the \gui{Session Manager...}
option,
available in the \gui{File -> Session} menu.
\image qtcreator-session-manager.png
...
...
@@ -202,7 +201,7 @@
\section1 Keyboard Navigation
Qt Creator caters not only to developers who are used to using the mouse,
but also to developers who are more comfortable with the keyboard. A wide
range of \l{keyboard-shortcuts}{keyboard} and
...
...
@@ -243,7 +242,7 @@
\i Block selection
\i To select a current block, use \key{Ctrl+U}. Pressing
\key{Ctrl+U} again extends the selection to the parent block.
To deselect, use \key{Ctrl+Shift+U}.
To deselect, use \key{Ctrl+Shift+U}.
\row
\i Moving lines up and down
\i Use \key{Ctrl+Shift+Up} and \key{Ctrl+Shift+Down}
...
...
@@ -324,14 +323,14 @@
When you select a build configuration in the tree, a configuration page for
general build settings will be displayed. Here you can specify which
\l{glossary-project-qt}{Qt version} to use to build your project, whether
to \l{glossary-shadow-build}{shadow build} the project.
to \l{glossary-shadow-build}{shadow build} the project
, for instance
.
\image qtcreator-buildenvironment.png
In the \bold{Build Environment} page you can specify the environment used
for building. By default the environment in which Qt Creator was started
is used and modified to include the Qt version. Depending on the selected
Qt version, Qt Creator will automatically
add
the necessary environment
Qt version, Qt Creator will automatically
set
the necessary environment
variables.
\image qtcreator-buildsteps.png
...
...
@@ -402,12 +401,12 @@
\table
\row
\i \inlineimage qtcreator-new-project.png
\i \inlineimage qtcreator-new-project.png
\i \bold{Creating a New Project}
To create a new project, select \gui{New Project} from the \gui{File} menu.
You can create one of the following three projects:
\list
\o Qt4 Console Application
\o Qt4 Gui Application
...
...
@@ -417,7 +416,7 @@
In this example, we select a \e{Qt4 Gui Application} and click \gui{OK}.
\row
\i \inlineimage qtcreator-intro-and-location.png
\i \inlineimage qtcreator-intro-and-location.png
\i \bold{Setting the Project name and location}
Next, we set the project's name and its path. Click on the \gui{...}
...
...
@@ -426,7 +425,7 @@
Ideally, the path should not contain spaces or special characters.
\row
\i \inlineimage qtcreator-select-modules.png
\i \inlineimage qtcreator-select-modules.png
\i \bold{Selecting The Necessary Qt Modules}
Click on the check boxes of each Qt Module you would like to include in
...
...
@@ -436,7 +435,7 @@
set, but you are free to add more.
\row
\i \inlineimage qtcreator-class-info.png
\i \inlineimage qtcreator-class-info.png
\i \bold{Specifying Class Information}
Specify the name of the class you would like to create. The
...
...
@@ -447,12 +446,12 @@
QWidget, QDialog or QMainWindow, from the drop down box.
\row
\i \inlineimage qtcreator-new-project-summary.png
\i \inlineimage qtcreator-new-project-summary.png
\i \bold{Creating the Project}
Finally, review the files that will be created for you. Click
\gui{Done} and your project will be generated.
\endtable
*/
...
...
@@ -469,7 +468,7 @@
\row
\o \note This tutorial assumes that the user has experience writing
basic Qt applications, designing user interfaces with Qt Designer
and
and
using the Qt Resource System.
and using the Qt Resource System.
\endtable
...
...
@@ -493,8 +492,8 @@
\o On Mac OS X: in \gui{Preferences}, under \gui{Qt4}.
\endlist
\note If
Qt was compiled with Visual Studio
, all environment variables set
in Visual Studio will be
added to
Qt Creator as well.
\note If
you use Visual Studio to compile Qt
, all environment variables set
in Visual Studio will be
set for
Qt Creator as well.
\section1 Setting Up The Project
...
...
@@ -513,7 +512,7 @@
\o \c{textfinder.ui}
\o \c{textfinder.pro}
\endlist
The \c{.h} and \c{.cpp} files come with the necessary boiler plate code;
the \c{.pro} file is also complete.
...
...
@@ -543,7 +542,7 @@
\l{http://doc.trolltech.com/qtextedit.html}{QTextEdit} can then be added to
a \l{http://doc.trolltech.com/qvboxlayout.html}{QVBoxLayout}, along with
the \l{http://doc.trolltech.com/qgridlayout.html}{QGridLayout}. If you are
new to designing forms with \QD, you can take a look at the
new to designing forms with \QD, you can take a look at the
\l{http://doc.trolltech.com/designer-manual.html}{Designer Manual}.
\section2 The Header File
...
...
@@ -641,10 +640,10 @@
\section1 Compiling and Running Your Program
Now that you have all the necessary files, you can compile your program by
clicking on the
clicking on the
\inlineimage qtcreator-run.png
button.
*/
...
...
@@ -831,9 +830,9 @@
Suppose you would like to open your project's \c{main.cpp} file, click on
\gui Locator or use \key{Ctrl+K}, type in the file name and then press
\key Return. The file will be opened in the editor. You can also type
part of a file name and use wildcard characters \c{*} and \c{?} to
match
\e{any} number of \e{any} characters. A list of all files matching
your
criteria will be displayed.
part of a file name and use
the
wildcard characters \c{*} and \c{?} to
match
\e{any} number of \e{any} characters. A list of all files matching
your
criteria will be displayed.
\gui Locator not only allows you to navigate files on disk but also other
"locations", which are organized with \bold{Filters}. Currently there are
...
...
@@ -868,14 +867,14 @@
Filters can be added to provide quick navigation around files in a
subdirectory structure defined by you. This way, you can acccess files you
need, that are not directly mentioned in your project. Click on
need, that are not directly mentioned in your project. Click on
\image qtcreator-locator-magnify.png
and choose \gui{Configure...} from the menu displayed.
\image qtcreator-locator-customize.png
This
then
displays the \gui Preferences dialog (\gui Options on Mac Os X)
for
navigation filters. Click \gui Add to create a new filter. In the
This displays the \gui Preferences dialog (\gui Options on Mac Os X)
for
navigation filters. Click \gui Add to create a new filter. In the
\gui{Filter Configuration} dialog below, give your filter a name, select
your preferred directories, set file patterns with a comma separated list,
and specify a prefix string.
...
...
@@ -947,10 +946,10 @@
\title Debugging with Qt Creator
\table
\row
\row
\i \note Qt Creator's debugger integration currently does not
support debugging applications created with the Microsoft Visual
Studio
Compiler.
C++
Compiler.
\endtable
Qt Creator does not have its own debugger. Instead, it provides a graphical
...
...
@@ -959,7 +958,6 @@
interrupt running programs, set breakpoints, examine the contents of the
call stack, local and global variables, etc.
Within Qt Creator, the raw information provided by gdb is displayed in a
clear and concise manner, simplifying the process of debugging.
...
...
@@ -994,9 +992,9 @@
being debugged is not running.
A breakpoint represents a position or sets of positions in the code that,
when executed,
stop
s the program being debugged and passing the
control to
the user. The user is then free to examine the state of the
interrupted
program, or continue execution line-by-line or continuously.
when executed,
interrupt
s the program being debugged and passing the
control to
the user. The user is then free to examine the state of the
interrupted
program, or continue execution line-by-line or continuously.
Typically, breakpoints are associated with a source code file and line, or
the start of a function -- both allowed in Qt Creator.
...
...
@@ -1009,7 +1007,7 @@
\list
\o At a particular line you want the program to stop -- click on the
left margin or press \key F9 (\key F8 for Mac OS X).
\o At a function that you want the program to
stop
-- enter the
\o At a function that you want the program to
interrupt
-- enter the
function's name in \gui{Set Breakpoint at Function...} under the
\gui Debug menu.
\endlist
...
...
@@ -1036,17 +1034,15 @@
checks whether the compiled program is up-to-date, rebuilding it if
necessary. The debugger then takes over and starts the program.
\note Starting a program in the debugger
will
take considerable amount of
\note Starting a program in the debugger
can
take considerable amount of
time, typically in the range of several seconds to minutes if complex
features (like QtWebKit) are used.
features (like QtWebKit) are used.
Once the program starts running, it behaves as usual; performance-wise as
well. The user can interrupt a running program by selecting
\gui {Interrupt} from the \gui{Debug} menu. The program is automatically
interrupted as soon as a breakpoint is hit.
\omit (and, if set, its associated conditions are met). \endomit
Once the program stops, Qt Creator:
\list
...
...
@@ -1071,28 +1067,29 @@
\section2 Stack
When the program being debugged is
stopp
ed, Qt Creator displays the
nested
function calls leading to the current position as a \e call stack
trace.
This stack trace is built up from \e{call stack frames}, each
representing a
particular function. For each function, Qt Creator will try
to retrieve the
file name and line number of the corresponding source
files. This data is
shown in the \gui Stack view.
When the program being debugged is
interrupt
ed, Qt Creator displays the
nested
function calls leading to the current position as a \e call stack
trace.
This stack trace is built up from \e{call stack frames}, each
representing a
particular function. For each function, Qt Creator will try
to retrieve the
file name and line number of the corresponding source
files. This data is
shown in the \gui Stack view.
\image qtcreator-debug-stack.png
Since the call stack leading to the current position may originate or go
through code for which no debug information is available, not all stack
frames will have corresponding source locations. These frames will be
gr
e
yed out in the \gui Stack view.
gr
a
yed out in the \gui Stack view.
If you click on a frame with a known source location, the text editor will
jump to the corresponding location and update the \gui{Locals and Watchers}
view, making it seem like the program stopped before entering the function.
view, making it seem like the program was interrupted before entering the
function.
\section2 Threads
If a multi-threaded program is
stopp
ed, the \gui Thread view or the
If a multi-threaded program is
interrupt
ed, the \gui Thread view or the
combobox named \gui Thread in the debugger's status bar can be used to
switch from one thread to another. The \gui Stack view will adjust itself
accordingly.
...
...
@@ -1147,15 +1144,15 @@
The \gui{Locals and Watchers} view can be used to change the contents of
variables of simple data types such as \c int or \c float when the program
is
stopp
ed. To do so, click on the \gui Value column, modify the value
is
interrupt
ed. To do so, click on the \gui Value column, modify the value
with the inplace editor, and hit \key Enter (or \key Return).
\section2 Modules
By default, the \gui Modules view is hidden as it is only useful with the
experimental delayed loaing of debug information feature. You can turn
this feature on by selecting \gui{Fast Debugger Start}
this feature on by selecting \gui{Fast Debugger Start}
With this feature, debug information from the Qt library itself is not
...
...
@@ -1163,7 +1160,8 @@
for some applications. You can then use the \gui Modules view to manually
load this information, if required.
\note In this scenario, some breakpoints may not be set by the debugger.
\note In this scenario, some breakpoints may not be triggered by the
debugger.
\section2 Disassembler View and Registers View
...
...
@@ -1184,7 +1182,7 @@
\table
\row
\i \inlineimage qtcreator-setting-breakpoint1.png
\i \inlineimage qtcreator-setting-breakpoint1.png
\i \bold{Setting a Breakpoint}
First, we set a breakpoint on the line where we invoke
...
...
@@ -1222,7 +1220,7 @@
bool found = cursor.isNull();
if (!found && previouslyFound
== true
) {
if (!found && previouslyFound) {
int ret = QMessageBox::question(this, tr("End of Document"),
tr("I have reached the end of the document. Would you like "
"me to start searching from the beginning of the document?"),
...
...
@@ -1289,10 +1287,9 @@
\bold{Display Low Level Data}
If the special debugging of Qt objects fails due to data
corruption within the debugged objects, you can switch the
special debugging off in the \gui{Debug} menu. This will make
the low-level structures visible again.
If special debugging of Qt objects fails due to data corruption within the
debugged objects, you can switch the special debugging off in the
\gui{Debug} menu. This will make the low-level structures visible again.
*/
...
...
@@ -1304,6 +1301,19 @@
\title Keyboard Shortcuts
\raw HTML
<center>
<object width="480" height="295"><param name="movie"
value="http://www.youtube.com/v/6WGCxLIjRNg&hl=en&fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/6WGCxLIjRNg&hl=en&fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="480" height="295"></embed></object>
</center>
\endraw
Qt Creator provides various keyboard shortcuts to aid in the development
process. These shortcuts are listed in the table below:
...
...
share/share.pri
View file @
f65c2a50
...
...
@@ -13,14 +13,12 @@ macx {
RUNINTERMINAL.files = $$PWD/qtcreator/runInTerminal.command
QMAKE_BUNDLE_DATA += SNIPPETS TEMPLATES DESIGNER SCHEMES GDBDEBUGGER RUNINTERMINAL
QMAKE_INFO_PLIST = $$PWD/qtcreator/Info.plist
}
win32|linux-* {
} else {
# make sure the resources are in place
!exists($$OUT_PWD/app.pro) {
# we are shadow build
unix:SEPARATOR = ;
win32:SEPARATOR = &
# we are shadow build
COPYSRC = snippets \
templates \
designer \
...
...
@@ -32,7 +30,6 @@ win32|linux-* {
for(tmp,COPYSRC) {
REALSRC = $$PWD/qtcreator/$$tmp
REALDEST = $$COPYDEST/$$tmp
win32:tmp ~= s|/+|\|
win32:REALSRC ~= s|/+|\|
win32:REALDEST ~= s|/+|\|
QMAKE_POST_LINK += $${QMAKE_COPY_DIR} $${REALSRC} $${REALDEST} $$SEPARATOR
...
...
src/app/app.pro
View file @
f65c2a50
...
...
@@ -3,22 +3,6 @@ IDE_BUILD_TREE = $$OUT_PWD/../../
include
(..
/
qworkbench
.
pri
)
include
(..
/
shared
/
qtsingleapplication
/
qtsingleapplication
.
pri
)
macx
{
CONFIG
(
debug
,
debug
|
release
)
:
LIBS
*=
-
lExtensionSystem_debug
-
lAggregation_debug
else
:
LIBS
*=
-
lExtensionSystem
-
lAggregation
}
win32
{
CONFIG
(
debug
,
debug
|
release
)
:
LIBS
*=
-
lExtensionSystemd
-
lAggregationd
else
:
LIBS
*=
-
lExtensionSystem
-
lAggregation
}
unix
:
!
macx
{
LIBS
*=
-
lExtensionSystem
-
lAggregation
target
.
path
=
/
bin
INSTALLS
+=
target
}
TEMPLATE
=
app
TARGET
=
$$
IDE_APP_TARGET
DESTDIR
=
..
/../
bin
...
...
@@ -36,5 +20,33 @@ macx {
ICON
=
qtcreator
.
icns
}
include
(..
/../
share
/
share
.
pri
)
macx
{
CONFIG
(
debug
,
debug
|
release
)
:
LIBS
*=
-
lExtensionSystem_debug
-
lAggregation_debug
else
:
LIBS
*=
-
lExtensionSystem
-
lAggregation
}
win32
{
CONFIG
(
debug
,
debug
|
release
)
:
LIBS
*=
-
lExtensionSystemd
-
lAggregationd
else
:
LIBS
*=
-
lExtensionSystem
-
lAggregation
}
unix
:
!
macx
{
LIBS
*=
-
lExtensionSystem
-
lAggregation
#
make
sure
the
wrapper
is
in
place
!
exists
(
$$
OUT_PWD
/
app
.
pro
)
{
#
we
are
shadow
build
COPYSRC
=
$$
PWD
/
$$
DESTDIR
/
$$
IDE_APP_WRAPPER
COPYDEST
=
$$
OUT_PWD
/
$$
DESTDIR
/
$$
IDE_APP_WRAPPER
win32
:
COPYSRC
~=
s
|
/+
|
\
|
win32
:
COPYDEST
~=
s
|
/+
|
\
|
unix
:
SEPARATOR
=
;
win32
:
SEPARATOR
=
&
QMAKE_POST_LINK
+=
$$
{
QMAKE_COPY_FILE
}
$$
{
COPYSRC
}
$$
{
COPYDEST
}
$$
SEPARATOR
}
target
.
files
+=
$$
OUT_PWD
/
$$
DESTDIR
/
$$
IDE_APP_WRAPPER
target
.
path
=
/
bin
INSTALLS
+=
target
}
include
(..
/../
share
/
share
.
pri
)
src/libs/cplusplus/CppDocument.cpp
View file @
f65c2a50
...
...
@@ -288,6 +288,10 @@ bool Document::parse(ParseMode mode)
m
=
TranslationUnit
::
ParseExpression
;
break
;
case
ParseDeclarator
:
m
=
TranslationUnit
::
ParseDeclarator
;
break
;
case
ParseStatement
:
m
=
TranslationUnit
::
ParseStatement
;
break
;
...
...
src/libs/cplusplus/CppDocument.h
View file @
f65c2a50
...
...
@@ -92,6 +92,7 @@ public:
ParseTranlationUnit
,
ParseDeclaration
,
ParseExpression
,
ParseDeclarator
,
ParseStatement
};
...
...
src/libs/cplusplus/TokenUnderCursor.cpp
View file @
f65c2a50
...
...
@@ -42,7 +42,7 @@ TokenUnderCursor::TokenUnderCursor()
TokenUnderCursor
::~
TokenUnderCursor
()
{
}
SimpleToken
TokenUnderCursor
::
operator
()(
const
QTextCursor
&
cursor
)
const
SimpleToken
TokenUnderCursor
::
operator
()(
const
QTextCursor
&
cursor
,
QTextBlock
*
b
)
const
{
SimpleLexer
tokenize
;
tokenize
.
setObjCEnabled
(
true
);
...
...
@@ -54,8 +54,11 @@ SimpleToken TokenUnderCursor::operator()(const QTextCursor &cursor) const
QList
<
SimpleToken
>
tokens
=
tokenize
(
block
.
text
(),
previousBlockState
(
block
));
for
(
int
index
=
tokens
.
size
()
-
1
;
index
!=
-
1
;
--
index
)
{
const
SimpleToken
&
tk
=
tokens
.
at
(
index
);
if
(
tk
.
position
()
<
column
)
if
(
tk
.
position
()
<
column
)
{
if
(
b
)
*
b
=
block
;
return
tk
;
}
}
return
SimpleToken
();
...
...
src/libs/cplusplus/TokenUnderCursor.h
View file @
f65c2a50
...
...
@@ -48,7 +48,7 @@ public:
TokenUnderCursor
();
~
TokenUnderCursor
();
SimpleToken
operator
()(
const
QTextCursor
&
cursor
)
const
;
SimpleToken
operator
()(
const
QTextCursor
&
cursor
,
QTextBlock
*
block
=
0
)
const
;
private:
int
previousBlockState
(
const
QTextBlock
&
block
)
const
;
...
...
src/libs/utils/savedaction.cpp
View file @
f65c2a50
...
...
@@ -52,6 +52,16 @@ using namespace Core::Utils;
//
//////////////////////////////////////////////////////////////////////////
/*!
\class Core::Utils::SavedAction
\brief The SavedAction class is a helper class for actions with persistent
state.
\ingroup utils
*/
SavedAction
::
SavedAction
(
QObject
*
parent
)
:
QAction
(
parent
)
{
...
...
@@ -59,11 +69,24 @@ SavedAction::SavedAction(QObject *parent)
connect
(
this
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
actionTriggered
(
bool
)));
}
/*!
Returns the current value of the object.
\sa setValue()
*/
QVariant
SavedAction
::
value
()
const
{
return
m_value
;
}
/*!
Sets the current value of the object. If the value changed and
\a doemit is true, the \c valueChanged() signal will be emitted.
\sa value()
*/
void
SavedAction
::
setValue
(
const
QVariant
&
value
,
bool
doemit
)
{
if
(
value
==
m_value
)
...
...
@@ -75,37 +98,80 @@ void SavedAction::setValue(const QVariant &value, bool doemit)
emit
valueChanged
(
m_value
);
}
/*!
Returns the default value to be used when the item does not exist yet
in the settings.
\sa setDefaultValue()
*/
QVariant
SavedAction
::
defaultValue
()
const
{
return
m_defaultValue
;
}
/*!
Sets the default value to be used when the item does not exist yet
in the settings.
\sa defaultValue()
*/
void
SavedAction
::
setDefaultValue
(
const
QVariant
&
value
)
{
m_defaultValue
=
value
;
}
/*!
Returns the key to be used when accessing the settings.
\sa settingsKey()
*/
QString
SavedAction
::
settingsKey
()
const
{
return
m_settingsKey
;
}
/*!
Sets the key to be used when accessing the settings.
\sa settingsKey()
*/
void
SavedAction
::
setSettingsKey
(
const
QString
&
key
)
{
m_settingsKey
=
key
;
}
/*!
Sets the key and group to be used when accessing the settings.
\sa settingsKey()
*/
void
SavedAction
::
setSettingsKey
(
const
QString
&
group
,
const
QString
&
key
)
{
m_settingsKey
=
key
;
m_settingsGroup
=
group
;
}
/*!
Sets the key to be used when accessing the settings.
\sa settingsKey()
*/
QString
SavedAction
::
settingsGroup
()
const
{
return
m_settingsGroup
;
}
/*!
Sets the group to be used when accessing the settings.
\sa settingsGroup()
*/
void
SavedAction
::
setSettingsGroup
(
const
QString
&
group
)
{
m_settingsGroup
=
group
;
...
...
@@ -128,6 +194,22 @@ QString SavedAction::toString() const
+
" settingskey: "
+
m_settingsGroup
+
'/'
+
m_settingsKey
;
}