QLineEdit
has a text()
function that will return a QString
. So you can do something like this:
QString site = ui->site->text();
You don't have to use QProcess
to open a web site in a browser. You can use QDesktopServices::openUrl
static function.
Like this:
QString site = ui->site->text();
QUrl url(site);
QDesktopServices::openUrl(url);
Remember to include QDesktopServices
and QUrl
headers:
#include <QDesktopServices>
#include <QUrl>