1 /************************************************************************** 2 * Copyright (C) 2005-2020 by Oleksandr Shneyder * 3 * <o.shneyder@phoca-gmbh.de> * 4 * * 5 * This program is free software; you can redistribute it and/or modify * 6 * it under the terms of the GNU General Public License as published by * 7 * the Free Software Foundation; either version 2 of the License, or * 8 * (at your option) any later version. * 9 * This program is distributed in the hope that it will be useful, * 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 * GNU General Public License for more details. * 13 * * 14 * You should have received a copy of the GNU General Public License * 15 * along with this program. If not, see <https://www.gnu.org/licenses/>. * 16 ***************************************************************************/ 17 18 #ifndef SVGFRAME_H 19 #define SVGFRAME_H 20 #include "x2goclientconfig.h" 21 22 23 #include <QFrame> 24 #include <QtSvg/QSvgRenderer> 25 26 class SVGFrame: public QFrame 27 { 28 29 Q_OBJECT 30 public: 31 SVGFrame ( QString fname, bool st, QWidget* parent=0, Qt::WindowFlags f=0 ); 32 SVGFrame ( QWidget* parent=0, Qt::WindowFlags f=0 ); setRepaintable(bool val)33 void setRepaintable ( bool val ) 34 { 35 repaint=val; 36 } 37 void loadBg ( QString fl ); 38 virtual QSize sizeHint() const; 39 private: 40 QSvgRenderer* renderer; 41 bool repaint; 42 bool drawImg; 43 bool empty; 44 protected: 45 virtual void paintEvent ( QPaintEvent* event ); 46 virtual void resizeEvent ( QResizeEvent* event ); 47 #ifdef Q_OS_WIN 48 virtual void mousePressEvent ( QMouseEvent * event ); 49 private: 50 QWidget* parentWidget; 51 public: setMainWidget(QWidget * widg)52 void setMainWidget ( QWidget* widg ) 53 { 54 parentWidget=widg; 55 } 56 57 #endif 58 59 signals: 60 void resized ( const QSize ); 61 }; 62 63 #endif 64 65