master
Marc Wäckerlin 12 years ago
parent 5f39f8d261
commit 9d50e35895
  1. 2
      src/qbrowserlib/qbrowserlib_de.ts
  2. 2
      src/qbrowserlib/qbrowserlib_en.ts
  3. 2
      src/qbrowserlib/qbrowserlib_fr.ts
  4. 2
      src/qbrowserlib/qbrowserlib_it.ts
  5. 23
      src/qbrowserlib/swisswebwidget.hxx

@ -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&apos;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&apos;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&apos;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&apos;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) {
@ -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())
@ -67,10 +83,15 @@ namespace qbrowserlib {
_webview->load(_url->text());
}
void goHome() {
_webview->load(_homeUrl);
}
protected:
void connects() {
connect(_url, SIGNAL(returnPressed()), SLOT(load()));
connect(_home, SIGNAL(pressed()), SLOT(goHome()));
}
};

Loading…
Cancel
Save