Welcome! Log In Create A New Profile

Advanced

assign 3

Posted by nirenu 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
assign 3
September 28, 2010 02:06PM
So i used the code below for adding a password, how would i add another inputDialog to it for the Username of add to the existing inputDialog?

QString passwd = QInputDialog::getText(0, ("Please Enter Password" ),
("Please enter a password ’ ),
QLineEdit:: Password, QString(), 0 );
avatar Re: assign 3
September 28, 2010 02:51PM
Another wild guess here: You don't want another dialog? You want a TextEdit or something like that on your existing one rather?

Otherwise you're going to have little widgets all over the place ...

That would be plusminus the same code you've got there with just another object name like "username".
avatar Re: assign 3
September 28, 2010 05:45PM
QInputDialog is supposed to be used for a single input. If you need more than one, you need to create your own input.

I suggest something along the lines of:
Language: C++ (QT)
class LoginDialog : public QDialog { Q_OBJECT public: LoginDialog(QWidget *parent = 0);   QString username() const; QString password() const;   protected slots: void okPressed();   private: void setupUi();   QString m_username; QString m_password; };
Re: assign 3
September 29, 2010 02:46PM
hi there, thanks, i didnt know a QInputDialog was for just a single entry. i will give it a shot.
Sorry, only registered users may post in this forum.

Click here to login