Files
surfer/src/qbrowserlib/swisswebwidget.hxx

59 lines
1.7 KiB
C++
Raw Normal View History

/*! @file
@id $Id$
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
2012-11-07 11:43:29 +00:00
#ifndef __SWISSWEBWIDGET_HXX__
#define __SWISSWEBWIDGET_HXX__
#include <qbrowserlib/ui_swisswebwidget.h>
#include <QtGui/QMainWindow>
#include <QtGui/QToolBar>
#include <QtGui/QStatusBar>
2012-11-07 11:43:29 +00:00
2012-11-08 09:27:52 +00:00
#include <QtDebug>
//! @addtogroup qbrowserlib
//! @{
2012-11-07 11:43:29 +00:00
namespace qbrowserlib {
//! Window Widget for complete page witghin a webbrowser.
/*! Contains a toolbar, a status bar and @refs
SwissWebView. Instanciate this and you have a complete
browser. To be used inside a QTabBar, as main window or as
docking widget. */
2012-11-07 14:32:43 +00:00
class SwissWebWidget: public QWidget, private Ui::SwissWebWidget {
2012-11-07 13:07:38 +00:00
Q_OBJECT;
public:
2012-11-07 14:32:43 +00:00
SwissWebWidget(QWidget* p=0): QWidget(p) {
setupUi(this);
QMainWindow* w(qobject_cast<QMainWindow*>(p?p->parentWidget():p));
2012-11-08 09:27:52 +00:00
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. */
2012-11-08 09:27:52 +00:00
qDebug()<<"Rearranging";
QToolBar* t(w->addToolBar(trUtf8("Browser Tools",
"name of the browser's toolbar")));
_tools->setParent(t);
_statusbar->removeWidget(_status);
2012-11-08 09:27:52 +00:00
for (int i(_statusbar->count()); i>0;) {
qDebug()<<"Rearranging item "<<(i-1)<<_statusbar->itemAt(--i);
w->statusBar()->addWidget(_statusbar->itemAt(--i)->widget());
2012-11-08 09:27:52 +00:00
}
}
}
protected:
};
2012-11-07 11:43:29 +00:00
}
//! @}
2012-11-07 11:43:29 +00:00
#endif