Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TileSetter::TileSetter(QWidget *parent) : QDialog(parent) {
- ui.setupUi(this);
- show();
- ui.flowlayout_placeholder_1->addLayout(selected_layout);
- for (int i = 0; i < 6; i++) {
- QPushButton* button = new QPushButton;
- button->setFixedSize(64, 64);
- button->setIconSize({ 64, 64 });
- button->setCheckable(true);
- selected_layout->addWidget(button);
- }
- connect(ui.additionalAdd, &QPushButton::clicked, this, &TileSetter::add_tile);
- }
- void TileSetter::add_tile() {
- QPushButton* button = new QPushButton;
- button->setFixedSize(64, 64);
- button->setIconSize({ 64, 64 });
- button->setCheckable(true);
- selected_layout->addWidget(button);
- }
- // This is the raw .ui file code
- // it is probably easier to create 1 button named additionalAdd and one layout named flowlayout_placeholder_1
- //
- /********************************************************************************
- ** Form generated from reading UI file 'TileSetterwyEefc.ui'
- **
- ** Created by: Qt User Interface Compiler version 5.10.0
- **
- ** WARNING! All changes made in this file will be lost when recompiling UI file!
- ********************************************************************************/
- #ifndef TILESETTERWYEEFC_H
- #define TILESETTERWYEEFC_H
- #include <QtCore/QVariant>
- #include <QtWidgets/QAction>
- #include <QtWidgets/QApplication>
- #include <QtWidgets/QButtonGroup>
- #include <QtWidgets/QDialogButtonBox>
- #include <QtWidgets/QHBoxLayout>
- #include <QtWidgets/QHeaderView>
- #include <QtWidgets/QPushButton>
- #include <QtWidgets/QVBoxLayout>
- #include <QtWidgets/QWidget>
- QT_BEGIN_NAMESPACE
- class Ui_TileSetter
- {
- public:
- QVBoxLayout *verticalLayout;
- QHBoxLayout *flowlayout_placeholder_1;
- QPushButton *additionalAdd;
- QDialogButtonBox *buttonBox;
- void setupUi(QWidget *TileSetter)
- {
- if (TileSetter->objectName().isEmpty())
- TileSetter->setObjectName(QStringLiteral("TileSetter"));
- TileSetter->setWindowModality(Qt::WindowModal);
- TileSetter->resize(579, 162);
- QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- sizePolicy.setHorizontalStretch(0);
- sizePolicy.setVerticalStretch(0);
- sizePolicy.setHeightForWidth(TileSetter->sizePolicy().hasHeightForWidth());
- TileSetter->setSizePolicy(sizePolicy);
- TileSetter->setMinimumSize(QSize(0, 0));
- verticalLayout = new QVBoxLayout(TileSetter);
- verticalLayout->setSpacing(6);
- verticalLayout->setContentsMargins(11, 11, 11, 11);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
- verticalLayout->setSizeConstraint(QLayout::SetDefaultConstraint);
- flowlayout_placeholder_1 = new QHBoxLayout();
- flowlayout_placeholder_1->setSpacing(6);
- flowlayout_placeholder_1->setObjectName(QStringLiteral("flowlayout_placeholder_1"));
- flowlayout_placeholder_1->setSizeConstraint(QLayout::SetDefaultConstraint);
- verticalLayout->addLayout(flowlayout_placeholder_1);
- additionalAdd = new QPushButton(TileSetter);
- additionalAdd->setObjectName(QStringLiteral("additionalAdd"));
- verticalLayout->addWidget(additionalAdd);
- buttonBox = new QDialogButtonBox(TileSetter);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
- buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
- verticalLayout->addWidget(buttonBox);
- retranslateUi(TileSetter);
- QMetaObject::connectSlotsByName(TileSetter);
- } // setupUi
- void retranslateUi(QWidget *TileSetter)
- {
- TileSetter->setWindowTitle(QApplication::translate("TileSetter", "TileSetter", nullptr));
- additionalAdd->setText(QApplication::translate("TileSetter", "PushButton", nullptr));
- } // retranslateUi
- };
- namespace Ui {
- class TileSetter: public Ui_TileSetter {};
- } // namespace Ui
- QT_END_NAMESPACE
- #endif // TILESETTERWYEEFC_H
Advertisement
Add Comment
Please, Sign In to add comment