Skip to content
GitLab
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
ca7193d6
Commit
ca7193d6
authored
Jan 14, 2009
by
dt
Browse files
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
parents
0cf9ffc0
6b86542a
Changes
83
Hide whitespace changes
Inline
Side-by-side
doc/qtcreator.qdoc
View file @
ca7193d6
...
...
@@ -49,7 +49,9 @@
\list
\o \l{A Quick Tour of Qt Creator}
\o \l{Creating a Project in Qt Creator}
\o \l{The Code Editor}
\o \l{Build Settings}
\o \l{Qt Version Management}
\o \l{Writing a Simple Program with Qt Creator}
\o \l{Navigating Quickly Around Your Code with Locator}
\o \l{Debugging with Qt Creator}
...
...
@@ -206,10 +208,67 @@
are available to help speed up the process of developing your application.
*/
/*! \contentspage index.html
\previouspage creator-quick-tour.html
\page creator-code-editor.html
\nextpage creator-build-settings.html
\title The Code Editor
### SCREENSHOT of the editor in action
\table
\row
\i Block navigation
\i To navigate between blocks, e.g., from one \c{\{} to another
\c{\c}}, use \key{Ctrl+[} and \key{Ctrl+]}.
\row
\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}.
\row
\i Moving lines up and down
\i
\row
\i Completion
\i
\row
\i Indenting
\i
\row
\i Commenting or Uncommenting
\i
\endtable
More:
Collapse
Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving
F2 and Shift F2 - follows symbols under the cursor (works for namespaces, classes, methods, variables, includes, macros).
F4 - switch header and source
Ctrl + Scroll wheel -- used to quickly change the font size (handy for presentatiaons)
To switch to an external editor, select \gui{Open in external editor} from
the \gui{Edit -> Advanced} menu.
*/
/*!
\contentspage index.html
\previouspage creator-
quick-tour
.html
\previouspage creator-
editor-settings
.html
\page creator-build-settings.html
\nextpage creator-creating-project.html
...
...
@@ -266,8 +325,15 @@
remove the build step. You will still be able to debug applications, but the
contents of Qt and STL data types will not be displayed properly.
*/
/*!
\contentspage index.html
\previouspage creator-build-settings.html
\page creator-version-management.html
\nextpage creator-creating-project.html
\
section1
Qt Version Management
\
title
Qt Version Management
Qt Creator allows you to use multiple versions of Qt installed on your hard
disk and switch between them easily.
...
...
shared/cplusplus/Parser.cpp
View file @
ca7193d6
...
...
@@ -751,6 +751,9 @@ bool Parser::parseCvQualifiers(SpecifierAST *&node)
spec
->
specifier_token
=
consumeToken
();
*
ast
=
spec
;
ast
=
&
(
*
ast
)
->
next
;
}
else
if
(
LA
()
==
T___ATTRIBUTE__
)
{
parseAttributeSpecifier
(
*
ast
);
ast
=
&
(
*
ast
)
->
next
;
}
else
{
break
;
}
...
...
shared/scriptwrapper/interface_wrap_helpers.h
View file @
ca7193d6
...
...
@@ -34,7 +34,6 @@
#ifndef INTERFACE_WRAP_HELPERS_H
#define INTERFACE_WRAP_HELPERS_H
#include
<extensionsystem/ExtensionSystemInterfaces>
#include
<QtScript/QScriptEngine>
namespace
SharedTools
{
...
...
src/libs/extensionsystem/ExtensionSystemInterfaces
deleted
100644 → 0
View file @
0cf9ffc0
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "extensionsystem/pluginmanager.h"
#include "extensionsystem/pluginspec.h"
#include "extensionsystem/iplugin.h"
#include "extensionsystem/pluginview.h"
#include "extensionsystem/pluginerrorview.h"
#include "extensionsystem/plugindetailsview.h"
src/plugins/bookmarks/bookmarkmanager.cpp
View file @
ca7193d6
...
...
@@ -37,10 +37,10 @@
#include
"bookmarksplugin.h"
#include
"bookmarks_global.h"
#include
<projectexplorer/ProjectExplorerInterfaces>
#include
<coreplugin/icore.h>
#include
<coreplugin/editormanager/editormanager.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<projectexplorer/projectexplorer.h>
#include
<texteditor/basetexteditor.h>
#include
<utils/qtcassert.h>
...
...
@@ -49,6 +49,7 @@
#include
<QtGui/QAction>
#include
<QtGui/QContextMenuEvent>
#include
<QtGui/QMenu>
#include
<QtGui/QPainter>
Q_DECLARE_METATYPE
(
Bookmarks
::
Internal
::
Bookmark
*
)
...
...
src/plugins/bookmarks/bookmarksplugin.cpp
View file @
ca7193d6
...
...
@@ -77,17 +77,17 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
uniqueIdentifier
(
TextEditor
::
Constants
::
C_TEXTEDITOR
);
globalcontext
<<
Core
::
Constants
::
C_GLOBAL_ID
;
Core
::
I
ActionContainer
*
mtools
=
Core
::
ActionContainer
*
mtools
=
am
->
actionContainer
(
Core
::
Constants
::
M_TOOLS
);
Core
::
I
ActionContainer
*
mbm
=
Core
::
ActionContainer
*
mbm
=
am
->
createMenu
(
QLatin1String
(
BOOKMARKS_MENU
));
mbm
->
menu
()
->
setTitle
(
tr
(
"&Bookmarks"
));
mtools
->
addMenu
(
mbm
);
//Toggle
m_toggleAction
=
new
QAction
(
tr
(
"Toggle Bookmark"
),
this
);
Core
::
I
Command
*
cmd
=
Core
::
Command
*
cmd
=
am
->
registerAction
(
m_toggleAction
,
BOOKMARKS_TOGGLE_ACTION
,
textcontext
);
#ifndef Q_OS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+M"
)));
...
...
src/plugins/coreplugin/actionmanager/actioncontainer.cpp
View file @
ca7193d6
...
...
@@ -31,10 +31,10 @@
**
***************************************************************************/
#include
"actioncontainer.h"
#include
"actioncontainer
_p
.h"
#include
"actionmanager_p.h"
#include
"command.h"
#include
"command
_p
.h"
#include
"coreimpl.h"
#include
"coreconstants.h"
...
...
@@ -51,112 +51,111 @@ using namespace Core;
using
namespace
Core
::
Internal
;
/*!
\class
I
ActionContainer
\class ActionContainer
\mainclass
\inheaderfile iactioncontainer.h
\brief The
I
ActionContainer class represents a menu or menu bar in Qt Creator.
\brief The ActionContainer class represents a menu or menu bar in Qt Creator.
*/
/*!
\enum
I
ActionContainer::ContainerType
\enum ActionContainer::ContainerType
*/
/*!
\enum
I
ActionContainer::EmptyAction
\enum ActionContainer::EmptyAction
*/
/*!
\fn virtual
I
ActionContainer::setEmptyAction(EmptyAction ea)
\fn virtual ActionContainer::setEmptyAction(EmptyAction ea)
*/
/*!
\fn virtual int
I
ActionContainer::id() const
\fn virtual int ActionContainer::id() const
*/
/*!
\fn virtual ContainerType
I
ActionContainer::type() const
\fn virtual ContainerType ActionContainer::type() const
*/
/*!
\fn virtual QMenu *
I
ActionContainer::menu() const
\fn virtual QMenu *ActionContainer::menu() const
*/
/*!
\fn virtual QToolBar *
I
ActionContainer::toolBar() const
\fn virtual QToolBar *ActionContainer::toolBar() const
*/
/*!
\fn virtual QMenuBar *
I
ActionContainer::menuBar() const
\fn virtual QMenuBar *ActionContainer::menuBar() const
*/
/*!
\fn virtual QAction *
I
ActionContainer::insertLocation(const QString &group) const
\fn virtual QAction *ActionContainer::insertLocation(const QString &group) const
*/
/*!
\fn virtual void
I
ActionContainer::appendGroup(const QString &group, bool global)
\fn virtual void ActionContainer::appendGroup(const QString &group, bool global)
*/
/*!
\fn virtual void
I
ActionContainer::addAction(Core::
I
Command *action, const QString &group)
\fn virtual void ActionContainer::addAction(Core::Command *action, const QString &group)
*/
/*!
\fn virtual void
I
ActionContainer::addMenu(Core::
I
ActionContainer *menu, const QString &group)
\fn virtual void ActionContainer::addMenu(Core::ActionContainer *menu, const QString &group)
*/
/*!
\fn virtual bool
I
ActionContainer::update()
\fn virtual bool ActionContainer::update()
*/
/*!
\fn virtual
I
ActionContainer::~
I
ActionContainer()
\fn virtual ActionContainer::~ActionContainer()
*/
// ---------- ActionContainer ------------
// ---------- ActionContainer
Private
------------
/*!
\class Core::Internal::ActionContainer
\class Core::Internal::ActionContainer
Private
\internal
*/
ActionContainer
::
ActionContainer
(
int
id
)
ActionContainer
Private
::
ActionContainer
Private
(
int
id
)
:
m_data
(
CS_None
),
m_id
(
id
)
{
}
void
ActionContainer
::
setEmptyAction
(
EmptyAction
ea
)
void
ActionContainer
Private
::
setEmptyAction
(
EmptyAction
ea
)
{
m_data
=
((
m_data
&
~
EA_Mask
)
|
ea
);
}
bool
ActionContainer
::
hasEmptyAction
(
EmptyAction
ea
)
const
bool
ActionContainer
Private
::
hasEmptyAction
(
EmptyAction
ea
)
const
{
return
(
m_data
&
EA_Mask
)
==
ea
;
}
void
ActionContainer
::
setState
(
ContainerState
state
)
void
ActionContainer
Private
::
setState
(
ContainerState
state
)
{
m_data
|=
state
;
}
bool
ActionContainer
::
hasState
(
ContainerState
state
)
const
bool
ActionContainer
Private
::
hasState
(
ContainerState
state
)
const
{
return
(
m_data
&
state
);
}
void
ActionContainer
::
appendGroup
(
const
QString
&
group
)
void
ActionContainer
Private
::
appendGroup
(
const
QString
&
group
)
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
gid
=
idmanager
->
uniqueIdentifier
(
group
);
m_groups
<<
gid
;
}
QAction
*
ActionContainer
::
insertLocation
(
const
QString
&
group
)
const
QAction
*
ActionContainer
Private
::
insertLocation
(
const
QString
&
group
)
const
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
grpid
=
idmanager
->
uniqueIdentifier
(
group
);
...
...
@@ -165,22 +164,22 @@ QAction *ActionContainer::insertLocation(const QString &group) const
return
beforeAction
(
pos
,
&
prevKey
);
}
void
ActionContainer
::
addAction
(
I
Command
*
action
,
const
QString
&
group
)
void
ActionContainer
Private
::
addAction
(
Command
*
action
,
const
QString
&
group
)
{
if
(
!
canAddAction
(
action
))
return
;
ActionManagerPrivate
*
am
=
ActionManagerPrivate
::
instance
();
Action
*
a
=
static_cast
<
Action
*>
(
action
);
if
(
a
->
stateFlags
()
&
Command
::
CS_PreLocation
)
{
if
(
a
->
stateFlags
()
&
Command
Private
::
CS_PreLocation
)
{
QList
<
CommandLocation
>
locs
=
a
->
locations
();
for
(
int
i
=
0
;
i
<
locs
.
size
();
++
i
)
{
if
(
I
ActionContainer
*
aci
=
am
->
actionContainer
(
locs
.
at
(
i
).
m_container
))
{
ActionContainer
*
ac
=
static_cast
<
ActionContainer
*>
(
aci
);
if
(
ActionContainer
*
aci
=
am
->
actionContainer
(
locs
.
at
(
i
).
m_container
))
{
ActionContainer
Private
*
ac
=
static_cast
<
ActionContainer
Private
*>
(
aci
);
ac
->
addAction
(
action
,
locs
.
at
(
i
).
m_position
,
false
);
}
}
a
->
setStateFlags
(
a
->
stateFlags
()
|
Command
::
CS_Initialized
);
a
->
setStateFlags
(
a
->
stateFlags
()
|
Command
Private
::
CS_Initialized
);
}
else
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
grpid
=
idmanager
->
uniqueIdentifier
(
Constants
::
G_DEFAULT_TWO
);
...
...
@@ -193,21 +192,21 @@ void ActionContainer::addAction(ICommand *action, const QString &group)
}
}
void
ActionContainer
::
addMenu
(
I
ActionContainer
*
menu
,
const
QString
&
group
)
void
ActionContainer
Private
::
addMenu
(
ActionContainer
*
menu
,
const
QString
&
group
)
{
ActionContainer
*
container
=
static_cast
<
ActionContainer
*>
(
menu
);
ActionContainer
Private
*
container
=
static_cast
<
ActionContainer
Private
*>
(
menu
);
if
(
!
container
->
canBeAddedToMenu
())
return
;
ActionManagerPrivate
*
am
=
ActionManagerPrivate
::
instance
();
MenuActionContainer
*
mc
=
static_cast
<
MenuActionContainer
*>
(
menu
);
if
(
mc
->
hasState
(
ActionContainer
::
CS_PreLocation
))
{
if
(
mc
->
hasState
(
ActionContainer
Private
::
CS_PreLocation
))
{
CommandLocation
loc
=
mc
->
location
();
if
(
I
ActionContainer
*
aci
=
am
->
actionContainer
(
loc
.
m_container
))
{
ActionContainer
*
ac
=
static_cast
<
ActionContainer
*>
(
aci
);
if
(
ActionContainer
*
aci
=
am
->
actionContainer
(
loc
.
m_container
))
{
ActionContainer
Private
*
ac
=
static_cast
<
ActionContainer
Private
*>
(
aci
);
ac
->
addMenu
(
menu
,
loc
.
m_position
,
false
);
}
mc
->
setState
(
ActionContainer
::
CS_Initialized
);
mc
->
setState
(
ActionContainer
Private
::
CS_Initialized
);
}
else
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
grpid
=
idmanager
->
uniqueIdentifier
(
Constants
::
G_DEFAULT_TWO
);
...
...
@@ -220,34 +219,34 @@ void ActionContainer::addMenu(IActionContainer *menu, const QString &group)
}
}
int
ActionContainer
::
id
()
const
int
ActionContainer
Private
::
id
()
const
{
return
m_id
;
}
QMenu
*
ActionContainer
::
menu
()
const
QMenu
*
ActionContainer
Private
::
menu
()
const
{
return
0
;
}
QMenuBar
*
ActionContainer
::
menuBar
()
const
QMenuBar
*
ActionContainer
Private
::
menuBar
()
const
{
return
0
;
}
bool
ActionContainer
::
canAddAction
(
I
Command
*
action
)
const
bool
ActionContainer
Private
::
canAddAction
(
Command
*
action
)
const
{
if
(
action
->
type
()
!=
I
Command
::
CT_OverridableAction
)
if
(
action
->
type
()
!=
Command
::
CT_OverridableAction
)
return
false
;
Command
*
cmd
=
static_cast
<
Command
*>
(
action
);
if
(
cmd
->
stateFlags
()
&
Command
::
CS_Initialized
)
Command
Private
*
cmd
=
static_cast
<
Command
Private
*>
(
action
);
if
(
cmd
->
stateFlags
()
&
Command
Private
::
CS_Initialized
)
return
false
;
return
true
;
}
void
ActionContainer
::
addAction
(
I
Command
*
action
,
int
pos
,
bool
setpos
)
void
ActionContainer
Private
::
addAction
(
Command
*
action
,
int
pos
,
bool
setpos
)
{
Action
*
a
=
static_cast
<
Action
*>
(
action
);
...
...
@@ -269,7 +268,7 @@ void ActionContainer::addAction(ICommand *action, int pos, bool setpos)
insertAction
(
ba
,
a
->
action
());
}
void
ActionContainer
::
addMenu
(
I
ActionContainer
*
menu
,
int
pos
,
bool
setpos
)
void
ActionContainer
Private
::
addMenu
(
ActionContainer
*
menu
,
int
pos
,
bool
setpos
)
{
MenuActionContainer
*
mc
=
static_cast
<
MenuActionContainer
*>
(
menu
);
...
...
@@ -289,7 +288,7 @@ void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos)
insertMenu
(
ba
,
mc
->
menu
());
}
QAction
*
ActionContainer
::
beforeAction
(
int
pos
,
int
*
prevKey
)
const
QAction
*
ActionContainer
Private
::
beforeAction
(
int
pos
,
int
*
prevKey
)
const
{
ActionManagerPrivate
*
am
=
ActionManagerPrivate
::
instance
();
...
...
@@ -310,16 +309,16 @@ QAction *ActionContainer::beforeAction(int pos, int *prevKey) const
if
(
baId
==
-
1
)
return
0
;
if
(
I
Command
*
cmd
=
am
->
command
(
baId
))
if
(
Command
*
cmd
=
am
->
command
(
baId
))
return
cmd
->
action
();
if
(
I
ActionContainer
*
container
=
am
->
actionContainer
(
baId
))
if
(
ActionContainer
*
container
=
am
->
actionContainer
(
baId
))
if
(
QMenu
*
menu
=
container
->
menu
())
return
menu
->
menuAction
();
return
0
;
}
int
ActionContainer
::
calcPosition
(
int
pos
,
int
prevKey
)
const
int
ActionContainer
Private
::
calcPosition
(
int
pos
,
int
prevKey
)
const
{
int
grp
=
(
pos
&
0xFFFF0000
);
if
(
prevKey
==
-
1
)
...
...
@@ -341,7 +340,7 @@ int ActionContainer::calcPosition(int pos, int prevKey) const
*/
MenuActionContainer
::
MenuActionContainer
(
int
id
)
:
ActionContainer
(
id
),
m_menu
(
0
)
:
ActionContainer
Private
(
id
),
m_menu
(
0
)
{
setEmptyAction
(
EA_Disable
);
}
...
...
@@ -388,7 +387,7 @@ bool MenuActionContainer::update()
bool
hasitems
=
false
;
foreach
(
I
ActionContainer
*
container
,
subContainers
())
{
foreach
(
ActionContainer
*
container
,
subContainers
())
{
if
(
container
==
this
)
{
qWarning
()
<<
Q_FUNC_INFO
<<
"container"
<<
(
this
->
menu
()
?
this
->
menu
()
->
title
()
:
""
)
<<
"contains itself as subcontainer"
;
continue
;
...
...
@@ -399,7 +398,7 @@ bool MenuActionContainer::update()
}
}
if
(
!
hasitems
)
{
foreach
(
I
Command
*
command
,
commands
())
{
foreach
(
Command
*
command
,
commands
())
{
if
(
command
->
isActive
())
{
hasitems
=
true
;
break
;
...
...
@@ -417,7 +416,7 @@ bool MenuActionContainer::update()
bool
MenuActionContainer
::
canBeAddedToMenu
()
const
{
if
(
hasState
(
ActionContainer
::
CS_Initialized
))
if
(
hasState
(
ActionContainer
Private
::
CS_Initialized
))
return
false
;
return
true
;
...
...
@@ -432,7 +431,7 @@ bool MenuActionContainer::canBeAddedToMenu() const
*/
MenuBarActionContainer
::
MenuBarActionContainer
(
int
id
)
:
ActionContainer
(
id
),
m_menuBar
(
0
)
:
ActionContainer
Private
(
id
),
m_menuBar
(
0
)
{
setEmptyAction
(
EA_None
);
}
...
...
src/plugins/coreplugin/actionmanager/actioncontainer.h
View file @
ca7193d6
...
...
@@ -34,109 +34,42 @@
#ifndef ACTIONCONTAINER_H
#define ACTIONCONTAINER_H
#include
"actionmanager_p.h"
#include
<coreplugin/actionmanager/iactioncontainer.h>
#include
<coreplugin/actionmanager/icommand.h>
#include
<QtCore/QObject>
#include
<QtGui/QMenu>
#include
<QtGui/QToolBar>
#include
<QtGui/QMenuBar>
#include
<QtGui/QAction>
namespace
Core
{
namespace
Internal
{
class
ActionContainer
:
public
Core
::
IActionContainer
{
public:
enum
ContainerState
{
CS_None
=
0x000000
,
CS_Initialized
=
0x010000
,
CS_PreLocation
=
0x020000
,
CS_UserDefined
=
0x040000
};
ActionContainer
(
int
id
);
virtual
~
ActionContainer
()
{}
void
setEmptyAction
(
EmptyAction
ea
);
bool
hasEmptyAction
(
EmptyAction
ea
)
const
;
void
setState
(
ContainerState
state
);
bool
hasState
(
ContainerState
state
)
const
;
QAction
*
insertLocation
(
const
QString
&
group
)
const
;
void
appendGroup
(
const
QString
&
group
);
void
addAction
(
ICommand
*
action
,
const
QString
&
group
=
QString
());
void
addMenu
(
IActionContainer
*
menu
,
const
QString
&
group
=
QString
());
int
id
()
const
;
QMenu
*
menu
()
const
;
QMenuBar
*
menuBar
()
const
;
virtual
void
insertAction
(
QAction
*
before
,
QAction
*
action
)
=
0
;
virtual
void
insertMenu
(
QAction
*
before
,
QMenu
*
menu
)
=
0
;
QList
<
ICommand
*>
commands
()
const
{
return
m_commands
;
}
QList
<
IActionContainer
*>
subContainers
()
const
{
return
m_subContainers
;
}
protected:
bool
canAddAction
(
ICommand
*
action
)
const
;
bool
canAddMenu
(
IActionContainer
*
menu
)
const
;
virtual
bool
canBeAddedToMenu
()
const
=
0
;
class
Command
;
void
addAction
(
ICommand
*
action
,
int
pos
,
bool
setpos
);
void
addMenu
(
IActionContainer
*
menu
,
int
pos
,
bool
setpos
);
private:
QAction
*
beforeAction
(
int
pos
,
int
*
prevKey
)
const
;
int
calcPosition
(
int
pos
,
int
prevKey
)
const
;
QList
<
int
>
m_groups
;
int
m_data
;
int
m_id
;
QMap
<
int
,
int
>
m_posmap
;
QList
<
IActionContainer
*>
m_subContainers
;
QList
<
ICommand
*>
m_commands
;
};
class
MenuActionContainer
:
public
ActionContainer
class
ActionContainer
:
public
QObject
{
public:
MenuActionContainer
(
int
id
);
void
setMenu
(
QMenu
*
menu
);
QMenu
*
menu
()
const
;