Discussion:
Re: problem about signal itemClicked in MLIST
Sinis
2011-03-03 10:15:29 UTC
Permalink
Thanks for your explanation.
But i have a litter puzzled, my ListCellCreator inherits MAbstractCellCreator<MContentItem> and create widget MContentItem,
MContentItem have a "clicked()" signal, however, i still fail to emit an "itemClicked" signal. When i clicked mlist,
i can received a "clicked()" signal from some MContentItem instead of an "itemClicked" signal from mlist.


------------------ Ô­ÊŒÓÊŒþ ------------------
·¢ŒþÈË: "stanislav.ionascu"<***@nokia.com>;
·¢ËÍʱŒä: 2011Äê3ÔÂ3ÈÕ(ÐÇÆÚËÄ) ÏÂÎç5:50
ÊÕŒþÈË: "ext Sinis"<***@foxmail.com>;
³­ËÍ: "meego-touch-dev"<meego-touch-***@meego.com>;
Ö÷Ìâ: Re: [MeeGo-touch-dev] problem about signal itemClicked in MLIST


Hi,

For MList to emit an itemClicked signal, your widgets, which are created
in ListCellCreator, must have a "clicked()" signal.

The itemClicked signals for the headers will not be emitted.

Best Regards,
Stanislav Ionascu.
When i clicked mlist, i find out the signal itemClicked(const
QModelIndex &) would not be emitted.
...
MList * list = new MList;
list->setShowGroup(true);
ListCellCreator * cellCreator = new ListCellCreator ;
list->setCellCreator(cellCreator);
HeaderCellCreator * headerCreator = new HeaderCellCreator ;
list->setHeaderCreator(headerCreator);
list->setModel(model);
connect(list, SIGNAL(itemClicked(const QModelIndex &), this,
SLOT(clickItem(const QModelIndex &)));
...
i code like this, after doing test, when i clicked mlist,
i find signal itemClicked(const QModelIndex &) will not be emitted,
but the signal in widgets created by ListCellCreator
or HeaderCellCreator can be emitted,
what should i do to get the signal emitted by Mlist instead of
widgets from ListCellCreator or HeaderCellCreator.
Any suggestions are greatly appreciated
Thanks
_______________________________________________
MeeGo-touch-dev mailing list
http://lists.meego.com/listinfo/meego-touch-dev
s***@public.gmane.org
2011-03-03 18:45:07 UTC
Permalink
If the widget, in this case MContentItem, has the clicked signal, it should just work.
Could you share the part of the code which creates the list cells (The ListCellCreator class). And how do you check if the signal is emitted or not?
Does the meegotouch widgetsgallery list page (Lists, Grids and Popups - > List) work for you? When clicking on the item it should output "item row number #n clicked", if it works.

Thanks.

Best Regards,
Stanislav Ionascu.
Post by Sinis
Thanks for your explanation.
But i have a litter puzzled, my ListCellCreator inherits MAbstractCellCreator<MContentItem> and create widget MContentItem,
MContentItem have a "clicked()" signal, however, i still fail to emit an "itemClicked" signal. When i clicked mlist,
i can received a "clicked()" signal from some MContentItem instead of an "itemClicked" signal from mlist.
------------------ 原始邮件 ------------------
发送时间: 2011年3月3日(星期四) 下午5:50
主题: Re: [MeeGo-touch-dev] problem about signal itemClicked in MLIST
Hi,
For MList to emit an itemClicked signal, your widgets, which are created
in ListCellCreator, must have a "clicked()" signal.
The itemClicked signals for the headers will not be emitted.
Best Regards,
Stanislav Ionascu.
When i clicked mlist, i find out the signal itemClicked(const
QModelIndex &) would not be emitted.
...
MList * list = new MList;
list->setShowGroup(true);
ListCellCreator * cellCreator = new ListCellCreator ;
list->setCellCreator(cellCreator);
HeaderCellCreator * headerCreator = new HeaderCellCreator ;
list->setHeaderCreator(headerCreator);
list->setModel(model);
connect(list, SIGNAL(itemClicked(const QModelIndex &), this,
SLOT(clickItem(const QModelIndex &)));
...
i code like this, after doing test, when i clicked mlist,
i find signal itemClicked(const QModelIndex &) will not be emitted,
but the signal in widgets created by ListCellCreator
or HeaderCellCreator can be emitted,
what should i do to get the signal emitted by Mlist instead of
widgets from ListCellCreator or HeaderCellCreator.
Any suggestions are greatly appreciated
Thanks
_______________________________________________
MeeGo-touch-dev mailing list
http://lists.meego.com/listinfo/meego-touch-dev
Loading...