Now, I have a slightly different problem...
I want the action QLineEdit to set the values of a specific cell of the MyTable dataSheet (it's an overloaded QTableWidget):
MyTable *dataSheet = new MyTable;//i have overloaded the QTableWidget too
MyTableItem *test = new MyTableItem("test");
dataSheet->setItem(2, 2, test);
connect(action,
SIGNAL( textChanged
( const QString & ) ),dataSheet
->item
(2,
2) ,
SLOT( setTextSlot
( const QString & ) ));
MyTable *dataSheet = new MyTable;//i have overloaded the QTableWidget too
MyTableItem *test = new MyTableItem("test");
dataSheet->setItem(2, 2, test);
QLineEdit *action = new QLineEdit;
connect(action, SIGNAL( textChanged ( const QString & ) ),dataSheet->item(2,2) , SLOT( setTextSlot ( const QString & ) ));
To copy to clipboard, switch view to plain text mode
I get the following error:
error
: no matching function
for call to ‘MyWidget
::connect(MyLineEdit
*&,
const char*,
QTableWidgetItem*,
const char*)’
/usr
/include
/qt4
/QtCore
/qobject.
h:198: candidates are
: static bool QObject::connect(const QObject*,
const char*,
const QObject*,
const char*, Qt
::ConnectionType) /usr
/include
/qt4
/QtCore
/qobject.
h:313: bool QObject::connect(const QObject*,
const char*,
const char*, Qt
::ConnectionType) const
error: no matching function for call to ‘MyWidget::connect(MyLineEdit*&, const char*, QTableWidgetItem*, const char*)’
/usr/include/qt4/QtCore/qobject.h:198: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/usr/include/qt4/QtCore/qobject.h:313: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
To copy to clipboard, switch view to plain text mode
I think I am close to make it work, but there's something wrong.
From the moment that this line works:
connect(action,
SIGNAL( textChanged
( const QString & ) ), test,
SLOT( setTextSlot
( const QString & ) ));
connect(action, SIGNAL( textChanged ( const QString & ) ), test, SLOT( setTextSlot ( const QString & ) ));
To copy to clipboard, switch view to plain text mode
there must be a way to make this line work too:
connect(action,
SIGNAL( textChanged
( const QString & ) ),dataSheet
->item
(2,
2) ,
SLOT( setTextSlot
( const QString & ) ));
connect(action, SIGNAL( textChanged ( const QString & ) ),dataSheet->item(2,2) , SLOT( setTextSlot ( const QString & ) ));
To copy to clipboard, switch view to plain text mode
Bookmarks