PSQt/src/pixmap.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------
00002 // File and Version Information:
00003 //   $Id: pixmap.cpp 9841 2015-03-26 18:35:44Z dubrovin@SLAC.STANFORD.EDU $
00004 //
00005 // Author: Mikhail S. Dubrovin
00006 //---------------------------------------------------------------------
00007 
00008 #include "PSQt/pixmap.h"
00009 #include <QApplication>
00010 #include <QPainter>
00011 
00012 #include <QtCore>
00013 
00014 namespace PSQt {
00015 
00016 Pixmap::Pixmap(QWidget *parent)
00017     : QWidget(parent)
00018 {
00019 }
00020 
00021 void Pixmap::paintEvent(QPaintEvent *event)
00022 {
00023    QRectF  target(10.0, 20.0, 180.0, 160.0);
00024    QRectF  source(0.0, 0.0, 170.0, 140.0);
00025    //QPixmap image(":myPixmap.png");
00026    //QPixmap image( QSize(200,100) );
00027    QPixmap image( 200,100 );
00028    //image.fill( QColor("#d4d4d4") );
00029    image.fill( Qt::blue );
00030    QPainter painter(this);
00031    painter.drawPixmap(target, image, source);
00032 }
00033 
00034 } // namespace PSQt

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7