规避了无效的引用处理,故事编排显示详情,删除了无效的高亮处理

This commit is contained in:
玉宇清音 2022-12-16 15:08:33 +08:00
parent d3f0438af4
commit d9973e8804
8 changed files with 40 additions and 10 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<data>
<variable>EnvironmentId</variable>

View File

@ -58,7 +58,6 @@ void TextContentEdit::reloadConfigrations(QList<Config::Configration *> configs)
default_font.setPointSize(font_size.toInt());
this->textDocument()->setDefaultFont(default_font);
this->rehighlighter();
}
void TextContentEdit::rehighlighter()

View File

@ -40,7 +40,6 @@ void StoryBoardSourceEdit::reloadConfigrations(QList<Config::Configration *> con
default_font.setPointSize(font_size.toInt());
this->textDocument()->setDefaultFont(default_font);
this->rehighlighter();
}
void StoryBoardSourceEdit::modeReset(const QString &) const{}
@ -67,7 +66,6 @@ void StoryBoardSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src,
FormattedTextEdit::initSource(core, src, parent);
static_cast<KeywordsHightlighter*>(words_highlighter)
->reset(core->parseCore()->queryDocument(src));
rehighlighter();
}
void StoryBoardSourceEdit::jumpTo(const QList<QString> &path)

View File

@ -26,6 +26,8 @@ StoryBoardsPresent::StoryBoardsPresent(Core::AppCore *core, QWidget *parent)
tree_view->resizeColumnToContents(0);
tree_view->resizeColumnToContents(1);
});
connect(tree_view, &QTreeView::clicked, this, &StoryBoardsPresent::show_current_details);
}
void StoryBoardsPresent::refresh()
@ -53,4 +55,35 @@ void StoryBoardsPresent::refresh()
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());
}
}
}

View File

@ -46,7 +46,6 @@ void StoryChainSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src,
this->doc_ins = core->parseCore()->queryDocument(src);
this->core_ins = core;
static_cast<Enhancement::KeywordsHightlighter*>(this->highter_ins)->reset(doc_ins);
rehighlighter();
}
FileExtensionFactory *StoryChainSourceEdit::factory() const
@ -66,7 +65,6 @@ void StoryChainSourceEdit::reloadConfigrations(QList<Config::Configration *> con
default_font.setPointSize(font_size.toInt());
this->textDocument()->setDefaultFont(default_font);
this->rehighlighter();
}
void StoryChainSourceEdit::rehighlighter()

View File

@ -38,7 +38,6 @@ void StoryUnitSourceEdit::reloadConfigrations(QList<Config::Configration *> conf
default_font.setPointSize(font_size.toInt());
this->textDocument()->setDefaultFont(default_font);
this->rehighlighter();
}
void StoryUnitSourceEdit::modeReset(const QString &) const
@ -73,7 +72,6 @@ void StoryUnitSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src,
FormattedTextEdit::initSource(core, src, parent);
static_cast<KeywordsHightlighter*>(words_highlighter)
->reset(core->parseCore()->queryDocument(src));
rehighlighter();
}
void StoryUnitSourceEdit::jumpTo(const QList<QString> &path)

View File

@ -28,7 +28,6 @@ void StoryVolumeSourceEdit::reloadConfigrations(QList<Config::Configration *> co
default_font.setPointSize(font_size.toInt());
this->textDocument()->setDefaultFont(default_font);
this->rehighlighter();
}
void StoryVolumeSourceEdit::resetProcsType(const QString &suffix)
@ -70,7 +69,6 @@ void StoryVolumeSourceEdit::initSource(Core::AppCore *core, const QFileInfo &src
FormattedTextEdit::initSource(core, src, parent);
static_cast<KeywordsHightlighter*>(words_highlighter)
->reset(core->parseCore()->queryDocument(src));
rehighlighter();
}
void StoryVolumeSourceEdit::rehighlighter()

View File

@ -22,7 +22,13 @@ bool CheckTools::FragmentsCheck::check(QList<Parse::ErrorMessage> &reasons) cons
if(ref->typeValue() == NODE_FRAGMENTREFERENCE){
auto ins_ref = static_cast<NodeStoryFragmentRefer*>(ref);
auto u = core_ins->queryStoryUnit(ins_ref->unit());
if(!u.size())
continue;
auto frag = core_ins->queryStoryFragment(u[0], ins_ref->fragment());
if(!frag.size())
continue;
auto frag_ins = static_cast<NodeStoryFragment*>(frag[0]);
bool isvalid;