r21094 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Sat Mar 19 16:02:33 UTC 2016
Author: jghali
Date: Sat Mar 19 16:02:33 2016
New Revision: 21094
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21094
Log:
When switching PP tabs, do not attempt to set focus to non visible widget
Modified:
trunk/Scribus/scribus/ui/propertiespalette.cpp
Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21094&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Sat Mar 19 16:02:33 2016
@@ -189,23 +189,32 @@
{
if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
+
+ if (!TabStack->widget(t)->isVisible())
+ return;
+
+ bool focusNowSet = false;
foreach (QObject *o, TabStack->widget(t)->children())
{
// Layouts, boxes etc aren't widgets at all
// so let's skip them silently...
QWidget *w = qobject_cast<QWidget*>(o);
- if (w)
- {
- QWidget *i = TabStack->widget(t);
- while ((i = i->nextInFocusChain()) != TabStack->widget(t))
+ if (!w)
+ continue;
+
+ QWidget *i = TabStack->widget(t);
+ while ((i = i->nextInFocusChain()) != TabStack->widget(t))
+ {
+ if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) && !i->focusProxy() && i->isEnabled())
{
- if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) && !i->focusProxy() && i->isEnabled())
- {
- i->setFocus();
- break;
- }
+ focusNowSet = true;
+ i->setFocus();
+ break;
}
}
+
+ if (focusNowSet)
+ break;
}
}
More information about the scribus-commit
mailing list