Skip to content

Commit

Permalink
update switch replace mode
Browse files Browse the repository at this point in the history
  • Loading branch information
visualfc committed Feb 12, 2015
1 parent 2c3a7f7 commit 8d99ef4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
15 changes: 15 additions & 0 deletions liteidex/src/3rdparty/qtc_searchresult/searchresultwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,21 @@ void SearchResultWidget::searchAgain()
void SearchResultWidget::showReplaceMode()
{
this->setShowReplaceUI(true);
Internal::SearchResultTreeModel *model = m_searchResultTreeView->model();
const int fileCount = model->rowCount(QModelIndex());
for (int i = 0; i < fileCount; ++i) {
QModelIndex fileIndex = model->index(i, 0, QModelIndex());
Internal::SearchResultTreeItem *fileItem = static_cast<Internal::SearchResultTreeItem *>(fileIndex.internalPointer());
fileItem->setIsUserCheckable(true);
fileItem->setCheckState(Qt::Checked);
for (int rowIndex = 0; rowIndex < fileItem->childrenCount(); ++rowIndex) {
QModelIndex textIndex = model->index(rowIndex, 0, fileIndex);
Internal::SearchResultTreeItem *rowItem = static_cast<Internal::SearchResultTreeItem *>(textIndex.internalPointer());
rowItem->setIsUserCheckable(true);
rowItem->setCheckState(Qt::Checked);
}
}
this->m_replaceTextEdit->setFocus();
}

QList<SearchResultItem> SearchResultWidget::checkedItems() const
Expand Down
18 changes: 16 additions & 2 deletions liteidex/src/plugins/liteeditor/liteeditorwidgetbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2734,7 +2734,7 @@ void LiteEditorWidgetBase::testUpdateLink(QMouseEvent *e)
}
}
}
} else if (e->buttons() == Qt::NoButton){
}/* else if (e->buttons() == Qt::NoButton){
if (m_uplinkSkip) {
m_uplinkSkip = false;
return;
Expand All @@ -2744,7 +2744,7 @@ void LiteEditorWidgetBase::testUpdateLink(QMouseEvent *e)
} else {
m_uplinkDeployTimer->stop();
m_uplinkInfoTimer->stop();
}
}*/
if (!findLink) {
clearLink();
}
Expand Down Expand Up @@ -2803,6 +2803,20 @@ void LiteEditorWidgetBase::mouseMoveEvent(QMouseEvent *e)
viewport()->setCursor(Qt::IBeamCursor);
}

bool LiteEditorWidgetBase::viewportEvent(QEvent *e)
{
if (e->type() == QEvent::ToolTip) {
if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
return true;
}
const QHelpEvent *he = static_cast<QHelpEvent*>(e);
m_uplinkInfoPos = he->pos();
m_uplinkDeployTimer->start(m_uplinkTime);
return true;
}
return QPlainTextEdit::viewportEvent(e);
}

void LiteEditorWidgetBase::inputMethodEvent(QInputMethodEvent *e)
{
m_inputCursorOffset = e->preeditString().length();
Expand Down
1 change: 1 addition & 0 deletions liteidex/src/plugins/liteeditor/liteeditorwidgetbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public slots:
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
bool viewportEvent(QEvent *);
void inputMethodEvent(QInputMethodEvent *e);
void indentBlock(QTextBlock block, bool bIndent);
void indentCursor(QTextCursor cur, bool bIndent);
Expand Down
1 change: 0 additions & 1 deletion liteidex/src/plugins/litefind/findeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct FindOption : public LiteApi::FindOption
}
};


class FindEditor : public QObject
{
Q_OBJECT
Expand Down

0 comments on commit 8d99ef4

Please sign in to comment.