WezSieTato
30th December 2013, 11:59
Hi,
I made class inherit from QListWidget and overrride resizeEvent:
void ImageList::resizeEvent(QResizeEvent *event)
{
QListWidget::resizeEvent(event);
int width = event->size().width() / columnNumber - 10;
setIconSize(QSize(width, width));
setGridSize(iconSize());
}
But sometimes when I resize the widget by splitter, the application crash with this message:
QPainter::begin: Paint device returned engine == 0, type: 2
What is the proper way to change iconSize and gridSize when user resize widget? I try to use BlockingQueuedConnection and emit signal to yourself, but this make dead lock.
I made class inherit from QListWidget and overrride resizeEvent:
void ImageList::resizeEvent(QResizeEvent *event)
{
QListWidget::resizeEvent(event);
int width = event->size().width() / columnNumber - 10;
setIconSize(QSize(width, width));
setGridSize(iconSize());
}
But sometimes when I resize the widget by splitter, the application crash with this message:
QPainter::begin: Paint device returned engine == 0, type: 2
What is the proper way to change iconSize and gridSize when user resize widget? I try to use BlockingQueuedConnection and emit signal to yourself, but this make dead lock.