##// END OF EJS Templates
Adds "number of operations" and "number of variables" properties for the tests
Adds "number of operations" and "number of variables" properties for the tests

File last commit:

r1162:73d5f3ef941a
r1170:3da18e6983d5
Show More
CatalogueExplorerHelper.cpp
32 lines | 1.2 KiB | text/x-c | CppLexer
/ gui / src / Catalogue / CatalogueExplorerHelper.cpp
"Apply" and "cancel" buttons on an event
r1162 #include "Catalogue/CatalogueExplorerHelper.h"
#include <QBoxLayout>
#include <QToolButton>
const auto VALIDATION_BUTTON_ICON_SIZE = 12;
QWidget *CatalogueExplorerHelper::buildValidationWidget(QWidget *parent, std::function<void()> save,
std::function<void()> discard)
{
auto widget = new QWidget{parent};
auto layout = new QHBoxLayout{widget};
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
auto btnValid = new QToolButton{widget};
btnValid->setIcon(QIcon{":/icones/save"});
btnValid->setIconSize(QSize{VALIDATION_BUTTON_ICON_SIZE, VALIDATION_BUTTON_ICON_SIZE});
btnValid->setAutoRaise(true);
QObject::connect(btnValid, &QToolButton::clicked, save);
layout->addWidget(btnValid);
auto btnDiscard = new QToolButton{widget};
btnDiscard->setIcon(QIcon{":/icones/discard"});
btnDiscard->setIconSize(QSize{VALIDATION_BUTTON_ICON_SIZE, VALIDATION_BUTTON_ICON_SIZE});
btnDiscard->setAutoRaise(true);
QObject::connect(btnDiscard, &QToolButton::clicked, discard);
layout->addWidget(btnDiscard);
return widget;
}