I am trying this on mini2440. I want to create a label dynamically in a program using code (without creating a form) and refresh label's text dynamically (number of labels and text is going to be dynamically decided in the program, so can't use form). Is there a way to do that? Currently I am doing it following way (skipped some details in the program): //create label Qlabel *label = new Qlabel(); label->setText("message1"); // set font etc of the label here // show label label->show(); for(;;) { //Do some activity label->setText("message2"); // display some message label->repaint(); label->update(); } It doesn't seem to be working. The label seems to be showing only the very last message and not the intermediate ones. Can someone please suggest me a proper way to do it? Thanks in advance!
Qt refreshing label on mini2440
This is not the forum for this type of question (general programming), you should try www.stackoverflow.com With that said, you are not giving the new label a parent, so it doesn't know where to draw itself. Qlabel *label = new Qlabel(my_parent_widget_where_i_want_it_drawn); - vk