Ignore:
Timestamp:
Jan 27, 2010, 10:09:56 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

tests/widget: Added simple QCursor test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/widget/widget.cpp

    r435 r481  
    250250    MyWidget() : mPressed(0)
    251251    {
    252 //      setFocusPolicy(Qt::StrongFocus);
    253 
    254 #if 1
     252#if 0
    255253        MyButton *btn1 = new MyButton(this);
    256254        btn1->setText(QLatin1String("&Hello (also Ctrl+H)"));
     
    398396#endif
    399397
    400 #if 1
     398#if 0
    401399    void keyPressEvent(QKeyEvent *aE)
    402400    {
     
    417415                 << QDbgStr(aE->text().isEmpty() ? QString() :
    418416                            QString().sprintf("(%04X)", aE->text()[0].unicode()));
     417    }
     418#endif
     419
     420#if 1
     421    // QCursor shape test
     422    void mousePressEvent(QMouseEvent *aE)
     423    {
     424        static int shape = 0;
     425        if (aE->button() == Qt::LeftButton)
     426            ++shape;
     427        else
     428            --shape;
     429        shape = (Qt::LastCursor + 1 + shape) % (Qt::LastCursor + 1);
     430        setCursor(QCursor((Qt::CursorShape)shape));
    419431    }
    420432#endif
Note: See TracChangeset for help on using the changeset viewer.