10 #include <QDialogButtonBox>
11 #include <QPushButton>
12 #include <QVBoxLayout>
28 setWindowTitle(
_(
"Tileset Options"));
30 auto layout =
new QVBoxLayout;
37 auto check =
new QCheckBox(
option.description);
41 connect(check, &QCheckBox::toggled, [
name](
bool checked) {
46 layout->addWidget(check);
49 layout->addSpacing(6);
51 auto buttons =
new QDialogButtonBox(QDialogButtonBox::Close
52 | QDialogButtonBox::Reset);
53 connect(buttons->button(QDialogButtonBox::Close), &QPushButton::clicked,
54 this, &QDialog::accept);
55 connect(buttons->button(QDialogButtonBox::Reset), &QPushButton::clicked,
57 layout->addWidget(buttons);
tileset_options_dialog(struct tileset *t, QWidget *parent=0)
Sets up the tileset options dialog.
std::map< QString, QCheckBox * > m_checks
void reset()
Resets all options to the tileset defaults.
The base class for options.
bool tileset_option_is_enabled(const struct tileset *t, const QString &name)
Checks if an user-settable tileset option is enabled.
std::map< QString, tileset_option > tileset_get_options(const struct tileset *t)
Gets the user-settable options of the tileset.
bool tileset_set_option(struct tileset *t, const QString &name, bool enabled)
Enable or disable a user-settable tileset option.