Hi, I'm really new to QT and c++ and was doing something with QTcreator I designed a ui, and I tried to put some functionality in it by modifiyng the cpp from the ui.
#include "cliente.h"
#include "ui_cliente.h"
#include "QDialogButtonBox"
{
ui->setupUi(this);
QString text
= ui
->direccionLE
->text
();
connect(ui->conectarB, SIGNAL(clicked()),this, SLOT(accion()));
}
void accion(){
//
QString text
= ui
->direccionLE
->text
();
}
Cliente::~Cliente()
{
delete ui;
}
#include "cliente.h"
#include "ui_cliente.h"
#include "QDialogButtonBox"
Cliente::Cliente(QWidget *parent)
: QMainWindow(parent), ui(new Ui::ClienteClass)
{
ui->setupUi(this);
QString text = ui->direccionLE->text();
connect(ui->conectarB, SIGNAL(clicked()),this, SLOT(accion()));
}
void accion(){
//
QString text = ui->direccionLE->text();
}
Cliente::~Cliente()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
The problem is that I can't acces say (QString text = ui->direccionLE->text();) in the function accion because ui is not declared in that scope, I know this might be a really stupid question, bur how do I acces widgets from the ui in a function (lineedits, comboboxes, ...)
Thanks for your patience
Bookmarks