QStyle flags depending on user decisions
Rafael Fernández López
ereslibre at gmail.com
Wed Jun 27 19:04:36 BST 2007
Hi all,
I have experimented a bad behavior on Dolphin. Right now, on Dolphin what we
are doing is checking to:
if (KGlobalSettings::singleClick()) {
connect(this, SIGNAL(clicked(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
} else {
connect(this, SIGNAL(doubleClicked(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
}
From my point of view this should be reduced to:
connect(this, SIGNAL(activated(const QModelIndex&)), controller,
SLOT(triggerItem(const QModelIndex&)));
The problem is on QStyle's flag:
QStyle::SH_ItemView_ActivateItemOnSingleClick.
If we run "kcmshell mouse" and set that we want items to be activated on
Double Click, we need to update this flag, and do something like:
CurrentStyle &= ~QStyle::SH_ItemView_ActivateItemOnSingleClick.
This way, all item views should behave the same way, and consistent with the
user decision of activating on double click, not on single ones.
We have a strong problem: we can't do this check at kstyle, since it
technically shouldn't depend on kdelibs code.
The other solution is to take out the possibility of letting user choose
double click. I fully agree with this last option if we can't assure the
user that his/her decision will be applied on the whole system (not all
system except, item views).
Bye,
Rafael Fernández López.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070627/da99ebf0/attachment.htm>
More information about the kde-core-devel
mailing list