08-02-2023, 06:42 PM | #1 |
Enthusiast
Posts: 39
Karma: 10
Join Date: Jul 2023
Device: none
|
Is select and drag supported in the HTML editor?
I select text and then click and drag it to where I want it. Sometimes it works, sometimes it switches to my stylesheet and makes changes, and sometimes it crashes Sigil. This is on Windows 10 and Sigil 1.9.30.
|
08-02-2023, 06:54 PM | #2 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Never tried it. It's certainly not intended to be supported. But crashes are bad. We have to eliminate any reproduce-able crashes.
|
Advert | |
|
08-02-2023, 07:28 PM | #3 |
Sigil Developer
Posts: 7,650
Karma: 5433388
Join Date: Nov 2009
Device: many
|
No it is not supported anyplace outside of Reordering Spine files in the BookBrowser.
For all other editors setAcceptDrops defaults to false. This is something Windows must be doing which might explain any crashing. |
08-02-2023, 07:39 PM | #4 |
Sigil Developer
Posts: 7,650
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Of course, I just tried dragging a piece of previously selected text between paragraphs and it dropping it and it appeared to work. And this was in macOS.
We may have to take more steps to figure out why this is even allowed. Last edited by KevinH; 08-02-2023 at 08:02 PM. |
08-02-2023, 07:42 PM | #5 | |
Sigil Developer
Posts: 7,650
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Update:
It appears that QPlainTextEdit (CodeView) seems to default to setAcceptDrops(true) instead of the previously default false. I literally had to add a setAcceptDrops(false); to the CodeViewEditor constructor to disable it. Strange .... Quote:
Kevin Last edited by DiapDealer; 08-02-2023 at 07:59 PM. |
|
Advert | |
|
08-02-2023, 07:55 PM | #6 |
Sigil Developer
Posts: 7,650
Karma: 5433388
Join Date: Nov 2009
Device: many
|
And of course if you look at Qt's source code for qplaintextedit.cpp you can see the following in its private constructor:
Code:
viewport->setBackgroundRole(QPalette::Base); q->setAcceptDrops(true); q->setFocusPolicy(Qt::StrongFocus); q->setAttribute(Qt::WA_KeyCompression); q->setAttribute(Qt::WA_InputMethodEnabled); q->setInputMethodHints(Qt::ImhMultiLine); I have pushed a fix to master for this. Drops from Drag and Drop will no longer be accepted in CodeView when editing. This should prevent your random crashes on Windows. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Request: In TOC editing drag to select multiple items. | graatch | Calibre | 3 | 01-14-2022 12:56 AM |
drag & drop files from one editor instance to another | rjwse@aol.com | Editor | 13 | 10-12-2018 01:24 AM |
I wishes....drag&drop on editor mode | larysa | Editor | 0 | 02-28-2017 05:32 AM |
Drag and drop in the editor | korben | Editor | 11 | 07-19-2014 05:39 AM |
Html hyperlinks supported on Hanlin V3? | manifestor | HanLin eBook | 4 | 05-23-2009 10:08 AM |