• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
imageviewer.h
Go to the documentation of this file.
1 /***************************************************************************
2  imageviewer.h - An ImageViewer for KStars
3  -------------------
4  begin : Mon Aug 27 2001
5  copyright : (C) 2001 by Thomas Kabelmann
6  email : tk78@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef IMAGEVIEWER_H_
19 #define IMAGEVIEWER_H_
20 
21 #include <QFrame>
22 #include <QFile>
23 #include <QImage>
24 #include <QPixmap>
25 
26 #include <kio/job.h>
27 #include <kdialog.h>
28 
29 class KUrl;
30 class QLabel;
31 class QVBoxLayout;
32 
33 class ImageLabel : public QFrame {
34  Q_OBJECT
35 public:
36  explicit ImageLabel( QWidget *parent );
37  ~ImageLabel();
38  void setImage( const QImage &img ) { m_Image = img; }
39 
40  QImage m_Image; // ImageViewer needs access to the image in order to modify it
41 protected:
42  void paintEvent( QPaintEvent *e);
43 
44 };
45 
61 class ImageViewer : public KDialog {
62  Q_OBJECT
63 
64 public:
66  ImageViewer (const KUrl &imageURL, const QString &capText, QWidget *parent = 0);
67 
68  explicit ImageViewer ( QString FileName, QWidget *parent = 0);
69 
71  ~ImageViewer();
72 
73 private:
77  void showImage( void );
78 
80  void loadImageFromURL( void );
81 
83  void saveFile (KUrl &url);
84 
85  QFile file;
86 
87  const KUrl m_ImageUrl;
88  bool fileIsImage;
89  QString filename;
90 
91  KIO::Job *downloadJob; // download job of image -> 0 == no job is running
92 
93  ImageLabel *m_View;
94  QLabel *m_Caption;
95 
96 private slots:
98  void init(QString caption, QString capText);
100  void downloadReady (KJob *);
101 
103  void saveFileToDisc();
104 
106  void invertColors();
107 };
108 
109 #endif
ImageLabel::ImageLabel
ImageLabel(QWidget *parent)
Definition: imageviewer.cpp:44
QWidget
ImageLabel::~ImageLabel
~ImageLabel()
Definition: imageviewer.cpp:51
ImageLabel::paintEvent
void paintEvent(QPaintEvent *e)
Definition: imageviewer.cpp:54
KDialog
ImageViewer::~ImageViewer
~ImageViewer()
Destructor.
Definition: imageviewer.cpp:148
ImageViewer
Image viewer window for KStars.
Definition: imageviewer.h:61
ImageLabel::m_Image
QImage m_Image
Definition: imageviewer.h:40
ImageLabel::setImage
void setImage(const QImage &img)
Definition: imageviewer.h:38
QLabel
ImageViewer::ImageViewer
ImageViewer(const KUrl &imageURL, const QString &capText, QWidget *parent=0)
Create image viewer from URL with caption.
Definition: imageviewer.cpp:64
QFrame
ImageLabel
Definition: imageviewer.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal