
Originally Posted by
Lesiok
connect(QlineEdit_1,
SIGNAL(textChanged
(const QString &),QlineEdit_2,
SLOT(setText
(const QString &)));
connect(QlineEdit_1,SIGNAL(textChanged(const QString &),QlineEdit_2,SLOT(setText(const QString &)));
To copy to clipboard, switch view to plain text mode
Lesiok thank you for replying , please bear with me as am a newbie in Qt and have read many tutorials but still
can u please check my coding as it gives an error, i have a mainwindow with push button (to go to the secdialog window) and QlineEdit named nodes1. A secDialog with QlineEdit named carry_nodes
mainwindow.h
#
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
~MainWindow();
private slots:
void on_pushButton_next_pressed();
signals:
void on_nodes1_textchanged
(const QString &);
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_pushButton_next_pressed();
signals:
void on_nodes1_textchanged(const QString &);
To copy to clipboard, switch view to plain text mode
#
secDialog.h
#
class secDialog;
}
{
Q_OBJECT
public:
explicit secDialog
(QWidget *parent
= 0);
~secDialog();
public slots:
void on_carry_nodes_setText
(const QString &);
}
class secDialog : public QDialog
{
Q_OBJECT
public:
explicit secDialog(QWidget *parent = 0);
~secDialog();
public slots:
void on_carry_nodes_setText(const QString &);
}
To copy to clipboard, switch view to plain text mode
#
mainwindow.cpp
#
MainWindow::~MainWindow()
{
delete ui;
connect (on_nodes1_textchanged,
(SIGNAL(textChanged
(const QString &)),
on_carry_nodes_setText,
SLOT(setText
(const QString &))));
// here where i get an error as on_carry_nodes_setText //was not declared on this scope
void MainWindow::on_pushButton_next_pressed()
{
secDialog secdialog;
secdialog.setModal(true);
secdialog.exec();
emit this->on_nodes1_textchanged(ui->nodes1->text());
}
MainWindow::~MainWindow()
{
delete ui;
connect (on_nodes1_textchanged,(SIGNAL(textChanged(const QString &)),
on_carry_nodes_setText,SLOT(setText(const QString &)))); // here where i get an error as on_carry_nodes_setText
//was not declared on this scope
void MainWindow::on_pushButton_next_pressed()
{
secDialog secdialog;
secdialog.setModal(true);
secdialog.exec();
emit this->on_nodes1_textchanged(ui->nodes1->text());
}
To copy to clipboard, switch view to plain text mode
#
Bookmarks