Validate Pastebin URL with regex

This commit is contained in:
Lenny McLennington
2022-01-26 00:31:08 +00:00
parent af20b5ee0e
commit 0eff21a4f1
2 changed files with 19 additions and 2 deletions

View File

@ -30,7 +30,9 @@ PastePage::PastePage(QWidget *parent) :
QWidget(parent),
ui(new Ui::PastePage)
{
static QRegularExpression validUrlRegExp("https?://.+");
ui->setupUi(this);
ui->urlChoices->setValidator(new QRegularExpressionValidator(validUrlRegExp, ui->urlChoices));
ui->tabWidget->tabBar()->hide();\
loadSettings();
}