forked from qt-creator/qt-creator
Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta
This commit is contained in:
@@ -1674,7 +1674,10 @@ static void qDumpQObjectSignal(QDumper &d)
|
||||
d.beginHash();
|
||||
P(d, "name", "[" << i << "] slot");
|
||||
P(d, "type", "");
|
||||
if (conn.receiver)
|
||||
P(d, "value", conn.receiver->metaObject()->method(conn.method).signature());
|
||||
else
|
||||
P(d, "value", "<invalid receiver>");
|
||||
P(d, "numchild", "0");
|
||||
d.endHash();
|
||||
d.beginHash();
|
||||
@@ -1866,8 +1869,8 @@ static void qDumpQSet(QDumper &d)
|
||||
d.beginHash();
|
||||
P(d, "name", "[" << i << "]");
|
||||
P(d, "type", d.innertype);
|
||||
P(d, "exp", "(('QHashNode<" << d.innertype
|
||||
<< ",QHashDummyValue>'*)"
|
||||
P(d, "exp", "(('"NS"QHashNode<" << d.innertype
|
||||
<< ","NS"QHashDummyValue>'*)"
|
||||
<< static_cast<const void*>(node) << ")->key"
|
||||
);
|
||||
d.endHash();
|
||||
|
||||
@@ -95,8 +95,10 @@ private:
|
||||
QSortFilterProxyModel *proxyModel;
|
||||
};
|
||||
|
||||
class TreeView : public QTreeView {
|
||||
class TreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TreeView(QWidget* parent = 0) : QTreeView(parent) {}
|
||||
void subclassKeyPressEvent(QKeyEvent* event)
|
||||
|
||||
@@ -396,11 +396,16 @@ void BookmarkManager::toggleBookmark()
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
const QFileInfo fi(editor->file()->fileName());
|
||||
const int editorLine = editor->currentLine();
|
||||
toggleBookmark(editor->file()->fileName(), editor->currentLine());
|
||||
}
|
||||
|
||||
void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
|
||||
{
|
||||
const QFileInfo fi(fileName);
|
||||
const int editorLine = lineNumber;
|
||||
|
||||
// Remove any existing bookmark on this line
|
||||
if (Bookmark *mark = findBookmark(fi.path(), fi.fileName(), editorLine)) {
|
||||
if (Bookmark *mark = findBookmark(fi.path(), fi.fileName(), lineNumber)) {
|
||||
// TODO check if the bookmark is really on the same markable Interface
|
||||
removeBookmark(mark);
|
||||
return;
|
||||
|
||||
@@ -34,15 +34,15 @@
|
||||
#ifndef BOOKMARKMANAGER_H
|
||||
#define BOOKMARKMANAGER_H
|
||||
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
#include <QtGui/QListView>
|
||||
#include <QtCore/QList>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QStyledItemDelegate>
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/inavigationwidgetfactory.h>
|
||||
|
||||
#include <QtCore/QAbstractItemModel>
|
||||
#include <QtCore/QList>
|
||||
#include <QtGui/QListView>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QStyledItemDelegate>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class SessionManager;
|
||||
}
|
||||
@@ -89,10 +89,16 @@ public:
|
||||
// this QItemSelectionModel is shared by all views
|
||||
QItemSelectionModel *selectionModel() const;
|
||||
|
||||
enum Roles {Filename = Qt::UserRole, LineNumber = Qt::UserRole + 1, Directory = Qt::UserRole + 2, LineText = Qt::UserRole + 3};
|
||||
enum Roles {
|
||||
Filename = Qt::UserRole,
|
||||
LineNumber = Qt::UserRole + 1,
|
||||
Directory = Qt::UserRole + 2,
|
||||
LineText = Qt::UserRole + 3
|
||||
};
|
||||
|
||||
public slots:
|
||||
void toggleBookmark();
|
||||
void toggleBookmark(const QString &fileName, int lineNumber);
|
||||
void nextInDocument();
|
||||
void prevInDocument();
|
||||
void next();
|
||||
@@ -108,6 +114,7 @@ private slots:
|
||||
void updateActionStatus();
|
||||
void gotoBookmark(Bookmark *bookmark);
|
||||
void loadBookmarks();
|
||||
|
||||
private:
|
||||
TextEditor::ITextEditor *currentTextEditor() const;
|
||||
ProjectExplorer::SessionManager* sessionManager() const;
|
||||
|
||||
@@ -36,17 +36,22 @@
|
||||
#include "bookmarks_global.h"
|
||||
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/uniqueidmanager.h>
|
||||
#include <coreplugin/actionmanager/actionmanagerinterface.h>
|
||||
|
||||
#include <QtCore/qplugin.h>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QMenu>
|
||||
#include <QDebug>
|
||||
|
||||
using namespace Bookmarks::Constants;
|
||||
using namespace Bookmarks::Internal;
|
||||
using namespace TextEditor;
|
||||
|
||||
BookmarksPlugin *BookmarksPlugin::m_instance = 0;
|
||||
|
||||
@@ -159,6 +164,19 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
updateActions(m_bookmarkManager->state());
|
||||
addAutoReleasedObject(new BookmarkViewFactory(m_bookmarkManager));
|
||||
|
||||
m_bookmarkMarginAction = new QAction(this);
|
||||
m_bookmarkMarginAction->setText("Toggle Bookmark");
|
||||
//m_bookmarkAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
|
||||
connect(m_bookmarkMarginAction, SIGNAL(triggered()),
|
||||
this, SLOT(bookmarkMarginActionTriggered()));
|
||||
|
||||
// EditorManager
|
||||
QObject *editorManager = m_core->editorManager();
|
||||
connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)),
|
||||
this, SLOT(editorAboutToClose(Core::IEditor*)));
|
||||
connect(editorManager, SIGNAL(editorOpened(Core::IEditor*)),
|
||||
this, SLOT(editorOpened(Core::IEditor*)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -169,7 +187,6 @@ BookmarksPlugin::~BookmarksPlugin()
|
||||
|
||||
void BookmarksPlugin::updateActions(int state)
|
||||
{
|
||||
|
||||
const bool hasbm = state >= BookmarkManager::HasBookMarks;
|
||||
const bool hasdocbm = state == BookmarkManager::HasBookmarksInDocument;
|
||||
|
||||
@@ -182,4 +199,32 @@ void BookmarksPlugin::updateActions(int state)
|
||||
m_moveDownAction->setEnabled(hasbm);
|
||||
}
|
||||
|
||||
void BookmarksPlugin::editorOpened(Core::IEditor *editor)
|
||||
{
|
||||
connect(editor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
|
||||
this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
|
||||
}
|
||||
|
||||
void BookmarksPlugin::editorAboutToClose(Core::IEditor *editor)
|
||||
{
|
||||
disconnect(editor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
|
||||
this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
|
||||
}
|
||||
|
||||
void BookmarksPlugin::requestContextMenu(TextEditor::ITextEditor *editor,
|
||||
int lineNumber, QMenu *menu)
|
||||
{
|
||||
m_bookmarkMarginActionLineNumber = lineNumber;
|
||||
m_bookmarkMarginActionFileName = editor->file()->fileName();
|
||||
menu->addAction(m_bookmarkMarginAction);
|
||||
}
|
||||
|
||||
void BookmarksPlugin::bookmarkMarginActionTriggered()
|
||||
{
|
||||
m_bookmarkManager->toggleBookmark(
|
||||
m_bookmarkMarginActionFileName,
|
||||
m_bookmarkMarginActionLineNumber
|
||||
);
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(BookmarksPlugin)
|
||||
|
||||
@@ -31,18 +31,26 @@
|
||||
**
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef BOOKMARKS_H
|
||||
#define BOOKMARKS_H
|
||||
#ifndef BOOKMARKSPLUGIN_H
|
||||
#define BOOKMARKSPLUGIN_H
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMultiMap>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
class ICore;
|
||||
class IEditor;
|
||||
}
|
||||
|
||||
namespace TextEditor {
|
||||
class ITextEditor;
|
||||
}
|
||||
|
||||
namespace Bookmarks {
|
||||
@@ -67,6 +75,13 @@ public:
|
||||
public slots:
|
||||
void updateActions(int stateMask);
|
||||
|
||||
private slots:
|
||||
void editorOpened(Core::IEditor *editor);
|
||||
void editorAboutToClose(Core::IEditor *editor);
|
||||
void requestContextMenu(TextEditor::ITextEditor *editor,
|
||||
int lineNumber, QMenu *menu);
|
||||
void bookmarkMarginActionTriggered();
|
||||
|
||||
private:
|
||||
static BookmarksPlugin *m_instance;
|
||||
BookmarkManager *m_bookmarkManager;
|
||||
@@ -79,6 +94,10 @@ private:
|
||||
QAction *m_docNextAction;
|
||||
QAction *m_moveUpAction;
|
||||
QAction *m_moveDownAction;
|
||||
|
||||
QAction *m_bookmarkMarginAction;
|
||||
int m_bookmarkMarginActionLineNumber;
|
||||
QString m_bookmarkMarginActionFileName;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
0
src/plugins/cpptools/rpp/pp-fwd.h
Normal file
0
src/plugins/cpptools/rpp/pp-fwd.h
Normal file
@@ -44,6 +44,8 @@
|
||||
#include <QMetaType>
|
||||
#include <QString>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace CppTools {
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -285,6 +285,7 @@ void DebuggerOutputWindow::showOutput(const QString &prefix, const QString &outp
|
||||
|
||||
void DebuggerOutputWindow::showInput(const QString &prefix, const QString &input)
|
||||
{
|
||||
Q_UNUSED(prefix);
|
||||
m_inputText->append(input);
|
||||
QTextCursor cursor = m_inputText->textCursor();
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
|
||||
@@ -250,6 +250,12 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
|
||||
|
||||
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
|
||||
|
||||
m_breakpointMarginAction = new QAction(this);
|
||||
m_breakpointMarginAction->setText("Toggle Breakpoint");
|
||||
//m_breakpointMarginAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
|
||||
connect(m_breakpointMarginAction, SIGNAL(triggered()),
|
||||
this, SLOT(breakpointMarginActionTriggered()));
|
||||
|
||||
//Core::IActionContainer *mcppcontext =
|
||||
// actionManager->actionContainer(CppEditor::Constants::M_CONTEXT);
|
||||
|
||||
@@ -502,6 +508,8 @@ void DebuggerPlugin::editorOpened(Core::IEditor *editor)
|
||||
this, SLOT(requestMark(TextEditor::ITextEditor*,int)));
|
||||
connect(editor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)),
|
||||
this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int)));
|
||||
connect(textEditor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
|
||||
this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,9 +520,27 @@ void DebuggerPlugin::editorAboutToClose(Core::IEditor *editor)
|
||||
this, SLOT(requestMark(TextEditor::ITextEditor*,int)));
|
||||
disconnect(editor, SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)),
|
||||
this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int)));
|
||||
disconnect(textEditor, SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
|
||||
this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerPlugin::requestContextMenu(TextEditor::ITextEditor *editor,
|
||||
int lineNumber, QMenu *menu)
|
||||
{
|
||||
m_breakpointMarginActionLineNumber = lineNumber;
|
||||
m_breakpointMarginActionFileName = editor->file()->fileName();
|
||||
menu->addAction(m_breakpointMarginAction);
|
||||
}
|
||||
|
||||
void DebuggerPlugin::breakpointMarginActionTriggered()
|
||||
{
|
||||
m_manager->toggleBreakpoint(
|
||||
m_breakpointMarginActionFileName,
|
||||
m_breakpointMarginActionLineNumber
|
||||
);
|
||||
}
|
||||
|
||||
void DebuggerPlugin::requestMark(TextEditor::ITextEditor *editor, int lineNumber)
|
||||
{
|
||||
m_manager->toggleBreakpoint(editor->file()->fileName(), lineNumber);
|
||||
|
||||
@@ -84,10 +84,14 @@ private slots:
|
||||
void setSessionValue(const QString &name, const QVariant &value);
|
||||
void queryConfigValue(const QString &name, QVariant *value);
|
||||
void setConfigValue(const QString &name, const QVariant &value);
|
||||
void requestContextMenu(TextEditor::ITextEditor *editor,
|
||||
int lineNumber, QMenu *menu);
|
||||
|
||||
void resetLocation();
|
||||
void gotoLocation(const QString &fileName, int line, bool setMarker);
|
||||
|
||||
void breakpointMarginActionTriggered();
|
||||
|
||||
private:
|
||||
friend class DebuggerManager;
|
||||
friend class DebugMode; // FIXME: Just a hack now so that it can access the views
|
||||
@@ -104,6 +108,10 @@ private:
|
||||
QString m_previousMode;
|
||||
LocationMark *m_locationMark;
|
||||
int m_gdbRunningContext;
|
||||
|
||||
QAction *m_breakpointMarginAction;
|
||||
int m_breakpointMarginActionLineNumber;
|
||||
QString m_breakpointMarginActionFileName;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -351,6 +351,23 @@ void testPlugin()
|
||||
}
|
||||
}
|
||||
|
||||
void testSet()
|
||||
{
|
||||
QSet<int> hgg0;
|
||||
hgg0.insert(11);
|
||||
hgg0.insert(22);
|
||||
|
||||
QSet<QString> hgg1;
|
||||
hgg1.insert("22.0");
|
||||
|
||||
QObject ob;
|
||||
QSet<QPointer<QObject> > hash;
|
||||
QPointer<QObject> ptr(&ob);
|
||||
//hash.insert(ptr);
|
||||
//hash.insert(ptr);
|
||||
//hash.insert(ptr);
|
||||
}
|
||||
|
||||
void stringRefTest(const QString &refstring)
|
||||
{
|
||||
Q_UNUSED(refstring);
|
||||
@@ -759,6 +776,7 @@ int main(int argc, char *argv[])
|
||||
testImage();
|
||||
testMap();
|
||||
testString();
|
||||
testSet();
|
||||
testStringList();
|
||||
testStruct();
|
||||
//testThreads();
|
||||
|
||||
Reference in New Issue
Block a user