Skip to content
Snippets Groups Projects
Commit d8cb025b authored by Carsten Fuhrmann's avatar Carsten Fuhrmann
Browse files

trying to sort

parent 0889b855
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,8 @@ ChannelListWidget::ChannelListWidget()
ChannelListWidget::~ChannelListWidget()
{
//m_parent->deleteLater();
setParent(NULL);
m_parent->deleteLater();
}
void ChannelListWidget::mousePressEvent(QMouseEvent * event)
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -16,6 +16,7 @@ struct channelInfo {
QString name;
uint64 parent;
QTreeWidgetItem* entry;
int order;
};
enum nodeType {
......@@ -232,6 +233,7 @@ void OverlayController::displayChannelList()
tmp.id = channelIDList[i];
tmp.name = channelID2Name(m_SCHID, channelIDList[i]);
ts3.getChannelVariableAsInt(m_SCHID, tmp.id, CHANNEL_ORDER, &tmp.order);
ts3.getParentChannelOfChannel(m_SCHID, channelIDList[i], &tmp.parent);
tmp.entry = new QTreeWidgetItem;
......@@ -246,6 +248,8 @@ void OverlayController::displayChannelList()
i++;
}
qSort(channelList.begin(), channelList.end(), [](const channelInfo& a, const channelInfo& b) { return a.order < b.order; });
// build tree structure
for (auto& it : channelList)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment