diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-12-14 00:00:19 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-12-14 00:00:19 +0100 |
commit | 682cac6c2ce4cf21b9a2f4314cc452060f389b20 (patch) | |
tree | 772d0535d5f5fa86a19a6489034eb685456ededf /src/mainview.cpp | |
parent | Merge commit 'refs/merge-requests/69' of git://gitorious.org/rekonq/mainline ... (diff) | |
download | rekonq-682cac6c2ce4cf21b9a2f4314cc452060f389b20.tar.xz |
Just some stupid fixes
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r-- | src/mainview.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index d2105dcd..3285c630 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -312,7 +312,10 @@ void MainView::currentChanged(int index) WebView *MainView::webView(int index) const { - if (this->widget(index) && this->widget(index)->layout() && this->widget(index)->layout()->itemAt(1)) //TODO: find why it crashes when closetab without that. + if( this->widget(index) + && this->widget(index)->layout() + && this->widget(index)->layout()->itemAt(1) //TODO: find why it crashes when closetab without that. + ) { QWidget *widget = this->widget(index)->layout()->itemAt(1)->widget(); if (WebView *webView = qobject_cast<WebView*>(widget)) @@ -328,19 +331,24 @@ WebView *MainView::webView(int index) const WebView *MainView::newWebView(bool focused, bool nearParent) { - QWidget* w=new QWidget; - QVBoxLayout* l=new QVBoxLayout(w); + QWidget* w = new QWidget; + QVBoxLayout* l = new QVBoxLayout; l->setMargin(0); - QWidget* messageBar=new QWidget; // should be deleted on tab close? - QVBoxLayout* l2=new QVBoxLayout(messageBar); - l->addWidget(messageBar); - + + // this messageBar with its relative layout is useful to embed widget, + // like the wallet bar and so on + QWidget* messageBar = new QWidget; // should be deleted on tab close? // yes! + QVBoxLayout* l2 = new QVBoxLayout; + messageBar->setLayout(l2); messageBar->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); messageBar->hide(); - WebView *webView = new WebView(w,messageBar); // should be deleted on tab close? + l->addWidget(messageBar); + + WebView *webView = new WebView(w, messageBar); // should be deleted on tab close? l->addWidget(webView); webView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); + w->setLayout(l); // connecting webview with mainview connect(webView, SIGNAL(loadStarted()), this, SLOT(webViewLoadStarted())); @@ -505,8 +513,8 @@ void MainView::closeTab(int index) QWidget *webView = this->webView(index); removeTab(index); updateTabBar(); // UI operation: do it ASAP!! - webView->deleteLater(); // webView is scheduled for deletion. - + webView->deleteLater(); // webView is scheduled for deletion. + emit tabsChanged(); if (hasFocus && count() > 0) |