This is very basic C++ stupid question.
Can somebody explain to me what I am doing wrong and / or correct my syntax so it will compile?
QObject::connect(ui
->list,
//object &QListWidget::itemClicked(&item), //signal
ui->list_2, ///object
&QListWidget::addItem(&item)); //slot
// Edit
// After looking at some examples I have changed my code
// <pre lang="c++">
ui->list_2,
);
QObject::connect(ui->list, //object
&QListWidget::itemClicked(&item), //signal
ui->list_2, ///object
&QListWidget::addItem(&item)); //slot
// Edit
// After looking at some examples I have changed my code
// <pre lang="c++">
QObject ::connect(ui->list,
QListWidget.itemClicked(item),
ui->list_2,
QListWidget.addItem(item)
);
To copy to clipboard, switch view to plain text mode
Fist "style " gives this error
/media/f/QT/Qt/QT/qtconnectivity/examples/bluetooth/CAT_BT_18112020/device.cpp:141: error: cannot call member function 'void QListWidget::itemClicked(QListWidgetItem*)' without object
&QListWidget::itemClicked(&item), //signal
^
/media/f/QT/Qt/QT/qtconnectivity/examples/bluetooth/CAT_BT_18112020/device.cpp:141: error: cannot call member function 'void QListWidget::itemClicked(QListWidgetItem*)' without object
&QListWidget::itemClicked(&item), //signal
^
To copy to clipboard, switch view to plain text mode
Then I get this one
/media/f/QT/Qt/QT/qtconnectivity/examples/bluetooth/CAT_BT_18112020/device.cpp:153: error: expected primary-expression before '.' token
^
/media/f/QT/Qt/QT/qtconnectivity/examples/bluetooth/CAT_BT_18112020/device.cpp:153: error: expected primary-expression before '.' token
QListWidget.itemClicked(item),
^
To copy to clipboard, switch view to plain text mode
Thanks
Bookmarks