|
|
|
/*! @file
|
|
|
|
|
|
|
|
@id $Id$
|
|
|
|
*/
|
|
|
|
// 1 2 3 4 5 6 7 8
|
|
|
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
|
|
|
|
|
|
|
#ifndef __WEBVIEWWIDGETIFC_HXX
|
|
|
|
#define __WEBVIEWWIDGETIFC_HXX
|
|
|
|
|
|
|
|
#include <qbrowserlib/log.hxx>
|
|
|
|
#include <qbrowserlib/swisswebview.hxx>
|
|
|
|
#include <QDesignerExportWidget>
|
|
|
|
#include <QtDesigner>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#undef TRC
|
|
|
|
#define TRC std::cout<<"********>>> "<<__FILE__<<" - "<<__PRETTY_FUNCTION__<<std::endl;
|
|
|
|
|
|
|
|
//! @defgroup designer
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
//! WebView widget for Qt Designer
|
|
|
|
class SwissWebViewWidgetIfc: public QObject, public QDesignerCustomWidgetInterface {
|
|
|
|
Q_OBJECT
|
|
|
|
#if QT_VERSION >= 0x050000
|
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "webviewwidgetifc.json");
|
|
|
|
#endif
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface);
|
|
|
|
public:
|
|
|
|
SwissWebViewWidgetIfc(QObject *parent=0): QObject(parent), _initialized(false) {}
|
|
|
|
bool isContainer() const {
|
|
|
|
TRC;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
QIcon icon() const {
|
|
|
|
TRC;
|
|
|
|
return QIcon(":/icons/swisswebview.png");
|
|
|
|
}
|
|
|
|
QString domXml() const {
|
|
|
|
TRC;
|
|
|
|
return
|
|
|
|
QString
|
|
|
|
("<ui language=\"c++\" displayname=\"%2\">"
|
|
|
|
" <widget class=\"%1\" name=\"%3\"/>"
|
|
|
|
" <customwidgets>"
|
|
|
|
" <customwidget>"
|
|
|
|
" <class>%1</class>"
|
|
|
|
" </customwidget>"
|
|
|
|
" </customwidgets>"
|
|
|
|
"</ui>")
|
|
|
|
.arg(name())
|
|
|
|
.arg(className())
|
|
|
|
.arg(className().toLower());
|
|
|
|
}
|
|
|
|
QString group() const {
|
|
|
|
TRC;
|
|
|
|
return "Display Widgets";
|
|
|
|
}
|
|
|
|
QString includeFile() const {
|
|
|
|
TRC;
|
|
|
|
return "qbrowserlib/swisswebview.hxx";
|
|
|
|
}
|
|
|
|
QString namespaceName() const {
|
|
|
|
TRC;
|
|
|
|
return "qbrowserlib";
|
|
|
|
}
|
|
|
|
QString className() const {
|
|
|
|
TRC;
|
|
|
|
return "SwissWebView";
|
|
|
|
}
|
|
|
|
QString name() const {
|
|
|
|
TRC;
|
|
|
|
return QString("%1::%2").arg(namespaceName()).arg(className());
|
|
|
|
}
|
|
|
|
QString toolTip() const {
|
|
|
|
TRC;
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
QString whatsThis() const {
|
|
|
|
TRC;
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
QWidget *createWidget(QWidget *parent) {
|
|
|
|
TRC;
|
|
|
|
return new qbrowserlib::SwissWebView(parent, &_net);
|
|
|
|
}
|
|
|
|
bool isInitialized() {
|
|
|
|
TRC;
|
|
|
|
return _initialized;
|
|
|
|
}
|
|
|
|
void initialize(QDesignerFormEditorInterface*) {
|
|
|
|
_initialized = true;
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
QNetworkAccessManager _net;
|
|
|
|
bool _initialized;
|
|
|
|
};
|
|
|
|
|
|
|
|
//! @}
|
|
|
|
#endif
|