I've got Qt application in VS2012 plugin. As a result (of below code) a new window is created each time when my_slot_to_execute() function checks it's internal if condition. In Qt Designer I've got QTextEdit widget, where I would like see those results ( not each time in new window).
Could someone please help me how should I proceed ( or set access to this QTextEdit widget) from my_slot_to_execute() function to see each time results (which will be each time incremented) only in one window?
ProgramExample::ProgramExample(QWidget *parent): QMainWindow(parent) // constructor
{
ui.setupUi(this);
// here are other part of working code
}
//and then
void ProgramExample::on_listView_clicked(const QModelIndex &index)
{
// here are other part of working code
my_slot_to_execute();
}
my_slot_to_execute()
{
smatch matches;
regex pattern("key(\\d{3}\\w{1})");
string text;
if ((some condition))
{
QTextEdit *textEdit = new QTextEdit;
QString outputString1 = QString::fromStdString(matches[1]);
textEdit->setText(QString("%1:").arg(outputString1));
textEdit->show();
}
}
Thanks in advance!