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
This commit is contained in:
Marco Martin 2010-01-27 22:05:46 +00:00
parent f77cf8c3e0
commit 9aed7f55a0
4 changed files with 20 additions and 5 deletions

View File

@ -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)

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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)