home; refs #167
This commit is contained in:
@@ -695,7 +695,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SwissWebWidget</name>
|
||||
<message>
|
||||
<location filename="swisswebwidget.hxx" line="53"/>
|
||||
<location filename="swisswebwidget.hxx" line="69"/>
|
||||
<source>Browser Tools</source>
|
||||
<comment>name of the browser's toolbar</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -695,7 +695,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SwissWebWidget</name>
|
||||
<message>
|
||||
<location filename="swisswebwidget.hxx" line="53"/>
|
||||
<location filename="swisswebwidget.hxx" line="69"/>
|
||||
<source>Browser Tools</source>
|
||||
<comment>name of the browser's toolbar</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -695,7 +695,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SwissWebWidget</name>
|
||||
<message>
|
||||
<location filename="swisswebwidget.hxx" line="53"/>
|
||||
<location filename="swisswebwidget.hxx" line="69"/>
|
||||
<source>Browser Tools</source>
|
||||
<comment>name of the browser's toolbar</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -695,7 +695,7 @@ Specify full path to executable program</source>
|
||||
<context>
|
||||
<name>qbrowserlib::SwissWebWidget</name>
|
||||
<message>
|
||||
<location filename="swisswebwidget.hxx" line="53"/>
|
||||
<location filename="swisswebwidget.hxx" line="69"/>
|
||||
<source>Browser Tools</source>
|
||||
<comment>name of the browser's toolbar</comment>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -16,6 +16,20 @@
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
#ifndef CREATE_QT_PROPERTY
|
||||
#define CREATE_QT_PROPERTY(type, name) \
|
||||
Q_PROPERTY(type _##name READ name WRITE name USER true) \
|
||||
public: \
|
||||
void name(const type& v) { \
|
||||
_##name = v; \
|
||||
} \
|
||||
type name() { \
|
||||
return _##name; \
|
||||
} \
|
||||
private: \
|
||||
type _##name
|
||||
#endif
|
||||
|
||||
//! @addtogroup qbrowserlib
|
||||
//! @{
|
||||
|
||||
@@ -30,6 +44,8 @@ namespace qbrowserlib {
|
||||
|
||||
Q_OBJECT;
|
||||
|
||||
CREATE_QT_PROPERTY(QUrl, homeUrl);
|
||||
|
||||
public:
|
||||
|
||||
SwissWebWidget(QWidget* p=0): QWidget(p) {
|
||||
@@ -40,7 +56,7 @@ namespace qbrowserlib {
|
||||
moveToMain(qobject_cast<QMainWindow*>(p?p->parentWidget():p));
|
||||
connects();
|
||||
}
|
||||
|
||||
|
||||
//! Moves status widgets to status bar, tool widgets to toolbar
|
||||
/*! You can use this method to reparent the tools and the status
|
||||
part of the widget into the toolbar and statusbar of your
|
||||
@@ -49,7 +65,7 @@ namespace qbrowserlib {
|
||||
@note If used as central widget of a QMainWindow, status and
|
||||
tools are automatically reparented in the constructor. */
|
||||
void moveToMain(QMainWindow* w) {
|
||||
if (!w) return;
|
||||
if (!w || !_statusbar || !_tools) return;
|
||||
QToolBar* t(w->addToolBar(trUtf8("Browser Tools",
|
||||
"name of the browser's toolbar")));
|
||||
while (_tools->count())
|
||||
@@ -66,11 +82,16 @@ namespace qbrowserlib {
|
||||
void load() {
|
||||
_webview->load(_url->text());
|
||||
}
|
||||
|
||||
void goHome() {
|
||||
_webview->load(_homeUrl);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
void connects() {
|
||||
connect(_url, SIGNAL(returnPressed()), SLOT(load()));
|
||||
connect(_home, SIGNAL(pressed()), SLOT(goHome()));
|
||||
}
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user