//creates a child of a root
{
if (index != 0)
after = childAt(parent, index - 1);
if (parent)
else
item->setText(0, text);
return item;
}
//finds the child at particular index
{
if (parent)
return parent->child(index);
else
return topLevelItem(index);
}
//tree 1 created
{
root->setText(0,"EBEAM GALLERY");
for(int i=0;i<1;i++)
{
createItem("Art & Design",root,0);
createItem("Classroom Tools",root,1);
createItem("Dynamic Content",root,2);
createItem("Geography",root,3);
createItem("Health",root,4);
createItem("History & Social Studies",root,5);
createItem("Literature & Language Arts",root,6);
createItem("Mathematics",root,7);
createItem("Music & Theatre",root,8);
createItem("Recreation & Games",root,9);
createItem("Science",root,10);
createItem("Backgrounds",root,11);
createItem("Tips & Tricks",root,12);
}
return root;
}
//tree 2
{
root1->setText(0,"MY GALLERY");
for(int i =0;i<1;i++)
{
createItem("My Gallery",root1,0);
}
return root1;
}
//tree3
{
root2->setText(0,"RESOURCES");
for(int i=0;i<1;i++)
{
child = createItem("eBeam Web Resources",root2,0);
}
root2->setFlags(Qt::ItemIsSelectable);
return child;
}
//creates a child of a root
QTreeWidgetItem* SettingsTree::createItem(const QString &text, QTreeWidgetItem *parent, int index)
{
QTreeWidgetItem *after = 0;
if (index != 0)
after = childAt(parent, index - 1);
if (parent)
item = new QTreeWidgetItem(parent, after);
else
item = new QTreeWidgetItem(this, after);
item->setText(0, text);
return item;
}
//finds the child at particular index
QTreeWidgetItem *SettingsTree::childAt(QTreeWidgetItem *parent, int index)
{
if (parent)
return parent->child(index);
else
return topLevelItem(index);
}
//tree 1 created
QTreeWidgetItem* SettingsTree::eBeamTREE()
{
root->setText(0,"EBEAM GALLERY");
for(int i=0;i<1;i++)
{
createItem("Art & Design",root,0);
createItem("Classroom Tools",root,1);
createItem("Dynamic Content",root,2);
createItem("Geography",root,3);
createItem("Health",root,4);
createItem("History & Social Studies",root,5);
createItem("Literature & Language Arts",root,6);
createItem("Mathematics",root,7);
createItem("Music & Theatre",root,8);
createItem("Recreation & Games",root,9);
createItem("Science",root,10);
createItem("Backgrounds",root,11);
createItem("Tips & Tricks",root,12);
}
return root;
}
//tree 2
QTreeWidgetItem* SettingsTree::eBeamMYGALLERY()
{
root1->setText(0,"MY GALLERY");
for(int i =0;i<1;i++)
{
createItem("My Gallery",root1,0);
}
return root1;
}
//tree3
QTreeWidgetItem* SettingsTree::eBeamRESOURCETREE()
{
QTreeWidgetItem* child;
root2->setText(0,"RESOURCES");
for(int i=0;i<1;i++)
{
child = createItem("eBeam Web Resources",root2,0);
}
root2->setFlags(Qt::ItemIsSelectable);
return child;
}
To copy to clipboard, switch view to plain text mode
Bookmarks