On 10/20/2010 10:37 AM, Andre Poenitz wrote:
On Wed, Oct 20, 2010 at 03:54:03AM +0200, Peter Kümmel wrote:

I think what's happening is this. If you export pdf (say) without there
already being a pdf file there, then everything is fine. But if the pdf
file exists, then LyX will try to ask the user whether to overwrite.
This means creating a dialog as a child of the parent. But the parent,
from what I can tell, is in the main thread, and that's not allowed.

I'll paste the full error I get below. As you'll see, LyX crashes here.
Here's the backtrace:
This makes it complicated: pass a signal via Qt::QueuedConnection to
the gui thread and wait for the answer before continuing.

Andre, what's the best way to wait for the answer from the gui thread,
QEventLoop?
I personally believe that nested event loops are always evil.
In this case I'd completely stop the export, let the gui pop up
the dialog, and on confirmation re-initiate the export process
with a 'force' flag or such.

I agree. But this would mean that all dialog related code must be removed from the export functions... which would be a good thing in itself but is a bit more involved than what was originally thought.

Abdel.

Reply via email to