void PMWindow::slotSmile(){ if (!(WBGET(WB_APP_ENABLE_EMOTICON) && EmoticonFactory::getInstance())) return; int x, y; EmoticonDialog *dialog = new EmoticonDialog(this); QPixmap p = QPixmap::fromImage(EmoticonFactory::getInstance()->getImage()); dialog->SetPixmap(p); if (dialog->exec() == QDialog::Accepted) { dialog->GetXY(x, y); QString smiley = EmoticonFactory::getInstance()->textForPos(x, y); if (!smiley.isEmpty()) { smiley.replace("<", "<"); smiley.replace(">", ">"); smiley.replace("&", "&"); smiley.replace("'", "\'"); smiley.replace(""", "\""); smiley += " "; plainTextEdit_INPUT->textCursor().insertText(smiley); plainTextEdit_INPUT->setFocus(); } } delete dialog; }
void PMWindow::slotSmile(){ if (!(WBGET(WB_APP_ENABLE_EMOTICON) && EmoticonFactory::getInstance())) return; if (WBGET(WB_CHAT_USE_SMILE_PANEL)){ frame_SMILES->setVisible(!frame_SMILES->isVisible()); } else { EmoticonDialog *dialog = new EmoticonDialog(this); if (dialog->exec() == QDialog::Accepted) { QString smiley = dialog->getEmoticonText(); if (!smiley.isEmpty()) { smiley.replace("<", "<"); smiley.replace(">", ">"); smiley.replace("&", "&"); smiley.replace("'", "\'"); smiley.replace(""", "\""); smiley += " "; plainTextEdit_INPUT->textCursor().insertText(smiley); plainTextEdit_INPUT->setFocus(); } } delete dialog; } }