Ignore:
Timestamp:
Feb 2, 2010, 10:58:40 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

tests/widgets: Testcase for adding and removing application-defined fonts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/widget/widget.cpp

    r499 r501  
    9494    void mousePressEvent(QMouseEvent *aE)
    9595    {
     96
    9697        ++mPressed;
    9798        update();
     
    100101    void mouseReleaseEvent(QMouseEvent *aE)
    101102    {
     103
    102104        ++mPressed;
    103105        update();
     
    494496        switch (aE->type())
    495497        {
    496 #if 1
     498#if
    497499        case QEvent::Enter:
    498500            qDebug() << this << "Enter";
     
    708710#endif
    709711
    710 #if 1
     712#if
    711713    QRect r = QApplication::desktop()->availableGeometry();
    712714    MyWidget widget;
     
    734736#endif
    735737
    736 #if 0
     738#if
    737739    //--------------------------------------------------------------------------
    738740    // QFontDialog test
    739741    {
     742
     743
     744
     745
     746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
     757
    740758        QFontDialog fntDlg;
    741759        fntDlg.exec();
    742760
     761
     762
     763
     764
     765
    743766        {
    744767            QFont font("MyCoolFont");
    745             QFontInfo info(font);
    746             qDebug() << info.family();
    747         }
    748         {
    749             QFont font("MyCoolFont2");
    750768            QFontInfo info(font);
    751769            qDebug() << info.family();
     
    798816#endif
    799817
    800     if (!app.topLevelWidgets().isEmpty())
     818    bool haveVisibleTops = false;
     819    foreach(QWidget *top, app.topLevelWidgets()) {
     820        if (top->isVisible()) {
     821            haveVisibleTops = true;
     822            break;
     823        }
     824    }
     825
     826    if (haveVisibleTops)
    801827        return app.exec();
    802828
Note: See TracChangeset for help on using the changeset viewer.