1 /************************************************************************************* 2 * Copyright (C) 2009 by Aleix Pol <aleixpol@kde.org> * 3 * * 4 * This program is free software; you can redistribute it and/or * 5 * modify it under the terms of the GNU General Public License * 6 * as published by the Free Software Foundation; either version 2 * 7 * of the License, or (at your option) any later version. * 8 * * 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, write to the Free Software * 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 17 *************************************************************************************/ 18 19 #ifndef VIEWPORTWIDGET_H 20 #define VIEWPORTWIDGET_H 21 22 #include <QWidget> 23 class QDoubleSpinBox; 24 25 class ViewportWidget : public QWidget 26 { 27 Q_OBJECT 28 public: 29 explicit ViewportWidget(QWidget * parent = 0); 30 31 QRectF viewport() const; 32 33 public Q_SLOTS: 34 void setViewport(const QRectF& current); 35 36 private Q_SLOTS: 37 void emitViewport(); 38 39 Q_SIGNALS: 40 void viewportChange(const QRectF& newViewport); 41 42 private: 43 QDoubleSpinBox* m_left; 44 QDoubleSpinBox* m_top; 45 QDoubleSpinBox* m_width; 46 QDoubleSpinBox* m_height; 47 }; 48 49 #endif // VIEWPORTDIALOG_H 50