-rw-r--r-- | noncore/multimedia/showimg/showimg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp index c56994d..7c43e11 100644 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/noncore/multimedia/showimg/showimg.cpp @@ -1,110 +1,110 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ // // Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com> // #include "showimg.h" #include <qpe/resource.h> #include <qpe/fileselector.h> #include <qpe/applnk.h> #include <qpe/qpemenubar.h> #include <qwidgetstack.h> #include <qpe/qpetoolbar.h> #include <qaction.h> #include <qfiledialog.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qlabel.h> #include <qpainter.h> #include <qkeycode.h> #include <qapplication.h> #include <qclipboard.h> #include <qtimer.h> -ImagePane::ImagePane( QWidget *parent=0 ) : QWidget( parent ) +ImagePane::ImagePane( QWidget *parent ) : QWidget( parent ) { vb = new QVBoxLayout( this ); image = new ImageWidget( this ); connect(image, SIGNAL( clicked() ), this, SLOT( imageClicked() )); vb->addWidget( image ); status = new QLabel( this ); status->setFixedHeight( fontMetrics().height() + 4 ); vb->addWidget( status ); } void ImagePane::setPixmap( const QPixmap &pm ) { image->setPixmap( pm ); image->repaint( false ); } void ImagePane::imageClicked() { emit clicked(); } void ImagePane::showStatus() { delete vb; vb = new QVBoxLayout( this ); vb->addWidget( image ); status->show(); vb->addWidget( status ); } void ImagePane::hideStatus() { delete vb; vb = new QVBoxLayout( this ); vb->addWidget( image ); status->hide(); } //=========================================================================== /* Draws the portion of the scaled pixmap that needs to be updated */ void ImageWidget::paintEvent( QPaintEvent *e ) { QPainter painter(this); painter.setClipRect(e->rect()); painter.setBrush( black ); painter.drawRect( 0, 0, width(), height() ); if ( pixmap.size() != QSize( 0, 0 ) ) { // is an image loaded? painter.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); } } void ImageWidget::mouseReleaseEvent(QMouseEvent *) { emit clicked(); } |