06-19-2020, 04:11 PM | #16 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Does it help to force the use of the execCommand javascript like we used for Qt 5.9.5 instead:
See this snippet in PageEdit's MainWindow.cpp: Code:
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) void MainWindow::Bold() { m_WebView->triggerPageAction(QWebEnginePage::ToggleBold); } void MainWindow::Italic() { m_WebView->triggerPageAction(QWebEnginePage::ToggleItalic); } void MainWindow::Underline() { m_WebView->triggerPageAction(QWebEnginePage::ToggleUnderline); } void MainWindow::Strikethrough() { m_WebView->triggerPageAction(QWebEnginePage::ToggleStrikethrough); } void MainWindow::AlignLeft() { m_WebView->triggerPageAction(QWebEnginePage::AlignLeft); } void MainWindow::AlignCenter() { m_WebView->triggerPageAction(QWebEnginePage::AlignCenter); } void MainWindow::AlignRight() { m_WebView->triggerPageAction(QWebEnginePage::AlignRight); } void MainWindow::AlignJustify() { m_WebView->triggerPageAction(QWebEnginePage::AlignJustified); } void MainWindow::DecreaseIndent() { m_WebView->triggerPageAction(QWebEnginePage::Outdent); } void MainWindow::IncreaseIndent() { m_WebView->triggerPageAction(QWebEnginePage::Indent); } void MainWindow::InsertBulletedList() { m_WebView->triggerPageAction(QWebEnginePage::InsertUnorderedList); } void MainWindow::InsertNumberedList() { m_WebView->triggerPageAction(QWebEnginePage::InsertOrderedList); } #else void MainWindow::Bold() { m_WebView->ExecCommand("bold"); } void MainWindow::Italic() { m_WebView->ExecCommand("italic"); } void MainWindow::Underline() { m_WebView->ExecCommand("underline"); } void MainWindow::Strikethrough() { m_WebView->ExecCommand("strikeThrough"); } void MainWindow::AlignLeft() { m_WebView->ExecCommand("justifyLeft"); } void MainWindow::AlignCenter() { m_WebView->ExecCommand("justifyCenter"); } void MainWindow::AlignRight() { m_WebView->ExecCommand("justifyRight"); } void MainWindow::AlignJustify() { m_WebView->ExecCommand("justifyFull"); } void MainWindow::DecreaseIndent() { m_WebView->ExecCommand("outdent"); } void MainWindow::IncreaseIndent() { m_WebView->ExecCommand("indent"); } void MainWindow::InsertBulletedList() { m_WebView->ExecCommand("insertUnorderedList"); } void MainWindow::InsertNumberedList() { m_WebView->ExecCommand("insertOrderedList"); } #endif |
06-19-2020, 04:23 PM | #17 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Argh! This must be a bug in Qt 5.12.X as the same exact error happens on a macOS X build from master made a while back.
I think we will need to handle InsertOrdered and Unordered lists using pure javascript execCommand for all platforms using Qt 5.12.X |
Advert | |
|
06-19-2020, 04:26 PM | #18 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Okay I grabbed the release version which used Qt 5.12.7 and PageEdit bullet points worked just fine.
So the problem was freshly introduced in Qt 5.12.8 but does not exist in Qt 5.12.7 or Qt 5.15.0. I truly hate Qt! They seem to randomly break things with every damn release. |
06-19-2020, 04:31 PM | #19 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Well using the pure javascript execCommand version does not help with Qt 5.12.8 at all.
So they even broke the javascript dom version, unless it is related to some more recent change of ours. I wonder if Qt 5.12.9 version is any better? Or if macOS will have to revert to Qt 5.12.7 just to get things working again. Last edited by KevinH; 06-19-2020 at 04:33 PM. |
06-19-2020, 04:52 PM | #20 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
I have started a full from source build of Qt 5.12.9 to see if the issue/bug happens in it. If so, the macOS build will have to revert to Qt 5.12.7 just to get something working.
The build will take most of the evening on my slow machine. So I won't be able to test anything until tomorrow. If it does turn out to be Qt 5.12.8 specific, and that is the version used by Linux Mint 20 and Ubuntu and Kubuntu then we may be in a no-win situation. |
Advert | |
|
06-19-2020, 05:31 PM | #21 |
Grand Sorcerer
Posts: 27,668
Karma: 195154104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'll check on Windows, but I'm going to be a bit tied up until Sunday.
|
06-19-2020, 05:37 PM | #22 |
Grand Sorcerer
Posts: 27,668
Karma: 195154104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
What are we using for Sigil for this same functionality? I ask because it works on the same system (5.12.8) that PageEdit's doesn't. I'm assuming Sigil isn't using the same QWebEngine function.
|
06-19-2020, 05:39 PM | #23 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Checked Qt webengine source and the page action versions simply invoke the execCommand javascript versions, so the break is most likely in the chromium 3rdParty stuff.
That was just about the only changes in QtWebEngine from Qt 5.12.7 to Qt 5.12.8. Qt 5.15 seems to be based on a newer Chromium 80? istead of 77, 78, or 79, so this may be a pure Chromium Bug. Last edited by KevinH; 06-19-2020 at 05:43 PM. |
06-19-2020, 05:41 PM | #24 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
In Sigil, we do not use that call at all anymore. In CV we use cpp code to to work on a QPlainTextEdit class and no QtWebEngine or javascript involved at all. The changes to the text are then used to update Preview.
|
06-19-2020, 05:52 PM | #25 |
Grand Sorcerer
Posts: 27,668
Karma: 195154104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I figured it was our own code in Sigil. At least since we dropped Book View. You're right that it sounds like it could be a pure Chrome bug.
|
06-19-2020, 07:40 PM | #26 |
Grand Sorcerer
Posts: 27,668
Karma: 195154104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
By the way: I forgot to mention that with the latest PageEdit master, I'm saw some debug output from the new QtWebEngine Interceptor code stating that the eBook folder couldn't be found, so a resource wasn't going to be loaded. I'll try to get that nailed down.
|
06-19-2020, 07:58 PM | #27 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Probably a bug, but I checked my debug output and the Interceptor changes reported nothing wrong when insertOrderedList and insertUnOrderedList is run.
I am pretty sure the problem change is in the chromium part. |
06-19-2020, 08:13 PM | #28 |
Grand Sorcerer
Posts: 27,668
Karma: 195154104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Yeah, I don't think it was list-related when it was happening. I forget what I was doing.
|
06-19-2020, 08:39 PM | #29 |
Sigil Developer
Posts: 7,849
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Well I tried disabling building all examples, tests, and the debug versions of everything and my Qt5.12.9 build finished. I did a clean rebuild against Qt 5.12.9 and the bug is still there.
So it was definitely introduced inQt 5.12.8. Of course 2 weeks back I deleted my Qt 5.12.7 build to free up disk space. So I am now rebuilding Qt 5.12.7 from source with all patches just to verify it does NOT exhibit the bug. If Qt 5.12.7 works, I am not sure what to do ... filing a Qt bug report about a bug that does not seem to be in Qt 5.15, seems to make little sense given how no one at Qt ever seems to listen or take bug reports seriously. I will diff the Qt 5.12.8 qtwebengine against Qt 5.12.7 to see if anything obvious jumps out. The problem seems related what the selection type is, as if the current selection is already a list, you can work with it correctly. It is just paragraphs it has trouble with... |
06-19-2020, 08:55 PM | #30 |
Grand Sorcerer
Posts: 27,668
Karma: 195154104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I've still got a Windows 5.12.7 I can check with too.
|
Tags |
kubuntu 20.04, pageedit |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling 7.x on Kubuntu 12.10 | dicknskip | Sigil | 9 | 04-09-2013 04:39 PM |
installing sigil on kubuntu | Tambayo | Sigil | 3 | 04-23-2012 10:05 AM |
Kubuntu - Calibre - iPad | dicknskip | Devices | 5 | 01-27-2012 12:06 PM |