0

QList<QWidget *> list; In scene user can add no of objects and m storing objects in list. i want to get the object the user clicked or focused one so that i can change properties or delete object. how to get clicked object pointer from list ?

Sagar A W
  • 338
  • 1
  • 12

1 Answers1

0

QWidget might not have the signals and methods you need to implement this easily.

Look here http://doc.qt.io/qt-5/widget-classes.html to find the widget best suited for your needs.

In order to keep track for the signals and to which button they belong you can want use a QSignalMapper.

ALDSMQJF
  • 19
  • 5
  • sorry i think you didnt understand the question. i have stored object pointers in QList list; in this list i have to find user clicked object pointer. – Sagar A W Jun 15 '18 at 10:07
  • I'm sorry, I'm not sure what you're asking. If it's already in a list then you can just write list[index] and as I said you can use QSignalMapper to get the index. – ALDSMQJF Jun 15 '18 at 10:10
  • Thanks ... i got some ideas ...i wil try – Sagar A W Jun 15 '18 at 11:51