PDA

View Full Version : How to use qwebkitplatformplugin?



brcontainer
13th July 2013, 15:45
how to use qwebkitplatformplugin in a QWebView?

I have the following code:


#include <QWebKitPlatformPlugin>

MainWindow::MainWindow(QWidget *parent, bool new) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);

webView = new QWebView;
ui->webViewLay->addWidget(webView);
webView->setHtml("<p>test</p>");
}

but found no example of how to use extensions.

ChrisW67
14th July 2013, 05:39
What are you trying to achieve?

brcontainer
15th July 2013, 01:53
I want to use the class QWebSpellChecker which is inside QWebKitPlatformPlugin, can you help me?

Class:

class QWebKitPlatformPlugin {
public:
virtual ~QWebKitPlatformPlugin() {}

enum Extension {
MultipleSelections,
Notifications,
Haptics,
TouchInteraction,
FullScreenVideoPlayer,
SpellChecker
};

virtual bool supportsExtension(Extension) const = 0;
virtual QObject* createExtension(Extension) const = 0;
};

brcontainer
18th July 2013, 02:23
could anyone give a help?

raven-worx
19th August 2013, 11:53
see this (https://github.com/QupZilla/qtwebkit-plugins/)for a reference implementation.

brcontainer
19th August 2013, 21:49
Thanks @raven-worx

Sounds good, but I have a difficulty when compiling in windows, could you help me?

I am newbie to QT, What folder should I put hunspell (Windows)?

I tried adding the main folder of the project, tried to add the folder "src", but both cause the following error:

error: cannot find -lhunspell

I tried doing this:

LIBS += -LC:/Users/cr/Desktop/QT/qtwebkit-plugins-master/src/hunspell

but this error occurs:

C:\Users\cr\Desktop\QT\qtwebkit-plugins-master\src\spellcheck\speller.cpp:57: error: undefined reference to Hunspell::Hunspell(char const*, char const*, char const*)'


see all errors that occur in the following image:

9431

Note: Usin hunspell-1.3.2