|
|
|
@ -14,6 +14,8 @@ |
|
|
|
|
#include <QtGui/QToolBar> |
|
|
|
|
#include <QtGui/QStatusBar> |
|
|
|
|
|
|
|
|
|
#include <QtDebug> |
|
|
|
|
|
|
|
|
|
//! @addtogroup qbrowserlib
|
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
@ -30,18 +32,22 @@ namespace qbrowserlib { |
|
|
|
|
SwissWebWidget(QWidget* p=0): QWidget(p) { |
|
|
|
|
setupUi(this); |
|
|
|
|
QMainWindow* w(qobject_cast<QMainWindow*>(p)); |
|
|
|
|
qDebug()<<"Parent "<<p<<(w?"is":"is not")<<" a QMainWindow"; |
|
|
|
|
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. */ |
|
|
|
|
qDebug()<<"Rearranging"; |
|
|
|
|
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;) |
|
|
|
|
for (int i(_statusbar->count()); i>0;) { |
|
|
|
|
qDebug()<<"Rearranging item "<<(i-1)<<_statusbar->itemAt(--i); |
|
|
|
|
w->statusBar()->addWidget(_statusbar->itemAt(--i)->widget()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
protected: |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|