本文整理汇总了C++中UserCommand::setHub方法的典型用法代码示例。如果您正苦于以下问题:C++ UserCommand::setHub方法的具体用法?C++ UserCommand::setHub怎么用?C++ UserCommand::setHub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserCommand
的用法示例。
在下文中一共展示了UserCommand::setHub方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeUC
void UCModel::changeUC(const QModelIndex &i){
if (!i.isValid())
return;
UCItem *item = reinterpret_cast<UCItem*>(i.internalPointer());
if (!rootItem->childItems.contains(item))
return;
UCDialog ucd(MainWindow::getInstance());
initDlgFromItem(ucd, *item);
if (ucd.exec() == QDialog::Accepted){
UserCommand uc;
FavoriteManager::getInstance()->getUserCommand(item->id, uc);
uc.setName(_tq(ucd.getName()));
uc.setCommand(_tq(ucd.getCmd()));
uc.setHub(_tq(ucd.getHub()));
uc.setType(ucd.getType());
uc.setCtx(ucd.getCtx());
uc.setTo(_tq(ucd.lineEdit_TO->text()));
FavoriteManager::getInstance()->updateUserCommand(uc);
item->name = ((uc.getType() == dcpp::UserCommand::TYPE_SEPARATOR)? tr("Separator") : _q(uc.getName()));
item->comm = _q(uc.getCommand());
item->hub = _q(uc.getHub());
item->id = uc.getId();
item->type = uc.getType();
item->ctx = uc.getCtx();
emit layoutChanged();
}
}
示例2: onChangeMenu
LRESULT UCPage::onChangeMenu(WORD , WORD , HWND , BOOL& ) {
if(ctrlCommands.GetSelectedCount() == 1) {
int sel = ctrlCommands.GetSelectedIndex();
UserCommand uc;
FavoriteManager::getInstance()->getUserCommand(ctrlCommands.GetItemData(sel), uc);
CommandDlg dlg;
dlg.type = uc.getType();
dlg.ctx = uc.getCtx();
dlg.name = Text::toT(uc.getName());
dlg.command = Text::toT(uc.getCommand());
dlg.to = Text::toT(uc.getTo());
dlg.hub = Text::toT(uc.getHub());
if(dlg.DoModal() == IDOK) {
if(dlg.type == UserCommand::TYPE_SEPARATOR)
ctrlCommands.SetItemText(sel, 0, CTSTRING(SEPARATOR));
else
ctrlCommands.SetItemText(sel, 0, dlg.name.c_str());
ctrlCommands.SetItemText(sel, 1, dlg.command.c_str());
ctrlCommands.SetItemText(sel, 2, dlg.hub.c_str());
uc.setName(Text::fromT(dlg.name));
uc.setCommand(Text::fromT(dlg.command));
uc.setTo(Text::fromT(dlg.to));
uc.setHub(Text::fromT(dlg.hub));
uc.setType(dlg.type);
uc.setCtx(dlg.ctx);
FavoriteManager::getInstance()->updateUserCommand(uc);
}
}
return 0;
}