Need right way to recieve item index when changed to another item
need use currentRowChanged ? How?
i have
Code:
{ uint i = 1; QStringList filters; filters << "*.jpg" << "*.png" << "*.bmp"; dir.setNameFilters(filters); { i++; } }
Printable View
Need right way to recieve item index when changed to another item
need use currentRowChanged ? How?
i have
Code:
{ uint i = 1; QStringList filters; filters << "*.jpg" << "*.png" << "*.bmp"; dir.setNameFilters(filters); { i++; } }
Could you reword the question?
From where you want to send item (emit signal) view/model/item?
To where you want to receive item index (slotl) view/model/item?
when activate item in listWidget (via mouse click, or keyboard) emit signal with item index.
i do
Code:
{ uint i = 1; QStringList filters; filters << "*.jpg" << "*.png" << "*.bmp"; dir.setNameFilters(filters); { i++; } connect(ui->listWidget, SIGNAL(currentRowChanged(int)), &m_imageviewer, SLOT(picindex(int))); //error }
recieve error : no matching function for call to 'ComicView::connect(QListWidget*&, const char*, ImageViewer*, const char*)'
????
try:i'm not sure that will help, you have some modifications (at least ComicView from error and View:: in code) after you got the error you told us, so if that won't help post the updated code and error message.Code:
QObject::connect(ui->listWidget, SIGNAL(currentRowChanged(int)), &m_imageviewer, SLOT(picindex(int)));
Also are you sure that you want to connect when unzipdone (instead of for example in the ComicView constructor)?
And make sure that m_imageviewer stays alive as long as you need it to receive the changes to selection.
Found error
m_imageviewer isn`t inherited from QObject
thx