JeremyRussell
6th April 2011, 21:02
Hi I'm new here, used to program a lot (visual basic) and decided to jump into QT on my return to programming.
Now here's my problem. I'm pretty sure I followed all the steps correctly but upon compiling(which it does) and then running. I click my button and... nothing. No list getting filled and no crashing either, not sure were I went wrong but any help would be great.
#include "primary.h"
#include "ui_primary.h"
Primary::Primary(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Primary)
{
ui->setupUi(this);
}
QString newName;
QString newNumber;
QString details;
void Primary::on_addBtn_click()
{
newName = ui->nameText->text();
newNumber = ui->numberText->text();
details = ui->details->toPlainText();
ui->list->addItem(new QListWidgetItem(QString("%1 %2").arg(newName).arg(newNumber)));
}
Primary::~Primary()
{
delete ui;
}
If anyone has any ideas I'd be much obliged. It's probably just something dumb I'm missing but I don't know.
Now here's my problem. I'm pretty sure I followed all the steps correctly but upon compiling(which it does) and then running. I click my button and... nothing. No list getting filled and no crashing either, not sure were I went wrong but any help would be great.
#include "primary.h"
#include "ui_primary.h"
Primary::Primary(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Primary)
{
ui->setupUi(this);
}
QString newName;
QString newNumber;
QString details;
void Primary::on_addBtn_click()
{
newName = ui->nameText->text();
newNumber = ui->numberText->text();
details = ui->details->toPlainText();
ui->list->addItem(new QListWidgetItem(QString("%1 %2").arg(newName).arg(newNumber)));
}
Primary::~Primary()
{
delete ui;
}
If anyone has any ideas I'd be much obliged. It's probably just something dumb I'm missing but I don't know.