代码拉取完成,页面将自动刷新
同步操作将从 Acreate/gamePlanTool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "MsgPage.h"
#include <QDir>
#include <qapplication.h>
#include <qstyle.h>
#include <QIcon>
#include <qdebug.h>
#include <QArrayData>
using namespace widgetUI;
using namespace msg;
QString MsgPage::JoinChars(QString chars) {
static QString appChars = "\n";
QString oldChars = appChars;
if( chars.isEmpty( ) )
return appChars;
appChars = chars;
return oldChars;
}
QString MsgPage::getName( ) {
static QString objName = "消息";
return objName;
}
QIcon MsgPage::getIcon( ) {
static QIcon icon = QApplication::style( )->standardIcon(( QStyle::StandardPixmap )30);
return icon;
}
/*
MsgPage* MsgPage::getInstance( ) {
static MsgPage instance;
return &instance;
}
*/
bool MsgPage::objIsValid( ) {
return objValidStatus( );
}
IMsgStream* MsgPage::getMsgStreamInstance( ) {
return this;
}
IMsgStream* MsgPage::getMsgAppTxtInstance( ) {
return this;
}
void MsgPage::activation(QObject* obj, int index, EVENTFLAG status) {
qDebug( ) << getName( );
}
MsgPage::MsgPage(QWidget* parent) : ATabPageBase(parent) {
ui.setupUi(this);
bool visible = true;
ui.msg->setReadOnly(visible);
setObjectName(getName( ));
objValidStatus(&visible);
}
MsgPage::~MsgPage( ) {
}
IMsgStream& MsgPage::operator<<(const QString& msgTest) {
const QString text = ui.msg->toPlainText( ) + msgTest + JoinChars( );
ui.msg->setText(text);
return *this;
}
IMsgStream& MsgPage::operator<<(const QList<QString>& msgTest) {
QString text = ui.msg->toPlainText( );
for( auto& str : msgTest )
text += str + JoinChars( );
ui.msg->setText(text);
return *this;
}
IMsgStream& MsgPage::operator<<(const QStringList& msgTest) {
QString text = ui.msg->toPlainText( );
ui.msg->setText(text + msgTest.join(JoinChars( )));
return *this;
}
bool MsgPage::objValidStatus(bool* status) {
static bool isValid = false;
if( status == Q_NULLPTR )
return isValid;
isValid = *status;
return isValid;
}
void MsgPage::appendMsg(const QString& msg, const QString& appChars) {
QString oldChars = JoinChars(appChars);
*this << msg;
JoinChars(oldChars);
}
void MsgPage::appendMsg(const QStringList& msg, const QString& appChars) {
QString oldChars = JoinChars(appChars);
*this << msg;
JoinChars(oldChars);
}
void MsgPage::appendMsg(const QList<QString>& msg, const QString& appChars) {
QString oldChars = JoinChars(appChars);
*this << msg;
JoinChars(oldChars);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。