本文整理汇总了C++中QMessage::cc方法的典型用法代码示例。如果您正苦于以下问题:C++ QMessage::cc方法的具体用法?C++ QMessage::cc怎么用?C++ QMessage::cc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMessage
的用法示例。
在下文中一共展示了QMessage::cc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compose
bool QMFService::compose(const QMessage &message)
{
if (isBusy()) {
return false;
}
m_active = 0;
setError(QMessageManager::NoError);
QStringList arguments;
if (message.subject().size())
arguments << "--subject" << message.subject();
if (message.textContent().size())
arguments << "--body" << message.textContent();
if (message.cc().size())
arguments << "--cc" << MessagingHelper::addressListToString(message.cc());
if (message.bcc().size())
arguments << "--bcc" << MessagingHelper::addressListToString(message.bcc());
if (message.to().size())
arguments << MessagingHelper::addressListToString(message.to());
//qDebug() << __PRETTY_FUNCTION__ << " starting:" << XDG_PROG << arguments;
if (QProcess::execute(XDG_PROG, arguments) != 0) {
qWarning() << __PRETTY_FUNCTION__ << "Cannot start email composer: " << XDG_PROG << arguments;
setError(QMessageManager::FrameworkFault);
return false;
}
//qDebug() << __PRETTY_FUNCTION__ << "execution completed";
return true;
}
示例2: filter
//.........这里部分代码省略.........
case QMessageFilterPrivate::Sender:
{
if (filter._comparatorType == QMessageFilterPrivate::Equality) {
QMessageDataComparator::EqualityComparator cmp(static_cast<QMessageDataComparator::EqualityComparator>(filter._comparatorValue));
if (cmp == QMessageDataComparator::Equal) {
if (filter._value.toString().length() > 0) {
if (message.from().addressee().compare(filter._value.toString(),caseSensitivity) == 0) {
return true;
}
}
} else { // NotEqual
if (filter._value.toString().length() > 0) {
if (message.from().addressee().compare(filter._value.toString(),caseSensitivity) != 0) {
return true;
}
} else {
return true;
}
}
} else if (filter._comparatorType == QMessageFilterPrivate::Inclusion) {
QMessageDataComparator::InclusionComparator cmp(static_cast<QMessageDataComparator::InclusionComparator>(filter._comparatorValue));
if (cmp == QMessageDataComparator::Includes) {
if (message.from().addressee().contains(filter._value.toString(),caseSensitivity)) {
return true;
}
} else { // Excludes
if (!message.from().addressee().contains(filter._value.toString(),caseSensitivity)) {
return true;
}
}
}
break;
}
case QMessageFilterPrivate::Recipients: // to, cc & bcc fields
{
if (filter._comparatorType == QMessageFilterPrivate::Inclusion) {
QMessageDataComparator::InclusionComparator cmp(static_cast<QMessageDataComparator::InclusionComparator>(filter._comparatorValue));
bool includes = false;
// Check to addresses
QMessageAddressList addrList = message.to();
for (int i=0; i < addrList.count(); i++) {
if (addrList[i].addressee().contains(filter._value.toString(),caseSensitivity)) {
includes = true;
break;
}
}
if (!includes) {
// Check cc addresses
addrList = message.cc();
for (int i=0; i < addrList.count(); i++) {
if (addrList[i].addressee().contains(filter._value.toString(),caseSensitivity)) {
includes = true;
break;
}
}
}
if (!includes) {
// Check bcc addresses
addrList = message.bcc();
for (int i=0; i < addrList.count(); i++) {
if (addrList[i].addressee().contains(filter._value.toString(),caseSensitivity)) {
includes = true;
break;
}
}
}