auto reparent in main window; refs #167

master
Marc Wäckerlin 12 years ago
parent 738309e123
commit fbb837f84a
  1. 9
      src/qbrowserlib/qbrowserlib_de.ts
  2. 9
      src/qbrowserlib/qbrowserlib_en.ts
  3. 9
      src/qbrowserlib/qbrowserlib_fr.ts
  4. 9
      src/qbrowserlib/qbrowserlib_it.ts
  5. 14
      src/qbrowserlib/swisswebwidget.hxx
  6. 2
      src/qbrowserlib/swisswebwidget.ui

@ -692,4 +692,13 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>qbrowserlib::SwissWebWidget</name>
<message>
<location filename="swisswebwidget.hxx" line="37"/>
<source>Browser Tools</source>
<comment>name of the browser&apos;s toolbar</comment>
<translation type="unfinished"></translation>
</message>
</context>
</TS> </TS>

@ -692,4 +692,13 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>qbrowserlib::SwissWebWidget</name>
<message>
<location filename="swisswebwidget.hxx" line="37"/>
<source>Browser Tools</source>
<comment>name of the browser&apos;s toolbar</comment>
<translation type="unfinished"></translation>
</message>
</context>
</TS> </TS>

@ -692,4 +692,13 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>qbrowserlib::SwissWebWidget</name>
<message>
<location filename="swisswebwidget.hxx" line="37"/>
<source>Browser Tools</source>
<comment>name of the browser&apos;s toolbar</comment>
<translation type="unfinished"></translation>
</message>
</context>
</TS> </TS>

@ -692,4 +692,13 @@ Specify full path to executable program</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>qbrowserlib::SwissWebWidget</name>
<message>
<location filename="swisswebwidget.hxx" line="37"/>
<source>Browser Tools</source>
<comment>name of the browser&apos;s toolbar</comment>
<translation type="unfinished"></translation>
</message>
</context>
</TS> </TS>

@ -11,6 +11,8 @@
#include <qbrowserlib/ui_swisswebwidget.h> #include <qbrowserlib/ui_swisswebwidget.h>
#include <QtGui/QMainWindow> #include <QtGui/QMainWindow>
#include <QtGui/QToolBar>
#include <QtGui/QStatusBar>
//! @addtogroup qbrowserlib //! @addtogroup qbrowserlib
//! @{ //! @{
@ -27,6 +29,18 @@ namespace qbrowserlib {
public: public:
SwissWebWidget(QWidget* p=0): QWidget(p) { SwissWebWidget(QWidget* p=0): QWidget(p) {
setupUi(this); setupUi(this);
QMainWindow* w(qobject_cast<QMainWindow*>(p));
if (w) {
/*! Within a QMainWindow, the widget automatically reparents
the top buttons to the toolbar and the bottom status
line to the window's status bar. */
QToolBar* t(w->addToolBar(trUtf8("Browser Tools",
"name of the browser's toolbar")));
_tools->setParent(t);
_statusbar->removeWidget(_status);
for (int i(_statusbar->count()); i>0;)
w->statusBar()->addWidget(_statusbar->itemAt(--i)->widget());
}
} }
protected: protected:
}; };

@ -116,7 +116,7 @@
<widget class="qbrowserlib::SwissWebView" name="swisswebview"/> <widget class="qbrowserlib::SwissWebView" name="swisswebview"/>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="_stats"> <layout class="QHBoxLayout" name="_statusbar">
<item> <item>
<widget class="QLabel" name="_status"> <widget class="QLabel" name="_status">
<property name="sizePolicy"> <property name="sizePolicy">

Loading…
Cancel
Save