规避了无效的引用处理,故事编排显示详情,删除了无效的高亮处理
This commit is contained in:
parent
d3f0438af4
commit
d9973e8804
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.15.0, 2022-12-09T02:02:06. -->
|
<!-- Written by QtCreator 4.15.0, 2022-12-15T04:13:32. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
|
|
@ -58,7 +58,6 @@ void TextContentEdit::reloadConfigrations(QList<Config::Configration *> configs)
|
||||||
default_font.setPointSize(font_size.toInt());
|
default_font.setPointSize(font_size.toInt());
|
||||||
|
|
||||||
this->textDocument()->setDefaultFont(default_font);
|
this->textDocument()->setDefaultFont(default_font);
|
||||||
this->rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextContentEdit::rehighlighter()
|
void TextContentEdit::rehighlighter()
|
||||||
|
|
|
@ -40,7 +40,6 @@ void StoryBoardSourceEdit::reloadConfigrations(QList<Config::Configration *> con
|
||||||
default_font.setPointSize(font_size.toInt());
|
default_font.setPointSize(font_size.toInt());
|
||||||
|
|
||||||
this->textDocument()->setDefaultFont(default_font);
|
this->textDocument()->setDefaultFont(default_font);
|
||||||
this->rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryBoardSourceEdit::modeReset(const QString &) const{}
|
void StoryBoardSourceEdit::modeReset(const QString &) const{}
|
||||||
|
@ -67,7 +66,6 @@ void StoryBoardSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src,
|
||||||
FormattedTextEdit::initSource(core, src, parent);
|
FormattedTextEdit::initSource(core, src, parent);
|
||||||
static_cast<KeywordsHightlighter*>(words_highlighter)
|
static_cast<KeywordsHightlighter*>(words_highlighter)
|
||||||
->reset(core->parseCore()->queryDocument(src));
|
->reset(core->parseCore()->queryDocument(src));
|
||||||
rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryBoardSourceEdit::jumpTo(const QList<QString> &path)
|
void StoryBoardSourceEdit::jumpTo(const QList<QString> &path)
|
||||||
|
|
|
@ -26,6 +26,8 @@ StoryBoardsPresent::StoryBoardsPresent(Core::AppCore *core, QWidget *parent)
|
||||||
tree_view->resizeColumnToContents(0);
|
tree_view->resizeColumnToContents(0);
|
||||||
tree_view->resizeColumnToContents(1);
|
tree_view->resizeColumnToContents(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(tree_view, &QTreeView::clicked, this, &StoryBoardsPresent::show_current_details);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryBoardsPresent::refresh()
|
void StoryBoardsPresent::refresh()
|
||||||
|
@ -53,4 +55,35 @@ void StoryBoardsPresent::refresh()
|
||||||
item->appendRow(row);
|
item->appendRow(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->tree_view->resizeColumnToContents(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StoryBoardsPresent::show_current_details(const QModelIndex &idx)
|
||||||
|
{
|
||||||
|
if(!idx.isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
details_view->clear();
|
||||||
|
auto item = model_base->itemFromIndex(idx.sibling(idx.row(), 0));
|
||||||
|
if(item->parent() == nullptr){
|
||||||
|
auto node = core_ins->parseCore()->queryStoryBoard(item->text());
|
||||||
|
|
||||||
|
auto children = node.first()->children();
|
||||||
|
for(auto &it : children){
|
||||||
|
if(it->typeValue() != NODE_FRAGMENTREFERENCE){
|
||||||
|
details_view->append(it->toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
auto node = core_ins->parseCore()->queryStoryBoard(item->parent()->text());
|
||||||
|
auto point = core_ins->parseCore()->queryStoryFragmentRefer(node.first(), item->text().mid(1));
|
||||||
|
|
||||||
|
auto children = point.first()->children();
|
||||||
|
for(auto &it : children){
|
||||||
|
details_view->append(it->toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,6 @@ void StoryChainSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src,
|
||||||
this->doc_ins = core->parseCore()->queryDocument(src);
|
this->doc_ins = core->parseCore()->queryDocument(src);
|
||||||
this->core_ins = core;
|
this->core_ins = core;
|
||||||
static_cast<Enhancement::KeywordsHightlighter*>(this->highter_ins)->reset(doc_ins);
|
static_cast<Enhancement::KeywordsHightlighter*>(this->highter_ins)->reset(doc_ins);
|
||||||
rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileExtensionFactory *StoryChainSourceEdit::factory() const
|
FileExtensionFactory *StoryChainSourceEdit::factory() const
|
||||||
|
@ -66,7 +65,6 @@ void StoryChainSourceEdit::reloadConfigrations(QList<Config::Configration *> con
|
||||||
default_font.setPointSize(font_size.toInt());
|
default_font.setPointSize(font_size.toInt());
|
||||||
|
|
||||||
this->textDocument()->setDefaultFont(default_font);
|
this->textDocument()->setDefaultFont(default_font);
|
||||||
this->rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryChainSourceEdit::rehighlighter()
|
void StoryChainSourceEdit::rehighlighter()
|
||||||
|
|
|
@ -38,7 +38,6 @@ void StoryUnitSourceEdit::reloadConfigrations(QList<Config::Configration *> conf
|
||||||
default_font.setPointSize(font_size.toInt());
|
default_font.setPointSize(font_size.toInt());
|
||||||
|
|
||||||
this->textDocument()->setDefaultFont(default_font);
|
this->textDocument()->setDefaultFont(default_font);
|
||||||
this->rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryUnitSourceEdit::modeReset(const QString &) const
|
void StoryUnitSourceEdit::modeReset(const QString &) const
|
||||||
|
@ -73,7 +72,6 @@ void StoryUnitSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src,
|
||||||
FormattedTextEdit::initSource(core, src, parent);
|
FormattedTextEdit::initSource(core, src, parent);
|
||||||
static_cast<KeywordsHightlighter*>(words_highlighter)
|
static_cast<KeywordsHightlighter*>(words_highlighter)
|
||||||
->reset(core->parseCore()->queryDocument(src));
|
->reset(core->parseCore()->queryDocument(src));
|
||||||
rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryUnitSourceEdit::jumpTo(const QList<QString> &path)
|
void StoryUnitSourceEdit::jumpTo(const QList<QString> &path)
|
||||||
|
|
|
@ -28,7 +28,6 @@ void StoryVolumeSourceEdit::reloadConfigrations(QList<Config::Configration *> co
|
||||||
default_font.setPointSize(font_size.toInt());
|
default_font.setPointSize(font_size.toInt());
|
||||||
|
|
||||||
this->textDocument()->setDefaultFont(default_font);
|
this->textDocument()->setDefaultFont(default_font);
|
||||||
this->rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryVolumeSourceEdit::resetProcsType(const QString &suffix)
|
void StoryVolumeSourceEdit::resetProcsType(const QString &suffix)
|
||||||
|
@ -70,7 +69,6 @@ void StoryVolumeSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src
|
||||||
FormattedTextEdit::initSource(core, src, parent);
|
FormattedTextEdit::initSource(core, src, parent);
|
||||||
static_cast<KeywordsHightlighter*>(words_highlighter)
|
static_cast<KeywordsHightlighter*>(words_highlighter)
|
||||||
->reset(core->parseCore()->queryDocument(src));
|
->reset(core->parseCore()->queryDocument(src));
|
||||||
rehighlighter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryVolumeSourceEdit::rehighlighter()
|
void StoryVolumeSourceEdit::rehighlighter()
|
||||||
|
|
|
@ -22,7 +22,13 @@ bool CheckTools::FragmentsCheck::check(QList<Parse::ErrorMessage> &reasons) cons
|
||||||
if(ref->typeValue() == NODE_FRAGMENTREFERENCE){
|
if(ref->typeValue() == NODE_FRAGMENTREFERENCE){
|
||||||
auto ins_ref = static_cast<NodeStoryFragmentRefer*>(ref);
|
auto ins_ref = static_cast<NodeStoryFragmentRefer*>(ref);
|
||||||
auto u = core_ins->queryStoryUnit(ins_ref->unit());
|
auto u = core_ins->queryStoryUnit(ins_ref->unit());
|
||||||
|
if(!u.size())
|
||||||
|
continue;
|
||||||
|
|
||||||
auto frag = core_ins->queryStoryFragment(u[0], ins_ref->fragment());
|
auto frag = core_ins->queryStoryFragment(u[0], ins_ref->fragment());
|
||||||
|
if(!frag.size())
|
||||||
|
continue;
|
||||||
|
|
||||||
auto frag_ins = static_cast<NodeStoryFragment*>(frag[0]);
|
auto frag_ins = static_cast<NodeStoryFragment*>(frag[0]);
|
||||||
|
|
||||||
bool isvalid;
|
bool isvalid;
|
||||||
|
|
Loading…
Reference in New Issue