Error with QList
-
ok.thanks..so whether my code is correct..?
hey now my ini file is showing..the data which i input through the lineedit..but the username and password are not appending in the list..I mean the next time when i run and enter usrname and passwd..the previous username and password will be lost..
regards
gogoi -
In the next time when you run the application, first read settings from ini, and append in logins list
-
from where shall i call it?
readsettiing(); or writesettings(); and how?regards
gogoi -
these are my working functions..now please help me out..how shall i first read settings from ini and append in logins list..
@void MainWindow::readSettings()
{QSettings settings; int size = settings.beginReadArray("logins"); for (int i = 0; i <size; ++i) { settings.setArrayIndex(i); login.userName = settings.value("userName").toString(); ui->lineEdit->setText(login.userName); login.password = settings.value("password").toString(); ui->lineEdit_2->setText(login.password); logins.append(login); } settings.endArray();
}
void MainWindow::saveSettings()
{
QSettings settings;login.userName=ui->lineEdit->text(); login.password=ui->lineEdit_2->text(); logins.append(login); settings.beginWriteArray("logins"); for (int i = 0; i < logins.size(); ++i) { settings.setArrayIndex(i); settings.setValue("userName", logins.at(i).userName); settings.setValue("password", logins.at(i).password); } settings.endArray();
}
@regards
gogoi -
hey i got it..
-
Hi cicncirin r u there,
Hey Whether we can get the date in an .ini file?regards
gogoi -
Yes, sure. You can write an "variant":http://doc.qt.nokia.com/latest/qvariant.html#QVariant-23
Then, you can read variant from ini and transform to "date time":http://doc.qt.nokia.com/latest/qvariant.html#toDateTime -
ok thanks cincirin...hey one morething i like to ask u..Actually i want to open a virtual keyboard on click of a pushbutton..so how shall i do it...
regards
gogoi -
"VirtualKeyboard":http://qt-apps.org/content/show.php/VirtualKeyboard?content=107388
-
[quote author="gogoi" date="1306838572"]ok thanks cincirin...hey one morething i like to ask u..Actually i want to open a virtual keyboard on click of a pushbutton..so how shall i do it...
regards
gogoi[/quote]You've opened a "separate thread":http://developer.qt.nokia.com/forums/viewthread/6371/ for this, so I'm closing this one.