[Interest] "Loading", recursion and GUI's
William Hallatt
goblincoding at gmail.com
Mon Jan 7 16:30:18 CET 2013
Good day everyone,
*What I'm trying to do:*
Display some sort of "Loading" or "Busy" message while executing a
recursive function of unknown depth (GUI app front end).
*
What I've tried:*
Various attempts at using QMovie, QProgressBar, QDialog, QProgressDialog,
etc. No luck to date.
*
The relevant code snippet:*
QLabel *progress = new QLabel( "Loading..." );
progress->setWindowFlags( Qt::Popup );
progress->move( window()->frameGeometry().topLeft() +
window()->rect().center() /*- progress->rect().center()*/ );
progress->show();
if( !GCDataBaseInterface::instance()->batchProcessDOMDocument( m_domDoc ) )
{
showErrorMessageBox( GCDataBaseInterface::instance()->getLastError() );
}
else
{
processDOMDoc();
}
delete progress;
*What it does:
*Both batchProcessDOMDocument as well as processDOMDoc are recursive
function calls. The first traverses the DOM in order to update a database,
the second updates the GUI's tree widget. Although the above code does
display a label outline, try as I might, I cannot get it to display any
text (please see attached).
I'll be satisfied with even a simple label stating the obvious:
"Loading..." message. Currently, there is no way for the end user to know
that the GUI has not frozen and I have run out of ideas.
Any help will be greatly appreciated.
Regards,
William
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130107/c6fba521/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Label.PNG
Type: image/png
Size: 7082 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130107/c6fba521/attachment.png>
More information about the Interest
mailing list