Tulip  5.4.0
Large graphs analysis and drawing
ShapeDialog.h
1 /*
2  *
3  * This file is part of Tulip (http://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 
20 ///@cond DOXYGEN_HIDDEN
21 
22 #ifndef SHAPEDIALOG_H
23 #define SHAPEDIALOG_H
24 
25 #include <tulip/tulipconf.h>
26 
27 #include <QDialog>
28 #include <QString>
29 #include <QPixmap>
30 
31 namespace Ui {
32 class ShapeDialog;
33 }
34 
35 namespace tlp {
36 
37 class TLP_QT_SCOPE ShapeDialog : public QDialog {
38 
39  Q_OBJECT
40 
41  Ui::ShapeDialog *_ui;
42  QString _selectedShapeName;
43  std::list<std::pair<QString, QPixmap>> shapes;
44 
45 public:
46  ShapeDialog(std::list<std::pair<QString, QPixmap>> &&nodeShapes, QWidget *parent = nullptr);
47  ~ShapeDialog() override;
48 
49  QString getSelectedShapeName() const;
50 
51  void setSelectedShapeName(const QString &shapeName);
52 
53  void accept() override;
54 
55  void showEvent(QShowEvent *) override;
56 
57 protected slots:
58  void updateShapeList();
59 };
60 } // namespace tlp
61 
62 #endif
63 
64 ///@endcond