Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-02-2023, 06:42 PM   #1
jwes
Enthusiast
jwes began at the beginning.
 
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.
jwes is offline   Reply With Quote
Old 08-02-2023, 06:54 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Advert
Old 08-02-2023, 07:28 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is online now   Reply With Quote
Old 08-02-2023, 07:39 PM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is online now   Reply With Quote
Old 08-02-2023, 07:42 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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:
From the Qt 6.5 and Qt 5.15 docs:

acceptDrops : bool

This property holds whether drop events are enabled for this widget

Setting this property to true announces to the system that this widget may be able to accept drop events.

If the widget is the desktop (windowType() == Qt::Desktop), this may fail if another application is using the desktop; you can call acceptDrops() to test if this occurs.

Warning: Do not modify this property in a drag and drop event handler.
By default, this property is false.

Access functions:

bool acceptDrops() const
void setAcceptDrops(bool on)
See also Drag and Drop.

Kevin

Last edited by DiapDealer; 08-02-2023 at 07:59 PM.
KevinH is online now   Reply With Quote
Advert
Old 08-02-2023, 07:55 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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);
So much for the docs being correct!

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.
KevinH is online now   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 10:13 PM.


MobileRead.com is a privately owned, operated and funded community.