Results 1 to 4 of 4

Thread: probabily probme with QFileDIalog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default probabily probme with QFileDIalog

    hi, hi coded this:
    Qt Code:
    1. void mainform::save() {
    2. file = QFileDialog::getOpenFileName(ref,
    3. " (*.xml)\n"
    4. " (*.ler)\n"
    5. "All Files (*.xml; *.ler)",
    6. NULL,
    7. this,
    8. "open file dialog",
    9. tr("Choose a filename to open under"));
    10. Working work(this);
    11. doManyThings()
    12. work.close();
    13. }
    To copy to clipboard, switch view to plain text mode 
    It happen that when I save the qfiledialog leave an umbra on my app (you can see the pic); the same for work dialog (you can see this worst)....I don't understand: I'd like that when I click on save in QfileDialog it go away and THEN 'doManyThings()' is execute...but happen that the umbra of QFileDIalog disappear only when doManyThings() is executed completely. Can anyone help me? thanks
    Attached Images Attached Images
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: probabily probme with QFileDIalog

    Quote Originally Posted by mickey
    " (*.xml)\n"
    " (*.ler)\n"
    "All Files (*.xml; *.ler)",
    You should use ";;" instead of "\n".

    Quote Originally Posted by mickey
    that the umbra of QFileDIalog disappear only when doManyThings() is executed completely.
    That's because you block the event loop --- use QApplication::processEvents().

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: probabily probme with QFileDIalog

    hi,
    your hint for QFIledialog was OK! But with a dialog create in designer this doens't work!!! what change?? thanks (usually the umbra of initPlainDialog is visible until all this instructions aren't exectute)...
    Qt Code:
    1. void MainForm::fileNew()
    2. {
    3. initPlainDialog *initpd= new initPlainDialog();
    4. if(initpd->exec()){
    5. int vx = initpd->IPDSpinBoxX->value();
    6. int vy = initpd->IPDSpinBoxY->value();
    7. if ((vx > 0 && vy > 0) && (vx*vy <=1024)) {
    8. qApp->processEvents();
    9. doSOmething //very long time
    10. widget1->update(); //long time
    11. }
    To copy to clipboard, switch view to plain text mode 
    Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: probabily probme with QFileDIalog

    Quote Originally Posted by mickey
    doSOmething //very long time
    This blocks the event loop, so you must call QApplication::processEvents() inside it, for example in every iteration.

Similar Threads

  1. QFileDialog hidden files
    By blukske in forum Qt Programming
    Replies: 3
    Last Post: 8th March 2007, 02:11
  2. copy file/s from QFileDialog
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 14:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.