Tulip 5.7.1
Large graphs analysis and drawing
Loading...
Searching...
No Matches
CoordEditor.h
1/*
2 *
3 * This file is part of Tulip (https://tulip.labri.fr)
4 *
5 * Authors: David Auber and the Tulip development Team
6 * from LaBRI, University of Bordeaux
7 *
8 * Tulip is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3
11 * of the License, or (at your option) any later version.
12 *
13 * Tulip is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
17 *
18 */
19///@cond DOXYGEN_HIDDEN
20
21#ifndef COORDEDITOR_H
22#define COORDEDITOR_H
23
24#include <QDialog>
25
26#include <tulip/Coord.h>
27#include <tulip/tulipconf.h>
28
29namespace Ui {
30class CoordEditor;
31}
32
33namespace tlp {
34/**
35 * @brief Simple Coord edition widget.
36 **/
37class TLP_QT_SCOPE CoordEditor : public QDialog {
38 Q_OBJECT
39 Q_PROPERTY(Coord coord READ coord WRITE setCoord NOTIFY coordChanged)
40
41 Ui::CoordEditor *ui;
42 Coord currentCoord;
43
44public:
45 explicit CoordEditor(QWidget *parent = nullptr, bool editSize = false);
46 ~CoordEditor() override;
47
48 tlp::Coord coord() const;
49
50 // redefinition to ensure it is shown in the center of its parent
51 void showEvent(QShowEvent *ev) override;
52
53public slots:
54 void setCoord(const tlp::Coord &s);
55 // redefinition to ensure to catch the end of input
56 void done(int r) override;
57
58signals:
59 void coordChanged(tlp::Coord coord);
60
61private slots:
62 void coordUpdated();
63};
64} // namespace tlp
65
66#endif // COORDEDITOR_H
67///@endcond