maider
30th November 2009, 09:17
hey, I have done a list of pointers of QWidget. Everything is well done but I want to simplify the last declaration with a for.
My code is the following one:
QList <QWidget*> v;
QVector <int> v_pos(60);
int i_sc =0;
ONE *p1 = new ONE();
v.insert(i_sc,p1);
v_pos[i_sc]= SC_ONE;
i_sc++;
TWO *p1 = new TWO();
v.insert(i_sc,p1);
v_pos[i_sc]= SC_TWO;
i_sc++;
int i;
QList<QWidget*> list;
list.replace(SC_ONE,p1);
list.replace(SC_TWO,p2);
p1->getScreenDirectionlist(&list);
p2->getScreenDirectionlist(&list);
Now, I have changed
"p1->getScreenDirectionlist(&list);" for "v.at(0)->getScreenDirectionlist(&list);"
but It give this error Description Resource Path Location Type
invalid conversion from `QWidget* const' to `ONE*' main.cpp tfp003 83 C/C++ Problem
Do you know ho can i solve it?
thanks
My code is the following one:
QList <QWidget*> v;
QVector <int> v_pos(60);
int i_sc =0;
ONE *p1 = new ONE();
v.insert(i_sc,p1);
v_pos[i_sc]= SC_ONE;
i_sc++;
TWO *p1 = new TWO();
v.insert(i_sc,p1);
v_pos[i_sc]= SC_TWO;
i_sc++;
int i;
QList<QWidget*> list;
list.replace(SC_ONE,p1);
list.replace(SC_TWO,p2);
p1->getScreenDirectionlist(&list);
p2->getScreenDirectionlist(&list);
Now, I have changed
"p1->getScreenDirectionlist(&list);" for "v.at(0)->getScreenDirectionlist(&list);"
but It give this error Description Resource Path Location Type
invalid conversion from `QWidget* const' to `ONE*' main.cpp tfp003 83 C/C++ Problem
Do you know ho can i solve it?
thanks