Jonas_
30th September 2009, 11:01
Hi there,
I've got a Problem. Sorry for my bad english, that the reason why I want to show you my code. This tells more than my 1000 words...
1st my Class,
using namespace MyNamespace;
class MyTreeWidgetItem : public QTreeWidgetItem
{
Q_OBJECT
public:
SingleScanTreeWidgetItem(QTreeWidget *parent);
~SingleScanTreeWidgetItem();
void makeActions(QMenu* menu);
public slots:
void onAction();
};
Okay, and here is my implementation:
MyTreeWidgetItem::MyTreeWidgetItem(QTreeWidget *parent)
: QTreeWidgetItem(parent)
{
setText(0,"The Text");
}
MyTreeWidgetItem::~MyTreeWidgetItem()
{
}
void MyTreeWidgetItem::makeActions(QMenu* menu)
{
QAction* action = new QAction(QString("Test"),menu);
menu->addAction(action);
QObject::connect(action,SIGNAL(triggered()),this,S LOT(onAction()));
}
void MyTreeWidgetItem::onAction()
{
int test(0);
}
So, thats all. But my compiler gives my an error:
CompileError C2665:
'function' : none of the number1 overloads can convert parameter number2 from type 'type'
So whats my mistake? How can I solve this problem?
Did anybody knows that?
Ciao + Thanks
I've got a Problem. Sorry for my bad english, that the reason why I want to show you my code. This tells more than my 1000 words...
1st my Class,
using namespace MyNamespace;
class MyTreeWidgetItem : public QTreeWidgetItem
{
Q_OBJECT
public:
SingleScanTreeWidgetItem(QTreeWidget *parent);
~SingleScanTreeWidgetItem();
void makeActions(QMenu* menu);
public slots:
void onAction();
};
Okay, and here is my implementation:
MyTreeWidgetItem::MyTreeWidgetItem(QTreeWidget *parent)
: QTreeWidgetItem(parent)
{
setText(0,"The Text");
}
MyTreeWidgetItem::~MyTreeWidgetItem()
{
}
void MyTreeWidgetItem::makeActions(QMenu* menu)
{
QAction* action = new QAction(QString("Test"),menu);
menu->addAction(action);
QObject::connect(action,SIGNAL(triggered()),this,S LOT(onAction()));
}
void MyTreeWidgetItem::onAction()
{
int test(0);
}
So, thats all. But my compiler gives my an error:
CompileError C2665:
'function' : none of the number1 overloads can convert parameter number2 from type 'type'
So whats my mistake? How can I solve this problem?
Did anybody knows that?
Ciao + Thanks