PDA

View Full Version : Dialog immediately vanishes on MacOS X



rexi11
9th November 2012, 15:42
Hi there,

I have a class inherited from QGraphicsScene. I want to implement a print() method to render all graphic content of the corresponding QGraphisView onto a page with some user interaction.
Here is the code snippet:




void MyGraphicsScene::print( void )
{
QPrinter printer( QPrinter::HighResolution );

...

QPageSetupDialog psDlg( &printer );
if ( psDlg.exec() != QDialog::Accepted ) return;

...

// go on for QPrintDialog and print using QGraphicsView::render(...)
...
}


This works as expected on Windows (NT) but on MacOS X (10.5.8, Qt 4.7) the page setup dialog shows up and immediately vanishes without interaction.

I tried all varations I could think of by studying QPageSetupDialog, QDialog documentation and related threads here (open(), exec() vs show(), stack vs heap, etc..), no change.

I don't think this is specific to QPageSetupDialog. Any idea?

Thanks for helping me out!