![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 00022 #ifndef COORDEDITOR_H 00023 #define COORDEDITOR_H 00024 00025 #include <QDialog> 00026 00027 #include <tulip/Coord.h> 00028 #include <tulip/tulipconf.h> 00029 00030 namespace Ui { 00031 class CoordEditor; 00032 } 00033 00034 namespace tlp { 00035 /** 00036 * @brief Simple Coord edition widget. 00037 **/ 00038 class TLP_QT_SCOPE CoordEditor : public QDialog { 00039 Q_OBJECT 00040 Q_PROPERTY(Coord coord READ coord WRITE setCoord NOTIFY coordChanged) 00041 00042 Ui::CoordEditor *ui; 00043 Coord currentCoord; 00044 00045 public: 00046 explicit CoordEditor(QWidget *parent = 0, bool editSize = false); 00047 ~CoordEditor(); 00048 00049 tlp::Coord coord() const; 00050 00051 // redefinition to ensure it is shown in the center of its parent 00052 void showEvent(QShowEvent* ev); 00053 00054 00055 public slots: 00056 void setCoord(const tlp::Coord& s); 00057 // redefinition to ensure to catch the end of input 00058 void done(int r); 00059 00060 signals: 00061 void coordChanged(tlp::Coord coord); 00062 00063 private slots: 00064 void coordUpdated(); 00065 }; 00066 } 00067 00068 #endif // COORDEDITOR_H 00069 ///@endcond