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);