Porównajmy:
wafcio napisał(a)
Object::connect: No such signal QListView::clicked(QListViewItem *, const QPoint &, int) in dialogRank.cpp:71
Object::connect: (sender name: 'userAddImageListView')
Trolltech napisał(a)
void QAbstractItemView::clicked ( const QModelIndex & index ) [signal]
This signal is emitted when a mouse button is clicked. The item the mouse was clicked on is specified by index. The signal is only emitted when the index is valid.
Ktoś tu naprawdę ma oczopląs i nie widzi tej oczywistej różnicy.
Mam już tego tematu naprawdę dość (jakby kopać się z koniem):
void twojaKlasa::init()
{
QListView *itemView = new QListView(this);
Q_ASSERT(
QObject::connect( itemView, SIGNAL(clicked(const QModelIndex &)),
this, SLOT(itemClicked(const QModelIndex &)))
);
}
/* to ma być slot */
void twojaKlasa::itemClicked(const QModelIndex & itemIndex)
{
int y = itemIndex.row();
int x = itemIndex.column();
....
}
nagłówek
class twojaKlasa : public QWIdget /* alo coś innego */
{
Q_OBJECT // jesteś pewien że tego nie zapomniałeś?
// to jest najczęstszy błąd początkujących w Qt
private:
void init();
protected slots:
void itemClicked(const QModelIndex & itemIndex);
private:
QListView *itemView;
};