本文整理汇总了C++中Viewer::getDebugReadable方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::getDebugReadable方法的具体用法?C++ Viewer::getDebugReadable怎么用?C++ Viewer::getDebugReadable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer
的用法示例。
在下文中一共展示了Viewer::getDebugReadable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onChat
void CBDS::onChat(const QString &message)
{
Viewer *v = qobject_cast<Viewer *>(sender());
if (v)
{
if (message == "/debug")
{
v->setDebugReadable(!v->getDebugReadable());
m_chat.addLine(new ChatLine(v->getDebugReadable() ? "Debug mode enabled. Type /debug again to disable." : "Debug mode disabled.", Q_NULLPTR, "#000000", "#FFFFFF", 0, v->getName()));
return;
}
QScriptValue e = createViewerValue(v);
e.setProperty("c", v->getTextcolor());
e.setProperty("m", message);
e.setProperty("f", v->getFont());
if (m_cbo->callMessageFunction(e) && !e.property("X-Spam").toBool())
{
//There is an example for changing the background in the API docs. I'd prefer proper documentation.
QString background = "#FFFFFF";
if (e.property("background").isValid())
{
background = e.property("background").toString().toUpper();
if (!QRegExp("#([0-9A-F|]{3}|[0-9A-F]{6})").exactMatch(background))
{
emit m_cbo->warning("CSS message background hacks aren't supported since there is no browser support guarantee. If you feel i should add support let me know. IMHO CB should make stuff like this a viable option here and for notices and ensure browser support.");
background = "#FFFFFF";
}
}
m_chat.addLine(new ChatLine(e.property("m").toString(), v, e.property("c").toString(), background));
}
}
}