hi, i am having some issues, by reading values from tableWidget.
GuiApp.h
//..
private:
Ui::GuiAppClass ui;
private slots:
void getTableItemSelected(int,int);
//..
private:
Ui::GuiAppClass ui;
private slots:
void getTableItemSelected(int,int);
To copy to clipboard, switch view to plain text mode
GuiApp.cpp
GuiApp
::GuiApp(QWidget *parent, Qt
::WFlags flags
){
//..
ui.setupUi(this);
connect(ui.tableWidget, SIGNAL(cellClicked(int,int)),
this, SLOT (getTableItemSelected(int,int)));
}
//..
void GuiApp::getTableItemSelected(int row, int col)
{
qDebug("Row %i Col %i Value: %s", row, col, text);
}
GuiApp::GuiApp(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
//..
ui.setupUi(this);
connect(ui.tableWidget, SIGNAL(cellClicked(int,int)),
this, SLOT (getTableItemSelected(int,int)));
}
//..
void GuiApp::getTableItemSelected(int row, int col)
{
QTableWidgetItem *locale = ui.tableWidget->item(row, col);
QString text = locale->text();
qDebug("Row %i Col %i Value: %s", row, col, text);
}
To copy to clipboard, switch view to plain text mode
The table "prints" the values like 3 23 45. But i read this symbols..
Output:
Row 0 Col 0 Value: ♦
Row 0 Col 1 Value: ♥
Row 0 Col 2 Value: ♦
What's the problem?
Thanks in advance.
Bookmarks