[Qt-interest] mousePress Eveent disabling QTreeWidgetItemandchildIndicator

Sujan Dasmahapatra sdh at lmwindpower.com
Tue Mar 22 08:42:50 CET 2011


Hi Tony

So what can be done to achieve this. How could I know when the
childIndicator is clicked. I  want to expand the items when child
Indicator is clicked. Thanks sujan

 

 

Kind Regards,

 

 

Sujan Dasmahapatra
Project Leader, Aero Group
Aero Group

Tel    +91 80 66470248
Mob  

sdh at lmwindpower.com <mailto:%25EMAIL%25> 

 

LM Wind Power Blades

lmwindpower.com

 

Together we capture the wind to power a cleaner world

________________________________

 

This e-mail and any attachments are confidential. If you are not the
named or intended recipient, please notify the sender immediately and do
not disclose the contents to any other person, use it for any purpose,
or store or copy the information in any medium. Any unauthorized
disclosure, use or storage is prohibited and might be unlawful.

From: qt-interest-bounces+sdh=lmwindpower.com at qt.nokia.com
[mailto:qt-interest-bounces+sdh=lmwindpower.com at qt.nokia.com] On Behalf
Of Tony Rietwyk
Sent: Tuesday, March 22, 2011 11:21 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] mousePress Eveent disabling
QTreeWidgetItemandchildIndicator

 

Hi Sujan, 

 

Whenever you override a virtual method, you must ask yourself "Do I need
to call the base method?" 

 

In this case, the base code is never gets the mouse press, so functions
that rely on it don't work.  

 

Tony.

 

 

 

	-----Original Message-----
	From:
qt-interest-bounces+tony.rietwyk=rightsoft.com.au at qt.nokia.com
[mailto:qt-interest-bounces+tony.rietwyk=rightsoft.com.au at qt.nokia.com]
On Behalf Of Sujan Dasmahapatra
	Sent: Tuesday, 22 March 2011 16:03
	To: qt-interest at trolltech.com
	Subject: [Qt-interest] mousePress Eveent disabling
QTreeWidgetItem andchildIndicator

	Dear Friends

	I have just implemented  drag and drop for  QTreeWidgetItems.
But as I reimplemented mousePressEvent() then I am not able to select an
item and childIndicator is not expanding. The item is disabled from
mouseAction. I implemented drag and drop for right mouse button.

	 

	
////////////////////////////////////////////////////////////////////////
///////////////////////////////////

	void Tree::mousePressEvent(QMouseEvent *event)

	{

	 

	       if(event->button()==Qt::RightButton)

	       {

	       draggingItem = this->itemAt(event->pos());

	       QDrag *drag = new QDrag(this);

	       drag->exec(Qt::MoveAction | Qt::CopyAction,
Qt::CopyAction);

	       event->accept();

	       }

	}

	
////////////////////////////////////////////////////////////////////////
///////////////////////////

	 

	Thanks in advance for any help.

	 

	Kind Regards,

	 

	 

	Sujan Dasmahapatra
	Project Leader, Aero Group
	Aero Group

	Tel    +91 80 66470248
	Mob  

	sdh at lmwindpower.com <mailto:%25EMAIL%25> 

	 

	LM Wind Power Blades

	lmwindpower.com

	 

	Together we capture the wind to power a cleaner world

	
________________________________


	 

	This e-mail and any attachments are confidential. If you are not
the named or intended recipient, please notify the sender immediately
and do not disclose the contents to any other person, use it for any
purpose, or store or copy the information in any medium. Any
unauthorized disclosure, use or storage is prohibited and might be
unlawful.

	 

	-----

	No virus found in this message.

	Checked by AVG - www.avg.com

	Version: 10.0.1204 / Virus Database: 1498/3521 - Release Date:
03/21/11

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110322/94cb82e7/attachment.html 


More information about the Qt-interest-old mailing list