forked from qt-creator/qt-creator
Merge branch '1.0.0'
Conflicts: src/libs/cplusplus/Overview.h src/libs/cplusplus/TypePrettyPrinter.cpp src/plugins/cpptools/cppcodecompletion.cpp
This commit is contained in:
@@ -78,7 +78,7 @@ class FunctionArgumentWidget : public QLabel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FunctionArgumentWidget();
|
FunctionArgumentWidget();
|
||||||
void showFunctionHint(Function *functionSymbol, const Snapshot &snapshot);
|
void showFunctionHint(Function *functionSymbol, const LookupContext &context);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *e);
|
bool eventFilter(QObject *obj, QEvent *e);
|
||||||
@@ -95,7 +95,7 @@ private:
|
|||||||
|
|
||||||
QFrame *m_popupFrame;
|
QFrame *m_popupFrame;
|
||||||
Function *m_item;
|
Function *m_item;
|
||||||
Snapshot m_snapshot;
|
LookupContext m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConvertToCompletionItem: protected NameVisitor
|
class ConvertToCompletionItem: protected NameVisitor
|
||||||
@@ -215,10 +215,10 @@ FunctionArgumentWidget::FunctionArgumentWidget()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FunctionArgumentWidget::showFunctionHint(Function *functionSymbol,
|
void FunctionArgumentWidget::showFunctionHint(Function *functionSymbol,
|
||||||
const Snapshot &snapshot)
|
const LookupContext &context)
|
||||||
{
|
{
|
||||||
m_item = functionSymbol;
|
m_item = functionSymbol;
|
||||||
m_snapshot = snapshot;
|
m_context = context;
|
||||||
m_startpos = m_editor->position();
|
m_startpos = m_editor->position();
|
||||||
|
|
||||||
// update the text
|
// update the text
|
||||||
@@ -1073,7 +1073,7 @@ void CppCodeCompletion::complete(const TextEditor::CompletionItem &item)
|
|||||||
if (!m_functionArgumentWidget)
|
if (!m_functionArgumentWidget)
|
||||||
m_functionArgumentWidget = new FunctionArgumentWidget;
|
m_functionArgumentWidget = new FunctionArgumentWidget;
|
||||||
|
|
||||||
m_functionArgumentWidget->showFunctionHint(function, typeOfExpression.snapshot());
|
m_functionArgumentWidget->showFunctionHint(function, typeOfExpression.lookupContext());
|
||||||
}
|
}
|
||||||
} else if (m_completionOperator == T_SIGNAL || m_completionOperator == T_SLOT) {
|
} else if (m_completionOperator == T_SIGNAL || m_completionOperator == T_SLOT) {
|
||||||
QString toInsert = item.m_text;
|
QString toInsert = item.m_text;
|
||||||
|
@@ -452,7 +452,7 @@ QDockWidget *DebuggerManager::createDockForWidget(QWidget *widget)
|
|||||||
{
|
{
|
||||||
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
|
QDockWidget *dockWidget = new QDockWidget(widget->windowTitle(), m_mainWindow);
|
||||||
dockWidget->setObjectName(widget->windowTitle());
|
dockWidget->setObjectName(widget->windowTitle());
|
||||||
dockWidget->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
|
||||||
dockWidget->setTitleBarWidget(new QWidget(dockWidget));
|
dockWidget->setTitleBarWidget(new QWidget(dockWidget));
|
||||||
dockWidget->setWidget(widget);
|
dockWidget->setWidget(widget);
|
||||||
connect(dockWidget->toggleViewAction(), SIGNAL(toggled(bool)),
|
connect(dockWidget->toggleViewAction(), SIGNAL(toggled(bool)),
|
||||||
@@ -489,7 +489,7 @@ void DebuggerManager::setSimpleDockWidgetArrangement()
|
|||||||
void DebuggerManager::setLocked(bool locked)
|
void DebuggerManager::setLocked(bool locked)
|
||||||
{
|
{
|
||||||
const QDockWidget::DockWidgetFeatures features =
|
const QDockWidget::DockWidgetFeatures features =
|
||||||
(locked) ? QDockWidget::NoDockWidgetFeatures :
|
(locked) ? QDockWidget::DockWidgetClosable :
|
||||||
QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable;
|
QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable;
|
||||||
|
|
||||||
foreach (QDockWidget *dockWidget, m_dockWidgets) {
|
foreach (QDockWidget *dockWidget, m_dockWidgets) {
|
||||||
|
@@ -2504,14 +2504,13 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonDblClick) {
|
if (e->type() == QEvent::MouseButtonPress || e->type() == QEvent::MouseButtonDblClick) {
|
||||||
if (e->button() == Qt::LeftButton) {
|
if (e->button() == Qt::LeftButton) {
|
||||||
if (d->m_codeFoldingVisible && TextBlockUserData::canCollapse(cursor.block())
|
if (d->m_codeFoldingVisible && TextBlockUserData::canCollapse(cursor.block())
|
||||||
&& !TextBlockUserData::hasClosingCollapseInside(cursor.block().next())
|
&& !TextBlockUserData::hasClosingCollapseInside(cursor.block().next())
|
||||||
&& collapseBox(cursor.block()).contains(e->pos())) {
|
&& collapseBox(cursor.block()).contains(e->pos())) {
|
||||||
setTextCursor(cursor);
|
|
||||||
toggleBlockVisible(cursor.block());
|
toggleBlockVisible(cursor.block());
|
||||||
|
d->moveCursorVisible(false);
|
||||||
} else if (d->m_marksVisible && e->pos().x() > markWidth) {
|
} else if (d->m_marksVisible && e->pos().x() > markWidth) {
|
||||||
QTextCursor selection = cursor;
|
QTextCursor selection = cursor;
|
||||||
selection.setVisualNavigation(true);
|
selection.setVisualNavigation(true);
|
||||||
@@ -3392,15 +3391,16 @@ void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BaseTextEditorPrivate::moveCursorVisible()
|
void BaseTextEditorPrivate::moveCursorVisible(bool ensureVisible)
|
||||||
{
|
{
|
||||||
QTextCursor cursor = q->textCursor();
|
QTextCursor cursor = q->textCursor();
|
||||||
if (!cursor.block().isVisible()) {
|
if (!cursor.block().isVisible()) {
|
||||||
cursor.setVisualNavigation(true);
|
cursor.setVisualNavigation(true);
|
||||||
cursor.movePosition(QTextCursor::PreviousBlock);
|
cursor.movePosition(QTextCursor::Up);
|
||||||
q->setTextCursor(cursor);
|
q->setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
q->ensureCursorVisible();
|
if (ensureVisible)
|
||||||
|
q->ensureCursorVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseTextEditor::collapse()
|
void BaseTextEditor::collapse()
|
||||||
|
@@ -218,7 +218,7 @@ public:
|
|||||||
QTextCursor m_findScope;
|
QTextCursor m_findScope;
|
||||||
QTextCursor m_selectBlockAnchor;
|
QTextCursor m_selectBlockAnchor;
|
||||||
|
|
||||||
void moveCursorVisible();
|
void moveCursorVisible(bool ensureVisible = true);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user