tests/auto/macgui/tst_macgui.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
    58 private slots:
    58 private slots:
    59     void scrollbarPainting();
    59     void scrollbarPainting();
    60     
    60     
    61     void dummy();
    61     void dummy();
    62     void splashScreenModality();
    62     void splashScreenModality();
    63     void dialogModality();
       
    64     void nonModalOrder();
    63     void nonModalOrder();
    65 
    64 
    66     void spinBoxArrowButtons();
    65     void spinBoxArrowButtons();
    67 };
    66 };
    68 
    67 
   151     clickLater(interface, Qt::LeftButton, delay);
   150     clickLater(interface, Qt::LeftButton, delay);
   152 
   151 
   153     // Show dialog and and enter event loop.
   152     // Show dialog and and enter event loop.
   154     connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot()));
   153     connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot()));
   155     const int timeout = 4;
   154     const int timeout = 4;
   156     QTestEventLoop::instance().enterLoop(timeout);
       
   157     QVERIFY(QTestEventLoop::instance().timeout() == false);
       
   158 }
       
   159 
       
   160 
       
   161 /*
       
   162     Test that a non-modal dialog created as a child of a modal dialog is
       
   163     shown in front.
       
   164 */
       
   165 void tst_MacGui::dialogModality()
       
   166 { 
       
   167     QDialog d;
       
   168     d.setModal(true);
       
   169     d.show();
       
   170     
       
   171     QProgressDialog progress(&d);
       
   172     progress.setValue(2);
       
   173 
       
   174     InterfaceChildPair interface = wn.find(QAccessible::Name, "Cancel", &progress);
       
   175     QVERIFY(interface.iface);
       
   176     const int delay = 2000;
       
   177     clickLater(interface, Qt::LeftButton, delay);
       
   178     
       
   179     connect(&progress, SIGNAL(canceled()), SLOT(exitLoopSlot()));
       
   180 
       
   181     const int timeout = 3;
       
   182     QTestEventLoop::instance().enterLoop(timeout);
   155     QTestEventLoop::instance().enterLoop(timeout);
   183     QVERIFY(QTestEventLoop::instance().timeout() == false);
   156     QVERIFY(QTestEventLoop::instance().timeout() == false);
   184 }
   157 }
   185 
   158 
   186 class PrimaryWindowDialog : public QDialog
   159 class PrimaryWindowDialog : public QDialog