|
|
|
@ -11,55 +11,60 @@ |
|
|
|
|
#include <qbrowserlib/webview.hxx> |
|
|
|
|
#include <QtDesigner> |
|
|
|
|
|
|
|
|
|
#define LOG qDebug()<<__PRETTY_FUNCTION__ |
|
|
|
|
|
|
|
|
|
//! WebView widget for Qt Designer
|
|
|
|
|
class WebViewWidgetIfc: public QObject, public QDesignerCustomWidgetInterface { |
|
|
|
|
Q_OBJECT; |
|
|
|
|
Q_INTERFACES(QDesignerCustomWidgetInterface); |
|
|
|
|
public: |
|
|
|
|
bool isContainer() const { |
|
|
|
|
LOG; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
bool isInitialized() const { |
|
|
|
|
return _initialized; |
|
|
|
|
} |
|
|
|
|
QIcon icon() const { |
|
|
|
|
return QIcon(QPixmap("qrc:/icons/webview.png")); |
|
|
|
|
LOG; |
|
|
|
|
return QIcon(":/icons/webview.png"); |
|
|
|
|
} |
|
|
|
|
QString domXml() const { |
|
|
|
|
LOG; |
|
|
|
|
return |
|
|
|
|
" <property name=\"geometry\">\n" |
|
|
|
|
" <rect>\n" |
|
|
|
|
" <x>0</x>\n" |
|
|
|
|
" <y>0</y>\n" |
|
|
|
|
" <width>100</width>\n" |
|
|
|
|
" <height>100</height>\n" |
|
|
|
|
" </rect>\n" |
|
|
|
|
" </property>\n"; |
|
|
|
|
QString |
|
|
|
|
("<ui language=\"c++\" displayname=\"%1\">" |
|
|
|
|
" <widget class=\"%1\" name=\"%2\"/>" |
|
|
|
|
" <customwidgets>" |
|
|
|
|
" <customwidget>" |
|
|
|
|
" <class>%1</class>" |
|
|
|
|
" </customwidget>" |
|
|
|
|
" </customwidgets>" |
|
|
|
|
"</ui>") |
|
|
|
|
.arg(name()) |
|
|
|
|
.arg(name().toLower()); |
|
|
|
|
} |
|
|
|
|
QString group() const { |
|
|
|
|
return "DisplayWidgets"; |
|
|
|
|
LOG; |
|
|
|
|
return "Display Widgets [Examples]"; |
|
|
|
|
} |
|
|
|
|
QString includeFile() const { |
|
|
|
|
LOG; |
|
|
|
|
return "qbrowserlib/webview.hxx"; |
|
|
|
|
} |
|
|
|
|
QString name() const { |
|
|
|
|
return "SwissWebView"; |
|
|
|
|
LOG; |
|
|
|
|
return "WebView"; |
|
|
|
|
} |
|
|
|
|
QString toolTip() const { |
|
|
|
|
return "SwissWebView"; |
|
|
|
|
LOG; |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
QString whatsThis() const { |
|
|
|
|
return "SwissWebView"; |
|
|
|
|
LOG; |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
QWidget *createWidget(QWidget *parent) { |
|
|
|
|
LOG; |
|
|
|
|
return new WebView(parent); |
|
|
|
|
} |
|
|
|
|
void initialize(QDesignerFormEditorInterface *core) { |
|
|
|
|
_initialized = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
bool _initialized; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|