Hi d_stranz thank you for your time.
I did this but not work. I have an Error.
Like you said me, in my class connectDialog I add the line signals: at end.:
connectDialog.h
public:
void login();
signals:
userValidated();
public:
void login();
signals:
userValidated();
To copy to clipboard, switch view to plain text mode
then, in file cpp is this:
connectDialog.cpp
void connectDialog::login()
{
if (database.Users() == 0){
emit userValidated();
this.close();
}
else
ui->labelUserError->setVisible(true);
}
void connectDialog::login()
{
if (database.Users() == 0){
emit userValidated();
this.close();
}
else
ui->labelUserError->setVisible(true);
}
To copy to clipboard, switch view to plain text mode
Now in my file MainWindow.h
MainWindow.h
public slots:
void showPrivileges();
public slots:
void showPrivileges();
To copy to clipboard, switch view to plain text mode
and the cpp file is this:
MainWindow.cpp
void MainWindow::showPrivileges()
{
ui->label0->setVisible(true);
ui->label1->setEnabled(true);
}
void MainWindow::showPrivileges()
{
ui->label0->setVisible(true);
ui->label1->setEnabled(true);
}
To copy to clipboard, switch view to plain text mode
I add the coonect line in the body of constructor of MainWindow:
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(connectDialog,SIGNAL(userValidated()),this,SLOT(showPrivileges()));
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(connectDialog,SIGNAL(userValidated()),this,SLOT(showPrivileges()));
}
To copy to clipboard, switch view to plain text mode
but whe I build i get an error.. I don't fix that.
Thank you again..
Bookmarks