Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78599

Re: pyqt problem

Newsgroups comp.lang.python
Date 2014-10-02 06:12 -0700
References <add6623a-1652-4845-98d8-0506db9e9971@googlegroups.com>
Message-ID <44ed365f-8896-4d33-a44a-97801ea06434@googlegroups.com> (permalink)
Subject Re: pyqt problem
From Sachin Tiwari <sachin.tiwari50@gmail.com>

Show all headers | View raw


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.
 

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

pyqt problem sachin.tiwari50@gmail.com - 2014-10-02 02:49 -0700
  Re: pyqt problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-02 12:00 +0100
  Re: pyqt problem Sachin Tiwari <sachin.tiwari50@gmail.com> - 2014-10-02 06:12 -0700

csiph-web