diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-02-05 00:29:13 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-02-05 00:29:13 +0100 |
commit | c328e203e0d84177a0028d8ba5b0af4b82c16eeb (patch) | |
tree | e6b38cc023c1920a6b2bab87a36ac5932a534ad5 /src/tabbar.cpp | |
parent | Merge commit 'refs/merge-requests/85' of git://gitorious.org/rekonq/mainline (diff) | |
download | rekonq-c328e203e0d84177a0028d8ba5b0af4b82c16eeb.tar.xz |
QPointers --> QWeakPointers
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r-- | src/tabbar.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/tabbar.cpp b/src/tabbar.cpp index 460a2464..5e1feb56 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -161,24 +161,21 @@ void TabBar::showTabPreview(int tab) int h = w*((0.0 + currentView->height())/currentView->width()); //delete previous tab preview - if (m_previewPopup) - { - delete m_previewPopup; - } - + m_previewPopup.clear(); + m_previewPopup = new KPassivePopup(this); - m_previewPopup->setFrameShape(QFrame::StyledPanel); - m_previewPopup->setFrameShadow(QFrame::Plain); - m_previewPopup->setFixedSize(w, h); + m_previewPopup.data()->setFrameShape(QFrame::StyledPanel); + m_previewPopup.data()->setFrameShadow(QFrame::Plain); + m_previewPopup.data()->setFixedSize(w, h); QLabel *l = new QLabel(); view->page()->setViewportSize(currentView->page()->viewportSize()); l->setPixmap(WebSnap::renderPreview(*(view->page()), w, h)); - m_previewPopup->setView(l); - m_previewPopup->layout()->setAlignment(Qt::AlignTop); - m_previewPopup->layout()->setMargin(0); + m_previewPopup.data()->setView(l); + m_previewPopup.data()->layout()->setAlignment(Qt::AlignTop); + m_previewPopup.data()->layout()->setMargin(0); QPoint pos( tabRect(tab).x() , tabRect(tab).y() + tabRect(tab).height() ); - m_previewPopup->show(mapToGlobal(pos)); + m_previewPopup.data()->show(mapToGlobal(pos)); } @@ -208,9 +205,9 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) //if current tab or not found then hide previous tab preview if (tab==currentIndex() || tab==-1) { - if ( m_previewPopup) + if ( !m_previewPopup.isNull() ) { - m_previewPopup->hide(); + m_previewPopup.data()->hide(); } m_currentTabPreview = -1; } @@ -225,9 +222,9 @@ void TabBar::leaveEvent(QEvent *event) if (ReKonfig::alwaysShowTabPreviews()) { //if leave tabwidget then hide previous tab preview - if ( m_previewPopup) + if ( !m_previewPopup.isNull() ) { - m_previewPopup->hide(); + m_previewPopup.data()->hide(); } m_currentTabPreview = -1; } |