本文整理汇总了C++中SmilePopup::move方法的典型用法代码示例。如果您正苦于以下问题:C++ SmilePopup::move方法的具体用法?C++ SmilePopup::move怎么用?C++ SmilePopup::move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmilePopup
的用法示例。
在下文中一共展示了SmilePopup::move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processEvent
//.........这里部分代码省略.........
cmd->flags |= COMMAND_DISABLED;
return true;
case CmdPaste:
if (m_edit->isReadOnly())
return false;
if (QApplication::clipboard()->text().isEmpty())
cmd->flags |= COMMAND_DISABLED;
return true;
case CmdClear:
if (m_edit->isReadOnly())
return false;
case CmdSelectAll:
if (m_edit->toPlainText().isEmpty())
cmd->flags |= COMMAND_DISABLED;
return true;
}
break;
}
case eEventCommandExec: {
EventCommandExec *ece = static_cast<EventCommandExec*>(e);
CommandDef *cmd = ece->cmd();
#if defined(USE_KDE)
#if KDE_IS_VERSION(3,2,0)
if (cmd->id == CmdEnableSpell){
m_edit->setCheckSpellingEnabled(cmd->flags & COMMAND_CHECKED);
return false;
}
else if ((cmd->id == CmdSpell) && (cmd->param == this)){
m_edit->checkSpelling();
return true;
}
else
#endif
#endif
if ((cmd->id == CmdSmile) && (cmd->param == this)){
EventCommandWidget eWidget(cmd);
eWidget.process();
QToolButton *btnSmile = qobject_cast<QToolButton*>(eWidget.widget());
if (btnSmile){
SmilePopup *popup = new SmilePopup(this);
connect(popup, SIGNAL(insert(const QString &)), this, SLOT(insertSmile(const QString &)));
QPoint p = CToolButton::popupPos(btnSmile, popup);
popup->move(p);
popup->show();
}
return true;
}
else if ((cmd->id == CmdTranslit) && (cmd->param == this)){
Contact *contact = getContacts()->contact(m_userWnd->id());
if (contact){
SIM::PropertyHubPtr data = contact->getUserData("translit", true);
data->setValue("Translit", ((cmd->flags & COMMAND_CHECKED) != 0));
}
return true;
}
else if ((cmd->id == CmdMultiply) && (cmd->param == this)){
m_userWnd->showListView((cmd->flags & COMMAND_CHECKED) != 0);
return true;
}
else if ((cmd->bar_id == ToolBarMsgEdit) && m_edit->isReadOnly() && (cmd->param == this)){
switch (cmd->id){
case CmdMsgAnswer:{
Message *msg = new Message(MessageGeneric);
msg->setContact(m_userWnd->id());
msg->setClient(m_client);
EventOpenMessage(msg).process();
delete msg;
}
case CmdNextMessage:
QTimer::singleShot(0, this, SLOT(goNext()));
break;
}
}
else if ((cmd->menu_id != MenuTextEdit) || (cmd->param != this))
return false;
switch (cmd->id){
case CmdUndo:
m_edit->undo();
return true;
case CmdRedo:
m_edit->redo();
return true;
case CmdCut:
m_edit->cut();
return true;
case CmdCopy:
m_edit->copy();
return true;
case CmdPaste:
m_edit->paste();
return true;
case CmdClear:
m_edit->clear();
return true;
case CmdSelectAll:
m_edit->selectAll();
return true;
}
break;
}
示例2: eBtn
void *MsgEdit::processEvent(Event *e)
{
if (e->type() == EventMessageReceived){
Message *msg = (Message*)(e->param());
if ((msg->contact() == m_userWnd->id()) && (msg->type() != MessageStatus)){
if (CorePlugin::m_plugin->getContainerMode()){
bool bSetFocus = false;
if (topLevelWidget() && topLevelWidget()->inherits("Container")){
Container *container = static_cast<Container*>(topLevelWidget());
if (container->wnd() == m_userWnd)
bSetFocus = true;
}
setMessage(msg, bSetFocus);
}else{
if (m_edit->isReadOnly())
QTimer::singleShot(0, this, SLOT(setupNext()));
}
}
}
if (e->type() == EventRealSendMessage){
MsgSend *s = (MsgSend*)(e->param());
if (s->edit == this){
sendMessage(s->msg);
return e->param();
}
}
if (e->type() == EventCheckState){
CommandDef *cmd = (CommandDef*)(e->param());
if ((cmd->param == this) && (cmd->id == CmdTranslit)){
Contact *contact = getContacts()->contact(m_userWnd->id());
if (contact){
TranslitUserData *data = (TranslitUserData*)(contact->getUserData(CorePlugin::m_plugin->translit_data_id));
if (data){
cmd->flags &= ~COMMAND_CHECKED;
if (data->Translit)
cmd->flags |= COMMAND_CHECKED;
}
}
return NULL;
}
if ((cmd->menu_id != MenuTextEdit) || (cmd->param != this))
return NULL;
cmd->flags &= ~(COMMAND_CHECKED | COMMAND_DISABLED);
switch (cmd->id){
case CmdUndo:
if (m_edit->isReadOnly())
return NULL;
if (!m_edit->isUndoAvailable())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdRedo:
if (m_edit->isReadOnly())
return NULL;
if (!m_edit->isRedoAvailable())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdCut:
if (m_edit->isReadOnly())
return NULL;
case CmdCopy:
if (!m_edit->hasSelectedText())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdPaste:
if (m_edit->isReadOnly())
return NULL;
if (QApplication::clipboard()->text().isEmpty())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdClear:
if (m_edit->isReadOnly())
return NULL;
case CmdSelectAll:
if (m_edit->text().isEmpty())
cmd->flags |= COMMAND_DISABLED;
return e->param();
}
return NULL;
}
if (e->type() == EventCommandExec){
CommandDef *cmd = (CommandDef*)(e->param());
if ((cmd->id == CmdSmile) && (cmd->param == this)){
Event eBtn(EventCommandWidget, cmd);
QToolButton *btnSmile = (QToolButton*)(eBtn.process());
if (btnSmile){
SmilePopup *popup = new SmilePopup(this);
QSize s = popup->minimumSizeHint();
popup->resize(s);
connect(popup, SIGNAL(insert(int)), this, SLOT(insertSmile(int)));
QPoint p = CToolButton::popupPos(btnSmile, popup);
popup->move(p);
popup->show();
}
return e->param();
}
示例3: e
//.........这里部分代码省略.........
delete msg;
break;
}
return NULL;
}
if (e->type() == EventMessageReceived){
Message *msg = (Message*)(e->param());
if (msg->getFlags() & MESSAGE_NOVIEW)
return NULL;
if ((msg->contact() == m_userWnd->id()) && (msg->type() != MessageStatus)){
if (CorePlugin::m_plugin->getContainerMode()){
bool bSetFocus = false;
if (topLevelWidget() && topLevelWidget()->inherits("Container")){
Container *container = static_cast<Container*>(topLevelWidget());
if (container->wnd() == m_userWnd)
bSetFocus = true;
}
setMessage(msg, bSetFocus);
}else{
if (m_edit->isReadOnly())
QTimer::singleShot(0, this, SLOT(setupNext()));
}
}
}
if (e->type() == EventRealSendMessage){
MsgSend *s = (MsgSend*)(e->param());
if (s->edit == this){
sendMessage(s->msg);
return e->param();
}
}
if (e->type() == EventCheckState){
CommandDef *cmd = (CommandDef*)(e->param());
if ((cmd->param == this) && (cmd->id == CmdTranslit)){
Contact *contact = getContacts()->contact(m_userWnd->id());
if (contact){
TranslitUserData *data = (TranslitUserData*)(contact->getUserData(CorePlugin::m_plugin->translit_data_id));
if (data){
cmd->flags &= ~COMMAND_CHECKED;
if (data->Translit)
cmd->flags |= COMMAND_CHECKED;
}
}
return NULL;
}
if ((cmd->menu_id != MenuTextEdit) || (cmd->param != this))
return NULL;
cmd->flags &= ~(COMMAND_CHECKED | COMMAND_DISABLED);
switch (cmd->id){
case CmdUndo:
if (m_edit->isReadOnly())
return NULL;
if (!m_edit->isUndoAvailable())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdRedo:
if (m_edit->isReadOnly())
return NULL;
if (!m_edit->isRedoAvailable())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdCut:
if (m_edit->isReadOnly())
return NULL;
case CmdCopy:
if (!m_edit->hasSelectedText())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdPaste:
if (m_edit->isReadOnly())
return NULL;
if (QApplication::clipboard()->text().isEmpty())
cmd->flags |= COMMAND_DISABLED;
return e->param();
case CmdClear:
if (m_edit->isReadOnly())
return NULL;
case CmdSelectAll:
if (m_edit->text().isEmpty())
cmd->flags |= COMMAND_DISABLED;
return e->param();
}
return NULL;
}
if (e->type() == EventCommandExec){
CommandDef *cmd = (CommandDef*)(e->param());
if ((cmd->id == CmdSmile) && (cmd->param == this)){
Event eBtn(EventCommandWidget, cmd);
QToolButton *btnSmile = (QToolButton*)(eBtn.process());
if (btnSmile){
SmilePopup *popup = new SmilePopup(this);
QSize s = popup->minimumSizeHint();
popup->resize(s);
connect(popup, SIGNAL(insert(int)), this, SLOT(insertSmile(int)));
QPoint p = CToolButton::popupPos(btnSmile, popup);
popup->move(p);
popup->show();
}
return e->param();
}