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 #include "imgframe.h" 19 20 #include "x2goclientconfig.h" 21 #include <QResizeEvent> 22 IMGFrame(QImage *,QWidget * parent,Qt::WindowFlags f)23IMGFrame::IMGFrame(QImage* ,QWidget* parent, Qt::WindowFlags f) :QFrame(parent,f) 24 { 25 //setBg(img); 26 } 27 28 ~IMGFrame()29IMGFrame::~IMGFrame() 30 { 31 } 32 setBg(QImage * img)33void IMGFrame::setBg(QImage* img) 34 { 35 if(img) 36 { 37 setAutoFillBackground(true); 38 QPalette pal=palette(); 39 pal.setBrush(QPalette::Window,QBrush(QPixmap::fromImage(*img))); 40 setPalette(pal); 41 } 42 } 43 resizeEvent(QResizeEvent * event)44void IMGFrame::resizeEvent(QResizeEvent* event) 45 { 46 QFrame::resizeEvent(event); 47 emit resized(event->size()); 48 } 49