Example #1
0
        MainWindow::MainWindow(QWidget *parent)
            : QMainWindow(parent)
        {
            setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

            setupLayouts();
            setupMenus();
            setupToolbars();
            setupContent();
            setupMainWidget();

            setStyleSheet(GeneralStyles::windowStyle);
        }
Example #2
0
MainWindow::MainWindow()
        : KXmlGuiWindow()
        , m_view(new MainView(this))
        , m_findBar(new FindBar(this))
        , m_zoomBar(new ZoomBar(this))
        , m_historyPanel(0)
        , m_bookmarksPanel(0)
        , m_webInspectorPanel(0)
        , m_analyzerPanel(0)
        , m_historyBackMenu(0)
        , m_encodingMenu(new KMenu(this))
        , m_bookmarksBar(0)
        , m_popup(new KPassivePopup(this))
        , m_hidePopup(new QTimer(this))
        , m_toolsMenu(0)
{
    // creating a centralWidget containing panel, m_view and the hidden findbar
    QWidget *centralWidget = new QWidget;
    centralWidget->setContentsMargins(0, 0, 0, 0);

    // setting layout
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(m_view);
    layout->addWidget(m_findBar);
    layout->addWidget(m_zoomBar);
    centralWidget->setLayout(layout);

    // central widget
    setCentralWidget(centralWidget);

    // setting size policies
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    // then, setup our actions
    setupActions();

    // setting Panels
    setupPanels();

    // setting up rekonq tools
    setupTools();

    // setting up rekonq toolbar(s)
    setupToolbars();

    // a call to KXmlGuiWindow::setupGUI() populates the GUI
    // with actions, using KXMLGUI.
    // It also applies the saved mainwindow settings, if any, and ask the
    // mainwindow to automatically save settings if changed: window size,
    // toolbar position, icon size, etc.
    setupGUI();

    // no menu bar in rekonq: we have other plans..
    menuBar()->setVisible(false);

    // no more status bar..
    setStatusBar(0);

    // give me some time to do all the other stuffs...
    QTimer::singleShot(100, this, SLOT(postLaunch()));

    kDebug() << "MainWindow ctor...DONE";
}