예제 #1
0
bool CreateButtonGroupCommand::init(const ButtonList &bl)
{
    if (bl.empty())
        return false;
    QDesignerFormWindowInterface *fw = formWindow();
    QButtonGroup *buttonGroup = new QButtonGroup(fw->mainContainer());
    buttonGroup->setObjectName(QLatin1String("buttonGroup"));
    fw->ensureUniqueObjectName(buttonGroup);
    initialize(bl, buttonGroup);
    return true;
}
예제 #2
0
bool RemoveButtonsFromGroupCommand::init(const ButtonList &bl)
{
    if (bl.empty())
        return false;
    QButtonGroup *group = bl.front()->group();
    if (!group)
        return false;
    if (bl.size() >= group->buttons().size())
        return false;
    initialize(bl, group);
    //: Command description for removing buttons from a QButtonGroup
    setText(QApplication::translate("Command", "Remove '%1' from '%2'").arg(nameList(bl), group->objectName()));
    return true;
}