本文整理汇总了C++中ktexteditor::MarkInterface::marks方法的典型用法代码示例。如果您正苦于以下问题:C++ MarkInterface::marks方法的具体用法?C++ MarkInterface::marks怎么用?C++ MarkInterface::marks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ktexteditor::MarkInterface
的用法示例。
在下文中一共展示了MarkInterface::marks方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadMarks
void EditorTabWidget::loadMarks(Document_t& d, KTextEditor::Document* doc)
{
/*
QString s = "result: ";
for(int i = 0; i < d.marks.count(); i++) {
s += "(" + QString::number((*(d.marks.at(i))).line+1) + ")*" + QString::number((*(d.marks.at(i))).type) + "*; ";
}
kdDebug() << s;
*/
d.marks.clear();
KTextEditor::MarkInterface* imark =
dynamic_cast<KTextEditor::MarkInterface*>(doc);
//this 'for' doesn't use first()/next() because it modifies the current item in the list
//and it is already being used in the 'for' of slotMarkChanged()
//QString s = "result: ";
int size = imark->marks().count();
for(int i = 0; i < size; i++) {
//s += "(" + QString::number(m->line+1) + ")*" + QString::number(m->type) + "*; ";
d.marks.append((*imark->marks().at(i)));
}
//kdDebug() << s;
}
示例2: getBookmarks
void EditorPage::getBookmarks(FileListLocation& fll)
{
KTextEditor::MarkInterface* pMarkIf;
QHash<int, KTextEditor::Mark*> plMarks;
KTextEditor::Mark* pMark;
// Get the marks interface
pMarkIf = dynamic_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
plMarks = pMarkIf->marks();
QHashIterator<int, KTextEditor::Mark*> i(plMarks);
while (i.hasNext()) {
i.next();
fll.append(getFilePath(), i.key(), 0);
}
/*
for (pMark = plMarks.first(); pMark; pMark = plMarks.next()) {
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
*/
}
示例3: getBookmarks
/**
* Retrieves a list of all bookmarks in this page.
*/
void EditorPage::getBookmarks(FileLocationList& fll)
{
KTextEditor::MarkInterface* pMarkIf;
QPtrList<KTextEditor::Mark> plMarks;
KTextEditor::Mark* pMark;
// Get the marks interface
pMarkIf = dynamic_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
plMarks = pMarkIf->marks();
for (pMark = plMarks.first(); pMark; pMark = plMarks.next()) {
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
}
示例4: getBookmarks
/**
* Retrieves a list of all bookmarks in this page.
*/
void EditorPage::getBookmarks(FileLocationList& fll)
{
// Get the marks interface
KTextEditor::MarkInterface* pMarkIf;
pMarkIf = qobject_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
KTextEditor::Mark* pMark;
QHashIterator<int, KTextEditor::Mark*> hItr(pMarkIf->marks());
while(hItr.hasNext()) {
hItr.next();
pMark = hItr.value();
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
}
示例5: clearMarks
void QXsldbgDoc::clearMarks(bool allMarkTypes)
{
if (locked)
return;
KTextEditor::MarkInterface *markIf = KTextEditor::markInterface(kDoc);
if (markIf){
if (!allMarkTypes){
QPtrList<KTextEditor::Mark> marks = markIf->marks();
while ( marks.current()) {
markIf->removeMark(marks.current()->line, KTextEditor::MarkInterface::Execution);
markIf->removeMark(marks.current()->line, KTextEditor::MarkInterface::BreakpointReached);
marks.next();
}
}else {
markIf->clearMarks();
}
}
}
示例6: getBookmarks
/**
* Retrieves a list of all bookmarks in this page.
*/
void EditorPage::getBookmarks(FileLocationList& fll)
{
KTextEditor::MarkInterface* pMarkIf;
QList<KTextEditor::Mark *> plMarks;
KTextEditor::Mark* pMark;
// Get the marks interface
pMarkIf = qobject_cast<KTextEditor::MarkInterface*>(m_pDoc);
if (!pMarkIf)
return;
// Find all bookmarks
const QHash<int, KTextEditor::Mark *> marks = pMarkIf->marks();
QHashIterator<int, KTextEditor::Mark *> i(marks);
while (i.hasNext()) {
i.next();
pMark = i.value();
if (pMark->type == KTextEditor::MarkInterface::markType01)
fll.append(new FileLocation(getFilePath(), pMark->line, 0));
}
}