Ignore:
Timestamp:
Dec 4, 2009, 2:49:22 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

tests/widget: Added QFileDialog test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/widget/widget.cpp

    r368 r380  
    501501int main(int argc, char **argv)
    502502{
    503 #if 1
     503#if 0
    504504    ////////////////////////////////////////////////////////////////////////////
    505505    // Text mode
     
    548548#endif
    549549
    550 #if 1
     550#if 0
    551551    //--------------------------------------------------------------------------
    552552    // QDir::mkdir/mkpath test
     
    598598
    599599    QApplication app(argc, argv);
     600    app.setQuitOnLastWindowClosed(true);
    600601
    601602#if 0
     
    636637
    637638#if 0
     639    //--------------------------------------------------------------------------
     640    // QFontDialog test
    638641    {
    639642        QFontDialog fntDlg;
     
    653656#endif
    654657
     658#if 1
     659    //--------------------------------------------------------------------------
     660    // QFileDialog test
     661    {
     662        QFileDialog dlg;
     663
     664        dlg.setFileMode(QFileDialog::ExistingFile);
     665        //dlg.setFilter(QDir::Dirs | QDir::Files | QDir::Drives);
     666        dlg.setNameFilter("*.exe");
     667        dlg.selectFile("mplayer.exe");
     668        dlg.exec();
     669
     670        //PRINT_EXPR(QFileDialog::getOpenFileName());
     671    }
     672#endif
     673
    655674#if 0
    656675    QSound snd2("C:/MMOS2/SOUNDS/DESKTOP/dsk_shut.wav");
     
    681700#endif
    682701
    683     return app.exec();
     702    if (!app.topLevelWidgets().isEmpty())
     703        return app.exec();
     704
     705    return 0;
    684706#endif
    685707}
Note: See TracChangeset for help on using the changeset viewer.