View Single Post
Old 07-02-2016, 07:52 PM   #31
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
In The Source: Obvious Is Obvious When It's Obvious

[REALITY] Had a conversation with my college after a nasty showdown with a client: it turned out that what was obvious for him was not at all for me and vice versa [/REALITY]

The old question is answered.

When you invoke SpelcheckEditor (clicking on icon or per Tools->Spellcheck->Spellcheck) it calls MainWindow::SpellcheckEditorDialog() which calls m_SpellcheckEditor->show(). Now the SpellcheckEditor has a showEvent(QShowEvent *event) function - which is apparently catching this show event - which calls Refresh() function which calls CreateModel(sort_column, sort_order) function which uses
Code:
 QHash<QString, int> unique_words = m_Book->GetUniqueWordsInHTMLFiles()
to get all unique words in your text, of course.

The SpellcheckEditor m_Book variable, which was "0" by initialization, is, at this time, already changed by MainWindow which, in its initialization body, calls LoadInitialFile(openfilepath, is_internal) or CreateNewBook() functions. Both of them call, eventually, SetNewBook(QSharedPointer<Book> new_book) function which, in its initialization, uses
Code:
 m_SpellcheckEditor->SetBook(m_Book)
which, finally, sets the internal SpellcheckEditor m_Book variable to actual book.

Thus the SpellcheckEditor becomes its first book. No time travel, just some Qt event magic. Obvious.

tbc...?
varlog is offline   Reply With Quote