Hi,
Can i have array of QLabel?
if it possible means pls give me the syntax to that one
Bye
Hi,
Can i have array of QLabel?
if it possible means pls give me the syntax to that one
Bye
You can have an array of pointers to QLabel.
kavinsiva (14th August 2009)
Hi,
In case i have a array of QLabel ,then how do add the text within it ?
Bye..
Qt Code:
QList<QLabel *> labels; for (int i = 0; i < 10; ++i) ... for (int i = 0; i < 10; ++i) ...To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
I do with a vector like this:
Qt Code:
for (int i = 0; i < SIZE; ++i) for (int i = 0; i < SIZE; ++i) lbArr[i]->setText( tr("Label n. %1").arg(i) );To copy to clipboard, switch view to plain text mode
If you know how many Label you need and are not too I think is a better idea use a vector instead of a List.
In that case see this http://www.qtcentre.org/forum/p-qlab...ostcount3.html
Get used to QList and the other Qt classes - they are very convenient and you never will have size problems like with arrays in the post above
Bookmarks