Hello
How would I go to open a website (with a browser) in C++?
Linux-only and without system-functions?
Already tried a few things but none worked, thanks a lot.
Thanks for reading,
Niely
^Thanks a lot! :)
I'm using Qt, but it ain't working.
Could you give an example of how to use it + which headers to include?
can you show me your code?
i made a quick app and it works for me.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDesktopServices>
#include <QUrl>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
QDesktopServices::openUrl(QUrl("http://www.nokia.com"));
}
|
Last edited on
^It only doesn't file this header:
#include <QDesktopServices>