From 132f87c05e89e21824efa2c4dfef83d807e0f5bf Mon Sep 17 00:00:00 2001 From: Polshakov Dmitry Date: Tue, 12 Apr 2016 12:27:21 +0300 Subject: [PATCH] fix(profileform): Add toxme username limitation --- src/widget/form/profileform.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widget/form/profileform.cpp b/src/widget/form/profileform.cpp index 84c71ef2d..a76d43c34 100644 --- a/src/widget/form/profileform.cpp +++ b/src/widget/form/profileform.cpp @@ -92,6 +92,10 @@ ProfileForm::ProfileForm(QWidget *parent) : bodyUI->qrLabel->setWordWrap(true); + QRegExp re("[^@ ]+"); + QRegExpValidator* validator = new QRegExpValidator(re); + bodyUI->toxmeUsername->setValidator(validator); + profilePicture = new MaskablePixmapWidget(this, QSize(64, 64), ":/img/avatar_mask.svg"); profilePicture->setPixmap(QPixmap(":/img/contact_dark.svg")); profilePicture->setContextMenuPolicy(Qt::CustomContextMenu);