Any code example.please.
Any code example.please.
Ok, then you posted in the wrong forum. Moved to newbie.
What have you tried so far? have you red the methods I mentioned? Read the documentation about signal and slots. There is no use if I post code because you have to learn it (also how to learn things right out of the docs.)
I think it is returning a valid pointer. And yes I'm using Q_OBJECT macro.
Did you get any warnings on the console when starting the program?
I'm pretty sure that the
Qt Code:
connect(view->selectionModel(),SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),this,SLOT(querydb()));To copy to clipboard, switch view to plain text mode
will not work since your signal and your slot don't have the same parameters type. When you connect, you have to connect a signal to a slot with exactly the same parameters.
Hope this helps.
I think the function must have QIndex in the header:
this works for me
connect(fileView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectFiles(QModelIndex)));
void nutshellqt::selectFiles(const QModelIndex& index)
{
}
make sure the function is in the header file under public slots
public slots:
void selectFiles(const QModelIndex& index);
Bookmarks