Results 1 to 18 of 18

Thread: Login Screen GUI

  1. #1
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Login Screen GUI

    Hi all,

    I need to develop a GUI in qt with user & password Edit.

    When user enters the user name & password, i need to verify it through "getty Process" and then give access to the main screen or the login screen remains same.

    Any idea on QT how to do it ?

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Login Screen GUI

    what is the problem? what did you already tried? Its very simple form.

  3. #3
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Re: Login Screen GUI

    Quote Originally Posted by MrDeath View Post
    what is the problem? what did you already tried? Its very simple form.
    Hi ,

    i can able to create a form with User & password Edit in QT-Designer. No problem.

    Now when the user enters the user name i need to verify the username with the "getty process of linux" and check whether the user name is right . Same case for password too.

    Now how do i connect & check the user name entered in GUI to the getty command prompt process of linux ? This is the problem.

    Another way : I need the same as Linux Login screen and process but using QT .

  4. #4
    Join Date
    Dec 2007
    Posts
    627
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Login Screen GUI

    To check the user credentials, you can send unix commands from your login page.
    For that you can use :
    QDesktopServices
    QProcess

  5. The following user says thank you to yogeshgokul for this useful post:

    augusbas (16th July 2009)

  6. #5
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Login Screen GUI

    connect the clicked() signal of the OK(or login) button on the form to some slot and then take the lineedit values in a string...
    Qt Code:
    1. void on_ok_clicked()
    2. {
    3. QString user=this->lineEditUser->text();
    4. QString pass=this->lineEditPass->text();
    5.  
    6. QProcess:;execute("whatever command for username","arguments");
    7. //dont use execute.. but read the std out of the command ... i dont know the linux cmd.
    8. // check ur user and pass.
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

    hope i have not misunderstood ur problem.. coz its just too simple..

  7. The following user says thank you to nish for this useful post:

    augusbas (16th July 2009)

  8. #6
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Smile Re: Login Screen GUI

    Quote Originally Posted by MrDeath View Post
    connect the clicked() signal of the OK(or login) button on the form to some slot and then take the lineedit values in a string...
    Qt Code:
    1. void on_ok_clicked()
    2. {
    3. QString user=this->lineEditUser->text();
    4. QString pass=this->lineEditPass->text();
    5.  
    6. QProcess:;execute("whatever command for username","arguments");
    7. //dont use execute.. but read the std out of the command ... i dont know the linux cmd.
    8. // check ur user and pass.
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

    hope i have not misunderstood ur problem.. coz its just too simple..

    Hi ,

    Thanks to Yogesh and Death,

    Let me try "Login" process to do the job.

    I will get back to you soon

  9. #7
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Re: Login Screen GUI

    Quote Originally Posted by MrDeath View Post
    connect the clicked() signal of the OK(or login) button on the form to some slot and then take the lineedit values in a string...
    Qt Code:
    1. void on_ok_clicked()
    2. {
    3. QString user=this->lineEditUser->text();
    4. QString pass=this->lineEditPass->text();
    5.  
    6. QProcess:;execute("whatever command for username","arguments");
    7. //dont use execute.. but read the std out of the command ... i dont know the linux cmd.
    8. // check ur user and pass.
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

    hope i have not misunderstood ur problem.. coz its just too simple..

    Hi,

    I have a utility called "Login" and i can call this as a process. For example i can call as

    ./login root //passing username as argument.

    The command immediately asks "password: " Now how do i pass my password text to this argument. Through stdin? . I have read that for password it doesnt take input through stdin . It directly reads from the terminal device. How do i send data to password. Please help

  10. #8
    Join Date
    Dec 2007
    Posts
    627
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Login Screen GUI

    Quote Originally Posted by MrDeath View Post
    hope i have not misunderstood ur problem.. coz its just too simple..
    If you are wanna login on shell using your GUI, then its not easy, I believe. Because the getty processes, takes only username as argument. After they check the username and asks for password using their own screen for higher security reasons.


    Quote Originally Posted by augusbas View Post
    I have a utility called "Login".
    Please refer the docs/manuals of the utility. How to pass username, password as args.

  11. #9
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Re: Login Screen GUI

    Quote Originally Posted by yogeshgokul View Post
    If you are wanna login on shell using your GUI, then its not easy, I believe. Because the getty processes, takes only username as argument. After they check the username and asks for password using their own screen for higher security reasons.



    Please refer the docs/manuals of the utility. How to pass username, password as args.

    Hi,

    i got a error :

    In my program i am trying to call

    QProcess *myProcess = new QProcess(this);
    myProcess->execute("/EXEC/login",arguments);

    QByteArray data = myProcess->readStdout();

    error: ‘class QProcess’ has no member named ‘readStdout’

    How to solve this error

  12. #10
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Login Screen GUI

    there are only such method in docs QProcess::readAllStandardOutput & QProcess::readAllStandardError.
    btw, it would be better if you use QProcess::readyReadStandardOutput signal and then call QProcess::readAllStandardOutput in your slot.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  13. The following user says thank you to spirit for this useful post:

    augusbas (16th July 2009)

  14. #11
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Login Screen GUI

    A better way is to connect to the "void finished ( int exitCode, QProcess::ExitStatus exitStatus )" signal and start the process with "startDetached()".
    Because if you wait for the return your application may be freeze.

    Best Regards

  15. The following user says thank you to NoRulez for this useful post:

    augusbas (16th July 2009)

  16. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Login Screen GUI

    If you're on Linux then the proper way would be to use pam instead of trying to interface with login.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #13
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Re: Login Screen GUI

    Hi,

    i have created a test program to check whether i can read the standard output data from the command line utility. So i have called "man" utility as a process. The utilty when executes it prints "What manual page do you want?" I am trying to read this data through readyRead Signal. But i couldnt able to get the output through GUI .Instead its printing the output in the terminal where i am executing the program. How do i solve this problem?

    Below is my program.

    Qt Code:
    1. connect(pushButton_2, SIGNAL(clicked()), this, SLOT(login_call()) );
    2. connect(myProcess , SIGNAL(readyReadStandardOutput()),this, SLOT(readFromStdout()) );
    3.  
    4. void GoToCellDialog::login_call()
    5. {
    6. myProcess->execute("/usr/bin/man");
    7. textEdit->setText(myProcess->readAll());
    8. }
    9.  
    10. void GoToCellDialog::readFromStdout()
    11. {
    12. printf("Inside Signal StdOut");
    13. textEdit->append(myProcess->readAllStandardOutput());
    14. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 17th July 2009 at 07:43. Reason: missing [code] tags

  18. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Login Screen GUI

    Try the standard error output.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  19. #15
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Re: Login Screen GUI

    Quote Originally Posted by wysota View Post
    Try the standard error output.
    Hi,

    I will try this Standard Output..

    Sorry for not using code tags...I will follow the forum rules hereafter

  20. #16
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Re: Login Screen GUI

    Quote Originally Posted by wysota View Post
    Try the standard error output.

    Hi ,

    I tried using Standard Error Output.

    readyReadStandardError () Signal and readAllStandardError() .

    But still the output is printing on the terminal where i am executing the program.

  21. #17
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Login Screen GUI

    take a look at the source code of cuteBuilder... what it does is run the configure.exe (which askes questions) and make a gui frontend to it..
    just take a look at its source code to apply the functionality in your program

  22. #18
    Join Date
    Sep 2009
    Posts
    39
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Login Screen GUI

    Hi Mr Death, i saw your all postings. I need to get clarified with my one of problem. Which i have created new Thread in the name of Shell command by Qt 4.5.2. plz go thru it and assist me its urgent for me...

Similar Threads

  1. Creating a Screen Saver for Windows
    By spud in forum Qt Programming
    Replies: 1
    Last Post: 2nd November 2011, 15:58
  2. Suggestions on Login Prompt
    By fnmblot in forum Qt Programming
    Replies: 9
    Last Post: 22nd May 2009, 19:54
  3. Using QGraphicsView as a Splash Screen (repaint issues)
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2008, 21:22
  4. Setting manually cursor position on multi screen systems
    By irreriwan in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2008, 09:47
  5. multi screen
    By Thomas Feldman in forum Qt Programming
    Replies: 5
    Last Post: 9th May 2007, 16:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.