So instead of blindly closing all open tabs, we instead call the tab manger to get a list of content tabs and try qobject casting them to FlowTabs and if they are a flow tab, then we call getviewstate and if and only if that tab is in BookView do we close that tab.

I can't see any issues with linking the stylesheets with BV (or CV, for that matter) left open during the process. Not on Linux at least.

Unfortunately, my testing seems to have exposed some ugly rendering issues I'm experiencing with Qt5.12.0. It appears to be similar to the recent issue reported on github that manifests immediately after BV/CV loses focus.

With an html tab open in Book View, click on Help->About. After dismissing the resulting About dialog, immediately change to CodeView. Before scrolling or doing anything else: clicking in CodeView to reposition the cursor introduces weird highlighting and missing/doubled lines of text. It's quite atrocious. Scrolling far enough up or down (with either the mousewheel or the vertical scrollbar) seems to remedy the problem.

It doesn't have to be the Help dialog. Any sort of focus activity (like the LinkStylesheets dialog) with BookView open will manifest the issue when first switching to CodeView.

Qt5.12.0 appears to be disaster for Sigil's CodeView. At least it's not destructive.

Instead I built Qt 5.12.0 in macOS last night and it built out of the box. Unfortunately the new webkit will NOT build against Qt 5.12.0 on Macs with the latest tool chain. So I have been unable to complete a Sigil build to start looking at it.

I've been thinking about trying with Windows (I was able to build QtWebKit against Qt5.12.0 using my usual procedure), but the Qt bug-report mentioned in the recent github issue indicates that it's an X11 issue. As such, I assumed it wouldn't manifest in Windows. I'll try to do a build tonight to verify.

Unfortunately, my testing seems to have exposed some ugly rendering issues I'm experiencing with Qt5.12.0. It appears to be similar to the recent issue reported on github that manifests immediately after BV/CV loses focus.

With an html tab open in Book View, click on Help->About. After dismissing the resulting About dialog, immediately change to CodeView. Before scrolling or doing anything else: clicking in CodeView to reposition the cursor introduces weird highlighting and missing/doubled lines of text. It's quite atrocious. Scrolling far enough up or down (with either the mousewheel or the vertical scrollbar) seems to remedy the problem.

It doesn't have to be the Help dialog. Any sort of focus activity (like the LinkStylesheets dialog) with BookView open will manifest the issue when first switching to CodeView.

Qt5.12.0 appears to be disaster for Sigil's CodeView. At least it's not destructive.

FWIW, I finally got qtwebkit to build with Qt 5.12.0 by disabling the building of qtwebkit test code. The test code is severely broken on macOS under XCode 10.

Interestingly, the late change to qsyntaxhighlighter.cpp did make it into Qt 5.11.3 but NOT into the official Qt 5.12.0 source archive. With official Qt 5.12.0 on macOS, I am not seeing any issues with CodeView at all. So whatever the problem, it appears to be Linux only.