views:

17

answers:

1

Hi everyone,

I'm trying to find the best way to create a personalized contact List for an instant messaging app.

Maybe with a Tree View but I'm not sure.

I Need a way to view Groups in which there are Contacts. A Contact contains different info and action buttons like "Send a message, View infos, ... "

An example @ http://ycorpblog.com/wp-content/uploads/2007/10/yahoo-messenger-90-action-toolbar.jpg

A: 

here I am in my little research. I inherited one of my classes QAbstractItemDelegate.

I reimplements paint () and sizeHint ()

in the paint () for drawing my items (and here for example a button) Code:

QStyleOptionButton buttonStyle;
buttonStyle.rect = option.rect;
buttonStyle.features = QStyleOptionButton::AutoDefaultButton;
buttonStyle.text = "Salut!";

QApplication::style()->drawControl(QStyle::CE_PushButton,&buttonStyle,painter);

But then it does involve reimplementing QAbstractItemDelegate: helpEvent () to retrieve the actions of clicking the buttons (compare the position of the mouse compared to my drawing and determine what the user clicks)?

Moreover, with the solution proposed above,

QAbstractItemDelegate::helpEvent () is a slot

Despite a careful reading of the documentation, I can not determine when this function is called, does it connect to something?

I also cast a glance at editorEvent (), I recovered well Mouse Click but no way of knowing exactly where the user clicked, so no way of knowing if it's a button or other element.

I asked about the method I use too. Is this good? Can you enlighten me?

Pending your answers / ideas. Thank you.

VoltX