Ignore:
Timestamp:
Nov 24, 2009, 1:07:03 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

tests/widget: Added simple QClipboard image test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/widget/widget.cpp

    r341 r346  
    306306    };
    307307
    308 #if 0
     308#if 1
    309309    void paintEvent(QPaintEvent *aE)
    310310    {
     
    312312
    313313        QPainter p(this);
     314#if 0
     315        // simple QPainter test
     316
    314317        p.setRenderHint(QPainter::Antialiasing);
    315318
     
    321324        //p.setFont(QFont("Arial", 12));
    322325        p.drawText(10, 30, QLatin1String("ABC"));
     326#endif
     327#if 1
     328        // simple QClipboard image test
     329
     330        const QMimeData *data = QApplication::clipboard()->mimeData();
     331        if (data && data->hasImage()){
     332            QImage img = qvariant_cast<QImage>(data->imageData());
     333            p.drawImage(0, 0, img);
     334        }
     335#endif
    323336    }
    324337#endif
     
    455468int main(int argc, char **argv)
    456469{
    457 #if 1
     470#if 0
    458471    ////////////////////////////////////////////////////////////////////////////
    459472    // Text mode
Note: See TracChangeset for help on using the changeset viewer.