Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

This commit is contained in:
hjk
2009-01-06 16:05:05 +01:00
7 changed files with 105 additions and 34 deletions

View File

@@ -3,7 +3,28 @@
\title Qt Creator
Qt Creator is Qt Software's crossplatform IDE. The core of Qt Creator is
basically only a \l{Plugin Loader Framework}{plugin loader}.
basically only a \l{ExtensionSystem}{plugin loader}.
\section1 Core Libraries
There are a few core libraries used by many parts of Qt Creator.
\table
\header
\o Library Name
\o Description
\row
\o \l{Aggregation}{Aggregation}
\o Adds functionality for "glueing" QObjects of different
types together, so you can "cast" between them.
\row
\o \l{ExtensionSystem}{ExtensionSystem}
\o Implements the plugin loader framework. Provides a base class for plugins and
basic mechanisms for plugin interaction like an object pool.
\endtable
\section1 Plugins
@@ -18,46 +39,42 @@
\o Description
\row
\o \l{Core Plugin} {Core}
\o \l{Core} {Core}
\o The core plugin. Provides the main window and managers for editors,
actions, mode windows and files, just to mention the most important ones.
\endtable
*/
/*!
\page classes.html
\title Qt Creator Classes and Namespaces
\section1 Classes
\title Qt Creator Classes
\generatelist classes
\section1 Namespaces
\generatelist{namespaces}
*/
/*!
\page interfaces.html
\title Interfaces
\page namespaces.html
\title Qt Creator Namespaces
\generatelist namespaces
*/
/*!
\page mainclasses.html
\title Qt Creator Main Classes
\generatelist mainclasses
*/
/*!
\page functions.html
\title Member Function Index
\title Qt Creator Functions
\generatelist functionindex
*/
/*!
\group pluginloader
\title Plugin Loader Framework
*/
/*!
\group qtc

View File

@@ -4,11 +4,13 @@ description = Qt Creator API Documentation
language = Cpp
headerdirs = . \
../../src/libs/aggregation \
../../src/libs/extensionsystem \
../../src/plugins/core \
../../src/plugins/core/actionmanager
sourcedirs = . \
../../src/libs/aggregation \
../../src/libs/extensionsystem \
../../src/plugins/core \
../../src/plugins/core/actionmanager
@@ -20,8 +22,8 @@ imagedirs = .
indexes = $QTDIR/doc/html/qt.index
outputdir = ./html-api
base = file:./html-api
outputdir = ./html
base = file:./html
versionsym = 0.9.2
codeindent = 1

View File

@@ -37,12 +37,12 @@
/*!
\namespace Aggregation
\brief Contains support for bundling related components, such that
each component exposes the properties and behavior of the
\brief The Aggregation namespace contains support for bundling related components,
such that each component exposes the properties and behavior of the
other components to the outside.
Components that are bundled to an Aggregate can be "cast" to each other
and have a coupled life cycle. See the documentation of Aggregate for
and have a coupled life cycle. See the documentation of Aggregation::Aggregate for
details and examples.
*/

View File

@@ -38,6 +38,7 @@
/*!
\class ExtensionSystem::IPlugin
\mainclass
\brief Base class for all plugins.
The IPlugin class is an abstract class that must be implemented

View File

@@ -147,9 +147,11 @@ void CurrentDocumentFind::updateCurrentFindFilter(QWidget *old, QWidget *now)
if (!impl)
candidate = candidate->parentWidget();
}
if (!impl)
if (!impl || impl == m_currentFind)
return;
removeFindSupportConnections();
if (m_currentFind)
m_currentFind->highlightAll(QString(), 0);
m_currentWidget = candidate;
m_currentFind = impl;
if (m_currentFind) {

View File

@@ -566,7 +566,6 @@ QStringList Qt4Project::files(FilesMode fileMode) const
if (fileMode == AllFiles)
files += m_projectFiles->generatedFiles[i];
}
files += m_projectFiles->proFiles;
return files;
}

View File

@@ -37,13 +37,19 @@
#include <Scope.h>
#include <Semantic.h>
#include <TranslationUnit.h>
#include <PrettyPrinter.h>
#include <QtCore/QFile>
#include <QtCore/QList>
#include <QFile>
#include <QList>
#include <QCoreApplication>
#include <QStringList>
#include <QFileInfo>
#include <QtDebug>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
class Rewrite
{
@@ -189,10 +195,50 @@ protected:
return false;
}
virtual bool visit(CppCastExpressionAST *ast) {
// Replace the C++ cast expression (e.g. static_cast<foo>(a)) with
// the one generated by the pretty printer.
std::ostringstream o;
PrettyPrinter pp(control(), o);
pp(ast);
remove(ast->firstToken(), ast->lastToken());
const std::string str = o.str();
insertTextBefore(ast->firstToken(), str.c_str());
insertTextBefore(ast->firstToken(), "/* #REF# beautiful cast */ ");
return false;
}
};
int main(int, char *[])
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
QStringList args = app.arguments();
const QString appName = args.first();
args.removeFirst();
bool test_rewriter = false;
bool test_pretty_printer = false;
foreach (QString arg, args) {
if (arg == QLatin1String("--test-rewriter"))
test_rewriter = true;
else if (arg == QLatin1String("--test-pretty-printer"))
test_pretty_printer = true;
else if (arg == QLatin1String("--help")) {
const QFileInfo appInfo(appName);
const QByteArray appFileName = QFile::encodeName(appInfo.fileName());
printf("Usage: %s [options]\n"
" --help Display ths information\n"
" --test-rewriter Test the tree rewriter\n"
" --test-pretty-printer Test the pretty printer\n",
appFileName.constData());
return EXIT_SUCCESS;
}
}
QFile in;
if (! in.open(stdin, QFile::ReadOnly))
return EXIT_FAILURE;
@@ -217,10 +263,14 @@ int main(int, char *[])
}
// test the rewriter
QByteArray out;
SimpleRefactor refactor(&control);
refactor(&unit, source, &out);
printf("%s\n", out.constData());
if (test_rewriter) {
QByteArray out;
SimpleRefactor refactor(&control);
refactor(&unit, source, &out);
printf("%s\n", out.constData());
} else if (test_pretty_printer) {
PrettyPrinter pp(&control, std::cout);
pp(unit.ast());
}
return EXIT_SUCCESS;
}