Hi,
the selected item may be different than the current item, so it's really up to you to decide if you want the selected item to be current or not.
Yes, I want.
Thanks, but I have another question:
I have a root item, I create a child and I insert a QComboBox into column 1 of this child. I've connected the "QComboBox::currentIndexChanged(int)" to a SLOT. When the SLOT is called I want to get the item that is in the column 0.
...
m_pqTree->setItemWidget(pqItem ,1,pqComboBox);
connect(pqComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setMode(int)));
...
...
pqItem = new QTreeWidgetItem(pqRoot);
pqComboBox = new QComboBox();
m_pqTree->setItemWidget(pqItem ,1,pqComboBox);
connect(pqComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(setMode(int)));
...
To copy to clipboard, switch view to plain text mode
void myClass::setMode(int)
{
//Here I want to get the QTreeWidgetItem*. I have tested QObject::sender()->parent(), but I don't really know if it is its parent.
}
void myClass::setMode(int)
{
//Here I want to get the QTreeWidgetItem*. I have tested QObject::sender()->parent(), but I don't really know if it is its parent.
}
To copy to clipboard, switch view to plain text mode
The problem is that when I click on the QComboBox, the QTreeWidgetItem* is not selected and I don't want to force first click the item an then let change the combo.
Thanks,
Bookmarks