thanks a lot mate. it fixed my problem.
:D
Printable View
thanks a lot mate. it fixed my problem.
:D
How can i get the input from the users??
i have used this code
Code:
void Dialog::gettext() { ui->dislabel->setText(text); }
but this code pops up a dialog which i dont need.
What i want is, when i add the text in the lineedit, it should be reflected in the label, or
when i add the text in the lineedit, a variable names text has to store it.
so, you need to add QLineEdit to your form and then
this code will add a text from lineEdit to label.Code:
... ...
Code:
... connect(ui->pushButton, SIGNAL(clicked()), SLOT(getLineEditText()));//get text by clicking on a button connect(ui->lineEdit, SIGNAL(editingFinished()), SLOT(getLineEditText()));//get text by pressing enter in a lineEdit //you can also use QLineEdit::returnPressed insted of QLineEdit::editingFinished ... void MyWidget::getLineEditText() { qDebug() << ui->lineEdit->text(); }
use second variant
:)Code:
... connect(ui->pushButton, SIGNAL(clicked()), SLOT(getLineEditText()));//get text by clicking on a button connect(ui->lineEdit, SIGNAL(editingFinished()), SLOT(getLineEditText()));//get text by pressing enter in a lineEdit //you can also use QLineEdit::returnPressed insted of QLineEdit::editingFinished ... void MyWidget::getLineEditText() { ui->label->setText(myVar); }
thanks mate. you have helped me alot. :cool:
mate if i want o add a icon into the application, how can it be done?
I have seen .qrc files. I need to store the image in this particular file
The icon i am talking about is the one is that tiny icon that appears at the top left corner of an application.
read this. ;)
I think that you should take closer look into Qt Exapmples & Demos and Qt Assistant. There are a lot of exapmples and explanations to all problems you posted here, and it's quite easy find answers there.