I have an app that was using 4.4.2 that I just moved to 4.5.2. I now have a problem using the QFileDialog::getOpenFileName() static method when canceling the dialog.
On my QMainWindow, my app has a QTabWidget. A tab contains 2 QGroupBox objects. Each QGroupBox contains a QTableWidget object.
Using the Windows native dialog version:
“Open Fileâ€,
m_parent->m_sCurrDir,
“Filter (*.*)†);
sFilePath = QFileDialog::getOpenFileName( m_parent,
“Open Fileâ€,
m_parent->m_sCurrDir,
“Filter (*.*)†);
To copy to clipboard, switch view to plain text mode
When the dialog is closed using the close button the contents of each QTableWidget goes away. Clicking on an area which previously contained a table row entry or header will cause a portion of the table contents to be redrawn. Minimizing and then bring the app back up will redraw everything as it should be.
Using the Qt dialog version:
“Open Fileâ€,
m_parent->m_sCurrDir,
“Filter (*.*)â€,
sFilePath = QFileDialog::getOpenFileName( m_parent,
“Open Fileâ€,
m_parent->m_sCurrDir,
“Filter (*.*)â€,
0, QFileDialog::DontUseNativeDialog );
To copy to clipboard, switch view to plain text mode
This causes a similar result except the tables are redraw automatically. By that, I mean that I can see the contents go away as the dialog is going away but the table contents are immediately redrawn (unlike the Windows native dialog which never automatically redraws). I would just use the Qt native version except it takes longer than a second to fill the dialog with files from a 75 entry directory. This seems way too long.
Has anyone else seen this (I haven’t been able to find mention of this on the Troll's Task Tracker)?
If so, has anyone found a way to fix this (I've tried update() and repaint() and neither change the result)?
Bookmarks