本文整理汇总了C++中createGroup函数的典型用法代码示例。如果您正苦于以下问题:C++ createGroup函数的具体用法?C++ createGroup怎么用?C++ createGroup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createGroup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void CreateGroupWindow::verifyGroupName()
{
QString groupName = Utilities::htmlToWAText(ui->textEdit->toHtml());
if (groupName.isEmpty())
{
QMaemo5InformationBox::information(this,"Name can't be empty",
QMaemo5InformationBox::NoTimeout);
}
else if (groupName.length() > 25)
{
QMaemo5InformationBox::information(this,"Name can't be longer than 25 characters",
QMaemo5InformationBox::NoTimeout);
}
else
{
SelectGroupParticipantsWindow *window =
new SelectGroupParticipantsWindow(roster,this);
connect(window,SIGNAL(createGroup(QStringList)),
this,SLOT(createGroup(QStringList)));
window->setAttribute(Qt::WA_Maemo5StackedWindow);
window->setAttribute(Qt::WA_DeleteOnClose);
window->setWindowFlags(window->windowFlags() | Qt::Window);
window->show();
}
}
示例2: QWidget
GroupWidget::GroupWidget(QList <Group*> *group, QWidget *parent)
: QWidget(parent), groupList(group)
{
QHBoxLayout *h1 = new QHBoxLayout();
{
QLabel *l = new QLabel(tr("Group: "));
addGroupEdit = new QLineEdit(this);
connect(addGroupEdit, SIGNAL(editingFinished()), SLOT(createGroup()));
addButton = new QPushButton(tr("Create"), this);
connect(addGroupEdit, SIGNAL(textChanged(QString)),
SLOT(changeAddGroup(QString)));
connect(addButton, SIGNAL(clicked()), SLOT(createGroup()));
addButton->setEnabled(false);
h1->addWidget(l);
h1->addWidget(addGroupEdit);
h1->addWidget(addButton);
}
QHBoxLayout *h2 = new QHBoxLayout();
{
h2->setMargin(0);
upButton = new QPushButton(this);
upButton->setIcon(QIcon(":images/uparrow.png"));
downButton = new QPushButton(this);
downButton->setIcon(QIcon(":images/downarrow.png"));
h2->addStretch();
h2->addWidget(upButton);
h2->addWidget(downButton);
editButton = new QPushButton(this);
editButton->setIcon(QIcon(":images/edit.png"));
h2->addWidget(editButton);
delButton = new QPushButton(this);
delButton->setIcon(QIcon(":images/delete.png"));
h2->addWidget(delButton);
}
groupListWidget = new QListWidget(this);
QVBoxLayout *v = new QVBoxLayout;
v->setMargin(0);
v->setSpacing(0);
v->addLayout(h1);
v->addWidget(groupListWidget);
v->addLayout(h2);
setLayout(v);
//qDebug() << "BookWidget 3";
connect(upButton, SIGNAL(clicked()), SLOT(upItem()));
connect(downButton, SIGNAL(clicked()), SLOT(downItem()));
connect(editButton, SIGNAL(clicked()), SLOT(editItem()));
connect(delButton, SIGNAL(clicked()), SLOT(delItem()));
connect(groupListWidget, SIGNAL(currentRowChanged(int)),
SLOT(changeRow(int)));
connect(groupListWidget, SIGNAL(itemChanged(QListWidgetItem*)),
SLOT(changeName(QListWidgetItem*)));
connect(groupListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
SLOT(editItem(QListWidgetItem*)));
connect(groupListWidget,
SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem*)),
SLOT(changeSelect(QListWidgetItem *, QListWidgetItem*)));
initGroup();
resetButtons();
}
示例3: createDataSet
int KWEFile::createFileStructure()
{
const uint16 ver = 2;
if (createGroup("/recordings")) return -1;
if (createGroup("/event_types")) return -1;
for (int i=0; i < eventNames.size(); i++)
{
ScopedPointer<HDF5RecordingData> dSet;
String path = "/event_types/" + eventNames[i];
if (createGroup(path)) return -1;
path += "/events";
if (createGroup(path)) return -1;
dSet = createDataSet(U64,0,EVENT_CHUNK_SIZE,path + "/time_samples");
if (!dSet) return -1;
dSet = createDataSet(U16,0,EVENT_CHUNK_SIZE,path + "/recording");
if (!dSet) return -1;
path += "/user_data";
if (createGroup(path)) return -1;
dSet = createDataSet(U8,0,EVENT_CHUNK_SIZE,path + "/eventID");
if (!dSet) return -1;
dSet = createDataSet(U8,0,EVENT_CHUNK_SIZE,path + "/nodeID");
if (!dSet) return -1;
dSet = createDataSet(eventTypes[i],0,EVENT_CHUNK_SIZE,path + "/" + eventDataNames[i]);
if (!dSet) return -1;
}
if (setAttribute(U16,(void*)&ver,"/","kwik_version")) return -1;
return 0;
}
示例4: QWidget
GroupsTab::GroupsTab(GroupManager* manager, QWidget* parent): QWidget(parent)
{
this->manager = manager;
//scrollArea = new QScrollArea(this);
//scrollArea->setLayout(scrolledLayout);
//scrolledWidget = new QWidget(scrollArea);
//scrolledWidget = scrollArea;
//scrolledLayout = new QVBoxLayout(scrolledWidget);
layout = new QVBoxLayout(this);
foreach(QString name, manager->groupNames())
createGroup(name);
//scrollArea->setWidget(scrolledWidget);
//layout->addWidget(scrollArea);
QObject::connect(manager, SIGNAL(groupCreated(QString)), this, SLOT(createGroup(QString)));
QObject::connect(manager, SIGNAL(groupRemoved(QString)), this, SLOT(removeGroup(QString)));
}
示例5: switch
void GxsGroupDialog::submitGroup()
{
std::cerr << "GxsGroupDialog::submitGroup()";
std::cerr << std::endl;
/* switch depending on mode */
switch (mode())
{
case MODE_CREATE:
{
/* just close if down */
createGroup();
}
break;
case MODE_SHOW:
{
/* just close if down */
cancelDialog();
}
break;
case MODE_EDIT:
{
editGroup();
}
break;
}
}
示例6: throw
ECDSAKeyPair::ECDSAKeyPair(const EllipticCurve & curve) throw (AsymmetricKeyException) {
this->key = NULL;
this->engine = NULL;
EC_GROUP * group = createGroup(curve);
generateKey(group);
EC_GROUP_free(group);
}
示例7: createFileStructure
int KWDFile::createFileStructure()
{
const uint16 ver = 2;
if (createGroup("/recordings")) return -1;
if (setAttribute(U16,(void*)&ver,"/","kwik_version")) return -1;
return 0;
}
示例8: QDesignerTaskMenu
ButtonTaskMenu::ButtonTaskMenu(QAbstractButton *button, QObject *parent) :
QDesignerTaskMenu(button, parent),
m_assignGroupSubMenu(new QMenu),
m_assignActionGroup(0),
m_assignToGroupSubMenuAction(new QAction(tr("Assign to button group"), this)),
m_currentGroupSubMenu(new QMenu),
m_currentGroupSubMenuAction(new QAction(tr("Button group"), this)),
m_createGroupAction(new QAction(tr("New button group"), this)),
m_preferredEditAction(new QAction(tr("Change text..."), this)),
m_removeFromGroupAction(new QAction(tr("None"), this))
{
connect(m_createGroupAction, SIGNAL(triggered()), this, SLOT(createGroup()));
TaskMenuInlineEditor *textEditor = new ButtonTextTaskMenuInlineEditor(button, this);
connect(m_preferredEditAction, SIGNAL(triggered()), textEditor, SLOT(editText()));
connect(m_removeFromGroupAction, SIGNAL(triggered()), this, SLOT(removeFromGroup()));
m_assignToGroupSubMenuAction->setMenu(m_assignGroupSubMenu);
m_currentGroupSubMenu->addAction(m_groupMenu.breakGroupAction());
m_currentGroupSubMenu->addAction(m_groupMenu.selectGroupAction());
m_currentGroupSubMenuAction->setMenu(m_currentGroupSubMenu);
m_taskActions.append(m_preferredEditAction);
m_taskActions.append(m_assignToGroupSubMenuAction);
m_taskActions.append(m_currentGroupSubMenuAction);
m_taskActions.append(createSeparator());
}
示例9: createGroup
void ResourceManager::addTexture(
const std::string& id,
resource_group::ResourceGroup resourceGroup,
const std::string& filePath,
unsigned frameRate,
bool repeat,
unsigned begin,
unsigned end,
unsigned flags )
{
// create the textures group if we need to
createGroup( TEXTURE );
// insert in to the map
m_resources[TEXTURE].insert( std::make_pair( id,
t_ResourcePtr( new TextureResource(
resourceGroup,
filePath,
frameRate,
repeat,
begin,
end,
flags
) )
) );
}
示例10: qDebug
void Widget::onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t Change)
{
Group* g = GroupList::findGroup(groupnumber);
if (!g)
{
qDebug() << "Widget::onGroupNamelistChanged: Group not found, creating it";
g = createGroup(groupnumber);
}
QString name = core->getGroupPeerName(groupnumber, peernumber);
TOX_CHAT_CHANGE change = static_cast<TOX_CHAT_CHANGE>(Change);
if (change == TOX_CHAT_CHANGE_PEER_ADD)
{
if (name.isEmpty())
name = tr("<Unknown>", "Placeholder when we don't know someone's name in a group chat");
g->addPeer(peernumber,name);
//g->chatForm->addSystemInfoMessage(tr("%1 has joined the chat").arg(name), "green");
// we can't display these messages until irungentoo fixes peernumbers
// https://github.com/irungentoo/toxcore/issues/1128
}
else if (change == TOX_CHAT_CHANGE_PEER_DEL)
{
g->removePeer(peernumber);
//g->chatForm->addSystemInfoMessage(tr("%1 has left the chat").arg(name), "silver");
}
else if (change == TOX_CHAT_CHANGE_PEER_NAME) // core overwrites old name before telling us it changed...
g->updatePeer(peernumber,core->getGroupPeerName(groupnumber, peernumber));
}
示例11: assert
void ParameterValue::write(const H5::CommonFG &loc,
const H5::H5Location &parent) const {
assert(invariant());
auto group = loc.createGroup(name);
H5::createAttribute(group, "type", parameter.lock()->project.lock()->enumtype,
"ParameterValue");
H5::createAttribute(group, "name", name);
H5::createHardLink(group, "parameter", parent,
string("project/parameters/") + parameter.lock()->name);
switch (value_type) {
case type_empty:
// do nothing
break;
case type_int:
H5::createAttribute(group, "data", value_int);
break;
case type_double:
H5::createAttribute(group, "data", value_double);
break;
case type_string:
H5::createAttribute(group, "data", value_string);
break;
default:
assert(0);
}
group.createGroup("configurations");
}
示例12: createGroup
void GroupMgr::addObjectInstance(
const GroupID &id,
const std::string &objInstanceName,
const GroupInstanceType type
)
{
if( groups.find(id) == groups.end() )
{
// not exist
createGroup(id);
}
std::map<GroupID, Group>::iterator i = groups.find(id);
assert(i != groups.end());
switch( type )
{
case GIT_Camera:
i->second.addCameraInstance( objInstanceName );
break;
case GIT_Geometry:
i->second.addMeshInstance( objInstanceName );
break;
default:
liquidMessage2(messageError, "group instance type %d is unknown.",type);
assert(0&&"group instance type is unknown. see script window for more details.");
}
}
示例13: clientMessageHandle
void clientMessageHandle(int client_sock,string message){
vector<string> choppedString;
stringChopper(message,choppedString);
if (choppedString[0].compare("LIN") == 0){
userLogin(client_sock,choppedString);
}
else if (choppedString[0].compare("LOU") == 0){
userLogout(client_sock,choppedString);
}
else if (choppedString[0].compare("REG") == 0){
userRegister(client_sock,choppedString);
}
else if (choppedString[0].compare("MSG") == 0){
sendMessage(client_sock,choppedString);
}
else if (choppedString[0].compare("CGR") == 0){
createGroup(client_sock,choppedString);
}
else if (choppedString[0].compare("JGR") == 0){
joinGroup(client_sock,choppedString);
}
else if (choppedString[0].compare("LGR") == 0){
leaveGroup(client_sock,choppedString);
}
else{
errorReply(client_sock,"000","Protocol error!");
}
}
示例14: dlg
void KeepassGroupView::OnNewSubgroup(){
GroupViewItem* parent=(GroupViewItem*)currentItem();
CGroup NewGroup;
CEditGroupDialog dlg(db,&NewGroup,parentWidget());
if(dlg.exec())
createGroup(NewGroup.Title, NewGroup.Image, parent);
}
示例15: Qt_dispatch_group1
extern "C" void Qt_dispatch_group1() {
bool res;
QDispatchGroup* group;
char* argv = QString("test").toAscii().data();
int argc = 1;
QDispatchCoreApplication app(argc,&argv);
MU_BEGIN_TEST(Qt_dispatch_group1);
group = createGroup(100, 0);
MU_ASSERT_NOT_NULL(group);
group->wait();
// should be OK to re-use a group
group->async(new Foo, QDispatch::globalQueue());
group->wait();
delete group;
group = NULL;
group = createGroup(3, 7);
MU_ASSERT_NOT_NULL(group);
res = group->wait(dispatch_time(QDispatch::TimeNow, 5ull * NSEC_PER_SEC));
MU_ASSERT_EQUAL(res, false);
// retry after timeout (this time succeed)
res = group->wait(dispatch_time(QDispatch::TimeNow, 5ull * NSEC_PER_SEC));
MU_ASSERT_EQUAL(res, true);
delete group;
group = NULL;
group = createGroup(100, 0);
MU_ASSERT_NOT_NULL(group);
group->notify(new GroupNotify, QDispatch::mainQueue());
delete group;
group = NULL;
app.exec();
MU_FAIL("Should never reach this");
MU_END_TEST
}