From 9aed7f55a02632c2222a9f9deef11a9459705cdc Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 27 Jan 2010 22:05:46 +0000 Subject: [PATCH] revert the popup menus detachment out of QGraphicsProxyWidget, but only in 4.4 branch. this is unfortunate but triggers qt bug 7254 http://bugreports.qt.nokia.com/browse/QTBUG-7254 hope will be possible to revert this commit even in 4.4 lifetime svn path=/branches/KDE/4.4/kdelibs/; revision=1081199 --- widgets/label.cpp | 6 +++++- widgets/scrollbar.cpp | 6 +++++- widgets/textbrowser.cpp | 6 +++++- widgets/textedit.cpp | 7 +++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/widgets/label.cpp b/widgets/label.cpp index c6e280657..10d93fc40 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -114,7 +114,8 @@ Label::Label(QGraphicsWidget *parent) d(new LabelPrivate(this)) { QLabel *native = new QLabel; - native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); d->textSelectable = false; connect(native, SIGNAL(linkActivated(QString)), this, SIGNAL(linkActivated(QString))); connect(native, SIGNAL(linkHovered(QString)), this, SIGNAL(linkHovered(QString))); @@ -238,9 +239,12 @@ void Label::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Dat void Label::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()), event->pos().toPoint(), event->screenPos(), event->modifiers()); QApplication::sendEvent(nativeWidget(), &contextMenuEvent); + */ + QGraphicsProxyWidget::contextMenuEvent(event); } void Label::resizeEvent(QGraphicsSceneResizeEvent *event) diff --git a/widgets/scrollbar.cpp b/widgets/scrollbar.cpp index 44fb824c1..1cfd63129 100644 --- a/widgets/scrollbar.cpp +++ b/widgets/scrollbar.cpp @@ -40,7 +40,8 @@ ScrollBar::ScrollBar(QGraphicsWidget *parent) d(new ScrollBarPrivate) { QScrollBar *scrollbar = new QScrollBar(); - scrollbar->setWindowFlags(scrollbar->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //scrollbar->setWindowFlags(scrollbar->windowFlags()|Qt::BypassGraphicsProxyWidget); scrollbar->setAttribute(Qt::WA_NoSystemBackground); setWidget(scrollbar); d->style = Plasma::Style::sharedStyle(); @@ -130,9 +131,12 @@ void ScrollBar::setOrientation(Qt::Orientation orientation) void ScrollBar::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()), event->pos().toPoint(), event->screenPos(), event->modifiers()); QApplication::sendEvent(nativeWidget(), &contextMenuEvent); + */ + QGraphicsProxyWidget::contextMenuEvent(event); } } diff --git a/widgets/textbrowser.cpp b/widgets/textbrowser.cpp index b49822a02..286bc2a1a 100644 --- a/widgets/textbrowser.cpp +++ b/widgets/textbrowser.cpp @@ -102,7 +102,8 @@ TextBrowser::TextBrowser(QGraphicsWidget *parent) d(new TextBrowserPrivate(this)) { KTextBrowser *native = new KTextBrowser; - native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //native->setWindowFlags(native->windowFlags()|Qt::BypassGraphicsProxyWidget); connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged())); connect(native, SIGNAL(textChanged()), this, SLOT(setFixedHeight())); setWidget(native); @@ -180,9 +181,12 @@ void TextBrowser::dataUpdated(const QString &sourceName, const Plasma::DataEngin void TextBrowser::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QMenu *popup = nativeWidget()->createStandardContextMenu(event->screenPos()); popup->exec(event->screenPos()); delete popup; + */ + QGraphicsProxyWidget::contextMenuEvent(event); } void TextBrowser::resizeEvent(QGraphicsSceneResizeEvent *event) diff --git a/widgets/textedit.cpp b/widgets/textedit.cpp index aefeb46cf..bb132d1b9 100644 --- a/widgets/textedit.cpp +++ b/widgets/textedit.cpp @@ -124,7 +124,8 @@ void TextEdit::setNativeWidget(KTextEdit *nativeWidget) widget()->deleteLater(); } - nativeWidget->setWindowFlags(nativeWidget->windowFlags()|Qt::BypassGraphicsProxyWidget); + //disabled for now: triggers Qt bug 7254 + //nativeWidget->setWindowFlags(nativeWidget->windowFlags()|Qt::BypassGraphicsProxyWidget); connect(nativeWidget, SIGNAL(textChanged()), this, SIGNAL(textChanged())); @@ -164,9 +165,11 @@ void TextEdit::dataUpdated(const QString &sourceName, const Plasma::DataEngine:: void TextEdit::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { + /*disabled for now: triggers Qt bug 7254 QMenu *popup = nativeWidget()->mousePopupMenu(); popup->exec(event->screenPos()); - delete popup; + delete popup;*/ + QGraphicsProxyWidget::contextMenuEvent(event); } void TextEdit::resizeEvent(QGraphicsSceneResizeEvent *event)