
Originally Posted by
wysota
Thanks for you patience wysota much appreciated.
I have been having some issues where the functions don't show even though I have the correct headers. ( Think)
Anyways I finally got the functions to show as they should think it was that I had forgot to run QMake.
But now my application crashes for some reason am I not using it correctly?
webTest1.pro:
#-------------------------------------------------
#
# Project created by QtCreator 2013-10-11T10:09:41
#
#-------------------------------------------------
QT += core gui
QT += webkit
QT += network
QT += webkit webkitwidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = webTest1
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
#-------------------------------------------------
#
# Project created by QtCreator 2013-10-11T10:09:41
#
#-------------------------------------------------
QT += core gui
QT += webkit
QT += network
QT += webkit webkitwidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = webTest1
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
To copy to clipboard, switch view to plain text mode
mainwindow.h:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtWebKit/QWebElement>
#include <QtWebKit>
#include <QtWebKitWidgets>
namespace Ui {
class MainWindow;
}
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
~MainWindow();
QWebPage *myPage;
QWebFrame *myFrame;
QWebElement *myElement;
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtWebKit/QWebElement>
#include <QtWebKit>
#include <QtWebKitWidgets>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QWebPage *myPage;
QWebFrame *myFrame;
QWebElement *myElement;
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
mainwindow.cpp:
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
myPage
->mainFrame
()->load
( QUrl("http://google.com") );
}
MainWindow::~MainWindow()
{
delete ui;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
myPage->mainFrame()->load( QUrl("http://google.com") );
}
MainWindow::~MainWindow()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
I also tryed:
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
myFrame
->load
(QUrl("http://google.com"));
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
myFrame->load(QUrl("http://google.com"));
}
To copy to clipboard, switch view to plain text mode
Bookmarks