Hi
i am bulding an application that needs to put image thumbnails in QHBoxLayout
i creant new widget and put image on it and add it to layout
this is OK

the Q? is i need to remove this widget from lay out in run time ..HOW?
i used
Qt Code:
  1. Layout->removeItem()
To copy to clipboard, switch view to plain text mode 
but it dosent work

this is my code snippist to add layout RUN OK

Qt Code:
  1. m_thumbnailsWidgetHLayout = new QHBoxLayout(ui.thumbnailsScrollAreaWidgetContents);
  2.  
  3. ThumbnailWidget* thumb = new ThumbnailWidget;
  4. QPixmap scaled = pixmap.scaled(ThumbnailWidget::THUMBNAIL_SIZE,
  5. ThumbnailWidget::THUMBNAIL_SIZE,
  6. Qt::KeepAspectRatioByExpanding,
  7. Qt::FastTransformation);
  8. thumb->setPixmap(scaled);
  9. thumb->setThumbnailIndex(key);
  10. m_thumbnailsWidgetHLayout->addWidget(thumb);
To copy to clipboard, switch view to plain text mode 

and this is the code of removing widgets NOT RUN OK
Qt Code:
  1. for (int i = 0; i < m_thumbnailsWidgetHLayout->count(); i++) {
  2. m_thumbnailsWidgetHLayout->removeItem(m_thumbnailsWidgetHLayout->itemAt(i));
  3. }
To copy to clipboard, switch view to plain text mode 

thanks