##// END OF EJS Templates
Adds a close button to a zone widget + calls close() method when clicked
Alexandre Leroux -
r245:5c7b5f349cad
parent child
Show More
@@ -4,6 +4,8
4 4
5 5 #include "Visualization/VisualizationGraphWidget.h"
6 6
7 #include <SqpApplication.h>
8
7 9 Q_LOGGING_CATEGORY(LOG_VisualizationZoneWidget, "VisualizationZoneWidget")
8 10
9 11 namespace {
@@ -30,6 +32,11 VisualizationZoneWidget::VisualizationZoneWidget(const QString &name, QWidget *p
30 32 ui->setupUi(this);
31 33
32 34 ui->zoneNameLabel->setText(name);
35
36 // 'Close' options : widget is deleted when closed
37 setAttribute(Qt::WA_DeleteOnClose);
38 connect(ui->closeButton, &QToolButton::clicked, this, &VisualizationZoneWidget::close);
39 ui->closeButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_TitleBarCloseButton));
33 40 }
34 41
35 42 VisualizationZoneWidget::~VisualizationZoneWidget()
@@ -46,6 +46,16
46 46 </property>
47 47 </widget>
48 48 </item>
49 <item>
50 <widget class="QToolButton" name="closeButton">
51 <property name="styleSheet">
52 <string notr="true">background-color: transparent;</string>
53 </property>
54 <property name="text">
55 <string>Close</string>
56 </property>
57 </widget>
58 </item>
49 59 </layout>
50 60 </widget>
51 61 </item>
General Comments 0
You need to be logged in to leave comments. Login now