johan07
13th November 2015, 13:11
Hi,
i want add information to QComboBox
so i create it like that
formcharacter=new QWidget(this);
formcharacter->show();
liste = new QComboBox(formcharacter);
connect(myapp,SIGNAL(BoneAdede( QString * )), this, SLOT( BoneAdede( QString *)));
in my mainwindow i defined slot
void MainWindow::BoneAdede( QString name )
{
cout<<"iam BoneAded";
liste->addItem(name);
}
in the class myapp,i difined signal
signals :
void BoneAdede ( QString name );
and
void myapp::create_character(/*QString fname*/)
{
for(unsigned int i = 0; i < skel->getNumBones(); ++i) {
std::string namem=skel->getBone(i)->getName();
emit BoneAdede(QString( namem.c_str()));
}
}
but nothing it happen
the QComboBox is emty, it does not enter to the function BoneAdede( QString name ) in the mainwindows
there is problem in the "connect"??
Edit:
the problem was in " QString *" i must use " QString " :)
i want add information to QComboBox
so i create it like that
formcharacter=new QWidget(this);
formcharacter->show();
liste = new QComboBox(formcharacter);
connect(myapp,SIGNAL(BoneAdede( QString * )), this, SLOT( BoneAdede( QString *)));
in my mainwindow i defined slot
void MainWindow::BoneAdede( QString name )
{
cout<<"iam BoneAded";
liste->addItem(name);
}
in the class myapp,i difined signal
signals :
void BoneAdede ( QString name );
and
void myapp::create_character(/*QString fname*/)
{
for(unsigned int i = 0; i < skel->getNumBones(); ++i) {
std::string namem=skel->getBone(i)->getName();
emit BoneAdede(QString( namem.c_str()));
}
}
but nothing it happen
the QComboBox is emty, it does not enter to the function BoneAdede( QString name ) in the mainwindows
there is problem in the "connect"??
Edit:
the problem was in " QString *" i must use " QString " :)