Use a queued connection instead of direct call

It seems some shells (like konqueror and kile) are too smart and play with the focus and the focus ends up in the wrong place because they "overwrite" our setFocus call, now we workaoround that by using the queuedconnection
BUGS: 214020
BUGS: 240516
FIXED-IN: 4.8.0
This commit is contained in:
Albert Astals Cid 2011-12-16 00:25:24 +01:00
parent 8df96e9e64
commit 6176e29256

View file

@ -392,7 +392,7 @@ m_cliPresentation(false), m_embedMode(detectEmbedMode(parentWidget, parent, args
m_formsMessage->setup( i18n( "This document has forms. Click on the button to interact with them, or use View -> Show Forms." ) );
rightLayout->addWidget( m_formsMessage );
m_pageView = new PageView( rightContainer, m_document );
m_pageView->setFocus(); //usability setting
QMetaObject::invokeMethod( m_pageView, "setFocus", Qt::QueuedConnection ); //usability setting
// m_splitter->setFocusProxy(m_pageView);
connect( m_pageView, SIGNAL(urlDropped(KUrl)), SLOT(openUrlFromDocument(KUrl)));
connect( m_pageView, SIGNAL(rightClick(const Okular::Page*,QPoint)), this, SLOT(slotShowMenu(const Okular::Page*,QPoint)) );