Hi all ,
i designed a form using Qt designer and compiled it with uic to produce
ui_mainwindow.h
The other files are :
1. main.cpp
2. mainwindow.cpp
3. mainwindow.ui
4. mainwindow.h ( default files )
i've included ui_mainwindow file in header file.
In my form , among many other fields , i want to get username and password from QLineEdit .
When the user press login pushbutton , it should check the name and password manually entered in the corresponding slot invoked .
here's the slot's func:
void MainWindow::on_login_clicked()
{
user=usernameip->displayText(); // usernameip is lineedit's name
pass=passwordip->displayText(); // '' ''
if(user.compare("user")&&pass.compare("pass"))
{
//i wanted to invoke another dialog from here but i cant put even a msgbox
//'coz the program crashes bfore entering this
}
void MainWindow::on_login_clicked()
{
user=usernameip->displayText(); // usernameip is lineedit's name
pass=passwordip->displayText(); // '' ''
if(user.compare("user")&&pass.compare("pass"))
{
//i wanted to invoke another dialog from here but i cant put even a msgbox
//'coz the program crashes bfore entering this
}
To copy to clipboard, switch view to plain text mode
Both user and pass are declared as QString in header file.
If u need the code for other files , ill post it immediately .
i spent about some 3 hours without success , this is my first prog ...
Bookmarks