Pls preview the code
void FileSystem
:: ShowTreeWidgetFolderItem( QTreeWidgetItem *item,
int col
) // Function call -> itemdoubleClicked {
bool ok;
if(!bStopFlag)
{
QList<QTreeWidgetItem*>m_list;
m_list = FolderTree->selectedItems();
m_id = m_list[0]->text(1).toInt(&ok,10);
emit ShowFolders(); //emit Signal to show the contents of the item that is double clicked
}
}
void FileSystem :: ShowFolderItem() // function to show the contents of the item that is double clicked
{
TREEITEM *treeitem;
for (int item = 0; item < FolderTree->topLevelItemCount(); ++item)
{
qDeleteAll(FolderTree->topLevelItem(item)->takeChildren());
}
for(unsigned int i = 0;i< list.count();i++)
{
treeitem = list[i];
if(treeitem->MyTreeEntry.dwParentId == m_id)
{
RightTreeItem->setText(0,treeitem->bFileName);
RightTreeItem->setCheckState(0,Qt::Unchecked);
RightTreeItem->setText(0,treeitem->bFileName);
RightTreeItem
->setText
(1,
QString::number(treeitem
->MyTreeEntry.
dwFileId));
RightTreeItem
->setText
(2,
QString::number(treeitem
->MyTreeEntry.
dwParentId));
if(treeitem->MyTreeEntry.bAttribute == 0x10)
RightTreeItem->setText(3,">");
RightTreeItem->setCheckState(0,Qt::Unchecked);
FolderTree->resizeColumnToContents (0);
FolderTree->resizeColumnToContents (1);
FolderTree->resizeColumnToContents (2);
}
}
}
void FileSystem :: ShowTreeWidgetFolderItem( QTreeWidgetItem *item, int col) // Function call -> itemdoubleClicked
{
bool ok;
if(!bStopFlag)
{
QList<QTreeWidgetItem*>m_list;
m_list = FolderTree->selectedItems();
m_id = m_list[0]->text(1).toInt(&ok,10);
emit ShowFolders(); //emit Signal to show the contents of the item that is double clicked
}
}
void FileSystem :: ShowFolderItem() // function to show the contents of the item that is double clicked
{
TREEITEM *treeitem;
for (int item = 0; item < FolderTree->topLevelItemCount(); ++item)
{
qDeleteAll(FolderTree->topLevelItem(item)->takeChildren());
}
for(unsigned int i = 0;i< list.count();i++)
{
treeitem = list[i];
if(treeitem->MyTreeEntry.dwParentId == m_id)
{
QTreeWidgetItem *RightTreeItem = new QTreeWidgetItem(FolderTree);
RightTreeItem->setText(0,treeitem->bFileName);
RightTreeItem->setCheckState(0,Qt::Unchecked);
RightTreeItem->setText(0,treeitem->bFileName);
RightTreeItem->setText(1,QString::number(treeitem->MyTreeEntry.dwFileId));
RightTreeItem->setText(2,QString::number(treeitem->MyTreeEntry.dwParentId));
if(treeitem->MyTreeEntry.bAttribute == 0x10)
RightTreeItem->setText(3,">");
RightTreeItem->setCheckState(0,Qt::Unchecked);
FolderTree->resizeColumnToContents (0);
FolderTree->resizeColumnToContents (1);
FolderTree->resizeColumnToContents (2);
}
}
}
To copy to clipboard, switch view to plain text mode
Thanx
Bookmarks