Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch treeitem clicked event #27

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions parserdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
ParserDialog::ParserDialog(QHexEdit *hexEdit, QWidget *parent) :
QDialog(parent),
_ui(new Ui::Dialog),
_addedPmts(false)
_addedPmts(false),
_hexEdit(hexEdit)
{
_ui->setupUi(this);
init();
_hexEdit = hexEdit;
}

ParserDialog::~ParserDialog()
Expand All @@ -40,15 +40,26 @@ void ParserDialog::on_parseButton_clicked()
parseTransportStream();
}

void ParserDialog::on_threeItem_clicked(QTreeWidgetItem *item, int ind)
{
qDebug() << "on_threeitem_clicked...";
qDebug() << item->text(ind) << ind;
QString strPid = item->text(1); // Column 1 is PID
// TODO make sure parent is PIDs
int pid = strPid.toInt();
qDebug() << "PID: " << pid;
}

/*****************************************************************************/
/* Private Methods */
/*****************************************************************************/
void ParserDialog::init()
{
_treeWidget = _ui->treeWidget;
connect(_treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this,
SLOT(on_threeItem_clicked(QTreeWidgetItem*,int)));
}


void ParserDialog::parseData()
{
qDebug() << "(C) Copyright 2018 All rights reserverd Quantux AB.";
Expand Down
1 change: 1 addition & 0 deletions parserdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ParserDialog : public QDialog

private slots:
void on_parseButton_clicked();
void on_threeItem_clicked(QTreeWidgetItem* item, int ind);

private:
void init();
Expand Down