[Qt-interest] Displaying the File menu for Draged TreeWidgetitems

Yuvaraj R yuvaraj at ongobiz.com
Tue Jul 28 11:30:39 CEST 2009


I am trying with.


QString name = ui->treeWidget->currentItem()->text(0);

user = name;

if((ui->treeWidget->currentItem()!=
ui->treeWidget->topLevelItem(0))&&(ui->treeWidget->currentItem()!=
ui->treeWidget->topLevelItem(1))&&

(ui->treeWidget->currentItem()!=
ui->treeWidget->topLevelItem(2))&&(ui->treeWidget->currentItem()!=
ui->treeWidget->topLevelItem(3)))

{

for (int i=0;i < ui->treeWidget->topLevelItem(0)->childCount();i++)

{

if(ui->treeWidget->currentItem() ==
ui->treeWidget->topLevelItem(0)->child(i))

{

fileMenu->exec(QCursor::pos());//show file menu when clicked item is not top
level item;

return;

}

}

}

else if(ui->treeWidget->currentItem() == ui->treeWidget->topLevelItem(0))

{

group_menu->exec(QCursor::pos()); //show file menu when clicked item is not
top level item;

}

else

{

if(ui->treeWidget->topLevelItem(1)->childCount()==0)

{

return;

}

createmenu2();

qDebug() <<" yuvaraj";

conference_menu->exec(QCursor::pos());

return;

}

QAction *action;

conference_menu = new QMenu(this);

QAction *drop_guest = conference_menu->addAction(tr("Drop Action"));

connect(*drop_guest,SIGNAL(triggered()),this,SLOT(drop_conference_guest()));

void MainWindow::drop_conference_guest()

{

QMessageBox::information(0,"",QString("dropping"));

QString conference_id =QString("*/&\<4444>");

for(int i=0;i<ui->treeWidget->topLevelItem(1)->childCount();i++)

{

if(ui->treeWidget->currentItem()->text(0) ==
ui->treeWidget->topLevelItem(1)->child(i)->text(0))

{

for(int j=0;j<conference_guest_details.size();j++)

{

send_new_im(conference_guest_details.at
(i),"*/&&"+conference_id+"*&*"+ui->treeWidget->topLevelItem(1)->child(i)->text(0)+"^*^400");

}

}

}

}


Thanks

Yuvaraj R

On Tue, Jul 28, 2009 at 1:38 PM, Scott Aron Bloom
<Scott.Bloom at sabgroup.com>wrote:

> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Srdjan Todorovic
> Sent: Tuesday, July 28, 2009 1:02 AM
> To: qt-interest
> Subject: Re: [Qt-interest] Displaying the File menu for Draged
> TreeWidgetitems
>
> Hi,
>
> On 28/07/2009, Yuvaraj R <yuvaraj at ongobiz.com> wrote:
>
> > I had set conditon to show menu for Toplevelitem 1,it was
> showing..when i am
> > setting for dragged items ,it is not displaying the menu.
>
> Not displaying what menu? I didn't see anything in your code regarding
> any menu...
>
> > On Tue, Jul 28, 2009 at 12:48 PM, Thiago Macieira <
> > thiago.macieira at trolltech.com> wrote:
> >> And if after a week you got no answer, do not simply repost.
>
> Playing Devil's advocate here, but what if you have a tight deadline at
> work?
>
> Srdjan
> ------------------
> Hire one of the MANY MANY qualified QT consultants on this message
> board, and hope they can figure it out..
>
> They probably don't know the answer or they would of posted, but they
> can probably find it with some hard work....
>
> Scott
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090728/109ee564/attachment.html 


More information about the Qt-interest-old mailing list