title: Update/modify QListWidgetItem
body: <p>I would like to use <code>QWidgetList</code> to create a list where I can add and delete items automatically, without the user having to interact with the graphical interface. I have this done, but I can't update/modify the text I put in the item when I created it. I have created four items like this:</p>
  
  <pre><code>for (int i = 0; i &lt; 4; i++)
  {
    QListWidgetItem *lwi = new QListWidgetItem();
    lwi-&gt;setSizeHint(QSize(200, 20));
    lwi-&gt;setTextAlignment(Qt::AlignCenter);
    lwi-&gt;setText(QString("Obstacle ") + QString::number(i));
    ui_.list-&gt;addItem(lwi);
  }
  </code></pre>
  
  <p>And I have seen that I can modify the text like this:</p>
  
  <pre><code>ui_.list-&gt;item(0)-&gt;setText(QString::number(updateItem, 'f', 2));
  </code></pre>
  
  <p>Where <code>updateitem</code> is constantly changing its value.</p>
  
  <p>The problem is that it seems that although the text is modified, but it is updated on screen only when I interact with the window. </p>
  
  <p>Is there any way to update it directly without having to interact? For example, if I do the same with a Label it works correctly and the Label changes its text constantly without the need to interact with it. </p>
  
  <p>I am working with the rqt library for ROS, to develop a plugin created with Qt. Although I believe my problem is directly related to Qt and not to ROS. </p>
  
  <p>Thank you.</p>
  
  <p>EDIT1: I added <code>ui_.list_movil-&gt;update()</code> but is not working for me. </p>
  
  <pre><code>void MyPlugin::update_list()
  {
    if (flagFirstItem == false)
    {
      for (int i = 0; i &lt; 4; i++)
      {
        QListWidgetItem *lwi = new QListWidgetItem();
        lwi-&gt;setSizeHint(QSize(200, 20));
        lwi-&gt;setTextAlignment(Qt::AlignCenter);
        lwi-&gt;setText(QString("Obstacle ") + QString::number(i));
        ui_.list_movil-&gt;addItem(lwi);
      }
      flagFirstItem = true;
    }
    if (flagFirstItem == true)
    {
      for (int i = 0; i &lt; ui_.list_movil-&gt;count(); ++i)
      {
        ui_.list_movil-&gt;item(i)-&gt;setText(QString::number(updateItem, 'f', 2));
        ui_.list_movil-&gt;update();
      }
    }
  }
  </code></pre>
  
  <p>I am adding four items just one time and after that I am trying to modify them. It is not working fine for me because I must click on an item to see the changed text. If I am doing it right, maybe it should be an error with <a href="http://wiki.ros.org/rqt/Tutorials/Create%20your%20new%20rqt%20plugin" rel="nofollow noreferrer">rqt library</a>. </p>
  
  <p>By the way, I am modifying labels like that: </p>
  
  <pre><code>void MyPlugin::imuEuler_callback(const sensor_msgs::Imu msg)
  {
    if ((ros::Time::now().toSec() - updateTimeImuEuler) &gt;= updateTime)
    {
      ui_.label_rollValue-&gt;setText(QString::number(msg.orientation.x, 'f', 2));
      ui_.label_pitchValue-&gt;setText(QString::number(msg.orientation.y, 'f', 2));
      ui_.label_yawValue-&gt;setText(QString::number(msg.orientation.z, 'f', 2));
      updateTimeImuEuler = ros::Time::now().toSec();
    }
  }
  </code></pre>
  
  <p>And they are all working fine, I dont need to click on them to see the changed text. </p>