pyqt problem

Sachin Tiwari sachin.tiwari50 at gmail.com
Thu Oct 2 15:12:43 CEST 2014


On Thursday, October 2, 2014 3:19:22 PM UTC+5:30, Sachin Tiwari wrote:
> Hi 
> 
> I am learning pyqt, can any one help me to make instances of pushbutton wherever cursor will be clicked on canvas,like a circuit simulator where  we add components on canvas just by left or right click.
> 
> 
> 
> Thanks & Regards,
> 
> Sachin

Hi

swch = QPushButton('', self)
swch.setToolTip('Switch ')
swch.setCheckable(True)
swch.setIcon(QIcon('sw.png'))
swch.setIconSize(QSize(40,40))
swch.move(05, 25)
swch.clicked.connect(self.switch)

The above code will make a push button on canvas, now what I want when I will click on this button it get ready to drop anywhere on canvas by left click,I mean if I click 10 times on canvas 10 push button will be there.
 




More information about the Python-list mailing list