Theme Editor: Made allll destructors virtual
[kugel-rb.git] / utils / themeeditor / gui / skinviewer.cpp
blob152450e1498128de9937b4b528aecb2d81fd79d9
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2010 Robert Bieber
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "skinviewer.h"
23 #include "ui_skinviewer.h"
25 SkinViewer::SkinViewer(QWidget *parent) :
26 QWidget(parent),
27 ui(new Ui::SkinViewer)
29 ui->setupUi(this);
31 QObject::connect(ui->zoomOutButton, SIGNAL(pressed()),
32 this, SLOT(zoomOut()));
33 QObject::connect(ui->zoomInButton, SIGNAL(pressed()),
34 this, SLOT(zoomIn()));
37 SkinViewer::~SkinViewer()
39 delete ui;
42 void SkinViewer::changeEvent(QEvent *e)
44 QWidget::changeEvent(e);
45 switch (e->type()) {
46 case QEvent::LanguageChange:
47 ui->retranslateUi(this);
48 break;
49 default:
50 break;
54 void SkinViewer::setScene(QGraphicsScene *scene)
56 ui->viewer->setScene(scene);
59 void SkinViewer::zoomIn()
61 ui->viewer->scale(1.2, 1.2);
64 void SkinViewer::zoomOut()
66 ui->viewer->scale(1/1.2, 1/1.2);