PDA

View Full Version : Creating Login page



yuvaraj.yadav
10th April 2009, 08:50
Hi

I am new to Qt ..

I am creating Login page ...

If click submit button , it has go to another window or Widget...


So please suggest me ,How do set the submit button according to go to next page....


Thanks

Yuvaraj R

vasanth
10th April 2009, 14:49
hello,

use the signal and slots to connect to the subwindow or a widget

this in your login window

e.g
connect( your_submit_button, SIGNAL(clicked()), this, SLOT(you_sub_window_slot())) )

lyuts
13th April 2009, 11:37
Here is one of such solutions:

1. QDialog has accept() and reject() methods
2. On your LoginDialog you input your credentials and press a button (let it be submitButton) and it emits a SIGNAL called clicked().
3. Create a slot: submitButtonClicked(). Connect a signal clicked() to a slot submitButtonClicked()
4. Inside your slot do your validations for received credentials and if everthing is ok call accept() method, otherwise - reject().

And using it will look like this


YourLoginDialog loginDialog;
if ( QDialog::Accepted == logindDialog.exec() ) {
// access granted, do you work
} else {
// sorry access denied
}