ade4c7fd6099d26fb41dfd4be2c03eea05329dd9
[kugel-rb.git] / utils / themeeditor / gui / skinviewer.cpp
blobade4c7fd6099d26fb41dfd4be2c03eea05329dd9
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()));
36 ui->viewer->setDragMode(QGraphicsView::ScrollHandDrag);
39 SkinViewer::~SkinViewer()
41 delete ui;
44 void SkinViewer::changeEvent(QEvent *e)
46 QWidget::changeEvent(e);
47 switch (e->type()) {
48 case QEvent::LanguageChange:
49 ui->retranslateUi(this);
50 break;
51 default:
52 break;
56 void SkinViewer::setScene(QGraphicsScene *scene)
58 ui->viewer->setScene(scene);
61 void SkinViewer::zoomIn()
63 ui->viewer->scale(1.2, 1.2);
66 void SkinViewer::zoomOut()
68 ui->viewer->scale(1/1.2, 1/1.2);