代码拉取完成,页面将自动刷新
同步操作将从 Acreate/gamePlanTool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "CommShowMsgItem.h"
#include <qstyle.h>
#include <QHBoxLayout>
#include <QDir>
#include <QEvent>
#include <qmenu.h>
#include <QMouseEvent>
#include <QPoint>
#include <QAction>
#include <qdebug.h>
#include <qtextbrowser.h>
#include "IMsgStream.h"
#include <QApplication>
#include <QClipboard>
void CommShowMsgItem::setBorwseStatus(QTextBrowser* pTextBrowser) {
pTextBrowser->setLineWrapMode(QTextEdit::WidgetWidth);
pTextBrowser->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
pTextBrowser->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
void CommShowMsgItem::setLabelStatus(QLabel* label) {
label->setWordWrap(true);
label->setIndent(8);
label->setTextInteractionFlags(label->textInteractionFlags( ) | Qt::TextSelectableByMouse);
}
CommShowMsgItem::CommShowMsgItem(msgType pmsgBodyType, QString& puserName, QString& pmsg, QString& pimagePath, QWidget* pparent) : QWidget(pparent) {
// ui.setupUi(this);
this->msgBodyType = pmsgBodyType;
this->userName = puserName;
this->msg = pmsg;
this->imagePath = pimagePath;
luserMsg = new QLabel(this);
luserName = new QLabel(this);
QFont font;
font.setPointSize(32);
luserName->setFont(font);
//设置颜色
QPalette pa;
pa.setColor(QPalette::WindowText, Qt::red);
luserName->setPalette(pa);
luserName->setText(puserName);
userImage = new QLabel(this);
setLabelStatus(luserMsg);
QSize picSize(128, 128);
QPixmap pixmap = QPixmap(pimagePath).scaled(picSize, Qt::KeepAspectRatio);
userImage->setPixmap(pixmap);
luserMsg->setText(pmsg);
mainLayout = new QVBoxLayout( );
setLayout(mainLayout);
QHBoxLayout* userInfo = new QHBoxLayout( );
hSpacar = new QSpacerItem(40, 20, QSizePolicy::Expanding);
if( pmsgBodyType == msgType::ACCEPT ) {
userInfo->addWidget(userImage);
userInfo->addWidget(luserName);
userInfo->addSpacerItem(hSpacar);
} else if( pmsgBodyType == msgType::SENDER ) {
userInfo->addSpacerItem(hSpacar);
userInfo->addWidget(luserName);
userInfo->addWidget(userImage);
}
mainLayout->addLayout(userInfo);
mainLayout->addWidget(luserMsg);
// 设置对象名称
setObjectName(itemName::CommShowMsgItemObjName::getItemObjName( ));
luserMsg->setObjectName(itemName::CommShowMsgItemObjName::getMsgLabelObjName( ));
luserName->setObjectName(itemName::CommShowMsgItemObjName::getUserNameObjName( ));
userImage->setObjectName(itemName::CommShowMsgItemObjName::getUserImageObjName( ));
}
CommShowMsgItem::~CommShowMsgItem( ) {}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。