1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

qlabels will not support richtext, plaintext only

removes support for HTML, QML, JS and CSS in username/status labels

this commit closes #1298(bug) #1295(bug) and #1224(feature request)
This commit is contained in:
agilob 2015-02-27 14:05:03 +00:00
parent 337bf0cd2b
commit 7a6b8ab256
5 changed files with 17 additions and 4 deletions

View File

@ -57,7 +57,8 @@ ChatForm::ChatForm(Friend* chatFriend)
statusMessageLabel->setObjectName("statusLabel");
statusMessageLabel->setFont(Style::getFont(Style::Medium));
statusMessageLabel->setMinimumHeight(Style::getFont(Style::Medium).pixelSize());
statusMessageLabel->setTextFormat(Qt::PlainText);
callConfirm = nullptr;
offlineEngine = new OfflineMsgEngine(f);

View File

@ -49,10 +49,11 @@ GenericChatForm::GenericChatForm(QWidget *parent)
nameLabel->setObjectName("nameLabel");
nameLabel->setMinimumHeight(Style::getFont(Style::Medium).pixelSize());
nameLabel->setEditable(true);
nameLabel->setTextFormat(Qt::PlainText);
avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png");
QHBoxLayout *headLayout = new QHBoxLayout(),
*mainFootLayout = new QHBoxLayout();
*mainFootLayout = new QHBoxLayout();
QVBoxLayout *mainLayout = new QVBoxLayout(),
*footButtonsSmall = new QVBoxLayout(),

View File

@ -63,9 +63,15 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
namesListLayout = new FlowLayout(0,5,0);
QStringList names(group->getPeerList());
QLabel *l;
for (const QString& name : names)
namesListLayout->addWidget(new QLabel(name));
{
l = new QLabel(name);
l->setTextFormat(Qt::PlainText);
namesListLayout->addWidget(l);
}
headTextLayout->addWidget(nusersLabel);
headTextLayout->addLayout(namesListLayout);
headTextLayout->addStretch();
@ -124,6 +130,7 @@ void GroupChatForm::onUserListChanged()
nameStr+=", ";
QLabel* nameLabel = new QLabel(nameStr);
nameLabel->setObjectName("peersLabel");
nameLabel->setTextFormat(Qt::PlainText);
namesListLayout->addWidget(nameLabel);
}
}

View File

@ -45,6 +45,8 @@ FriendWidget::FriendWidget(int FriendId, QString id)
avatar->setPixmap(QPixmap(":img/contact.png"), Qt::transparent);
statusPic.setPixmap(QPixmap(":img/status/dot_away.png"));
nameLabel->setText(id);
nameLabel->setTextFormat(Qt::PlainText);
statusMessageLabel->setTextFormat(Qt::PlainText);
}
void FriendWidget::contextMenuEvent(QContextMenuEvent * event)

View File

@ -44,6 +44,8 @@ GenericChatroomWidget::GenericChatroomWidget(QWidget *parent)
// name text
nameLabel = new CroppingLabel(this);
nameLabel->setObjectName("name");
nameLabel->setTextFormat(Qt::PlainText);
statusMessageLabel->setTextFormat(Qt::PlainText);
onCompactChanged(property("compact").toBool());