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


Groups > comp.lang.python > #78593 > unrolled thread

pyqt problem

Started bysachin.tiwari50@gmail.com
First post2014-10-02 02:49 -0700
Last post2014-10-02 06:12 -0700
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  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

#78593 — pyqt problem

Fromsachin.tiwari50@gmail.com
Date2014-10-02 02:49 -0700
Subjectpyqt problem
Message-ID<add6623a-1652-4845-98d8-0506db9e9971@googlegroups.com>
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

[toc] | [next] | [standalone]


#78594

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-10-02 12:00 +0100
Message-ID<mailman.14547.1412247647.18130.python-list@python.org>
In reply to#78593
On 02/10/2014 10:49, sachin.tiwari50@gmail.com 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
>

Please show us what you're tried so far and where it's going wrong, 
we're not here simply to write code for you.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#78599

FromSachin Tiwari <sachin.tiwari50@gmail.com>
Date2014-10-02 06:12 -0700
Message-ID<44ed365f-8896-4d33-a44a-97801ea06434@googlegroups.com>
In reply to#78593
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.
 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web