Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"You'll pay to know what you really think." -- J. R. "Bob" Dobbs


devel / comp.lang.python / Open a new window by mouse clicking in the QLineEdit field and not by clicking of a button

SubjectAuthor
* Open a new window by mouse clicking in the QLineEdit field and not byMohsen Owzar
+* Re: Open a new window by mouse clicking in the QLineEdit field andJulio Di Egidio
|`* Re: Open a new window by mouse clicking in the QLineEdit field andJulio Di Egidio
| `- Re: Open a new window by mouse clicking in the QLineEdit field andPython
`- Re: Open a new window by mouse clicking in the QLineEdit field andBarry

1
Open a new window by mouse clicking in the QLineEdit field and not by clicking of a button

<a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15559&group=comp.lang.python#15559

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a05:622a:283:: with SMTP id z3mr17902483qtw.324.1633417445485;
Tue, 05 Oct 2021 00:04:05 -0700 (PDT)
X-Received: by 2002:a05:622a:181f:: with SMTP id t31mr18373976qtc.217.1633417445291;
Tue, 05 Oct 2021 00:04:05 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 5 Oct 2021 00:04:05 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=31.165.67.106; posting-account=BtTavwoAAACMi3AFrA3U-JBERbxGUGhD
NNTP-Posting-Host: 31.165.67.106
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
Subject: Open a new window by mouse clicking in the QLineEdit field and not by
clicking of a button
From: mohsen.o...@gmail.com (Mohsen Owzar)
Injection-Date: Tue, 05 Oct 2021 07:04:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 37
 by: Mohsen Owzar - Tue, 5 Oct 2021 07:04 UTC

Hi all,
I'm looking for an approach, but couldn't find any appropriate answer to my problem:
On my GUI on a tablet, I have bunch of QlineEdit widgets for the settings of my task.
Because we have no keyboard connected to the tablet, I have put two buttons ("+" and "-") around each QLineEdit widget to increase or decrease its value.
When the target value is far away from the displayed one in the QLineEdit, I have to click lots of times to reach the end value.
Due to this ugliness feature, I wanted to offer to the user the possibility to click in the edit field to get another window with a numeric keypad to type the target value. And then by clicking an OK button, the new window will be closed and the typed value will be taken into the QLineEdit widget of my original GUI.
In all my searches, I found examples to open new windows by clicking a button and not by clicking in an edit field.
I used the following line to have an edit field on window1.

self.text_from_window2 = QLineEdit('Setting Value')

And wanted to open another window (window2) in which I programmed a numeric keypad. By typing the desired value on this keypad and enter OK, this value should be taken to the edit field of window1.
But the following line brings an error that QLineEdit has no attribute "clicked".

self.text_from_window2.clicked().connect(self.show_keypad_window)

I tried to use other attributes like focus, textChanged or textEdited. None of them could help me.
Is it at all possible to use QLineEdit with mouse click to generate an action (open new window)?
Has anyone an example of such a code snippet?
I am very curious to see if someone has a solution to my problem.

Regards
Mohsen

Re: Open a new window by mouse clicking in the QLineEdit field and not by clicking of a button

<8e815c18-58b7-4af5-9705-faa42f43add9n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15560&group=comp.lang.python#15560

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:4817:: with SMTP id g23mr4134790qtq.197.1633451843858;
Tue, 05 Oct 2021 09:37:23 -0700 (PDT)
X-Received: by 2002:a0c:c34e:: with SMTP id j14mr18812919qvi.56.1633451843760;
Tue, 05 Oct 2021 09:37:23 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 5 Oct 2021 09:37:23 -0700 (PDT)
In-Reply-To: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.100.49; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.100.49
References: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8e815c18-58b7-4af5-9705-faa42f43add9n@googlegroups.com>
Subject: Re: Open a new window by mouse clicking in the QLineEdit field and
not by clicking of a button
From: jul...@diegidio.name (Julio Di Egidio)
Injection-Date: Tue, 05 Oct 2021 16:37:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 35
 by: Julio Di Egidio - Tue, 5 Oct 2021 16:37 UTC

On Tuesday, 5 October 2021 at 09:04:18 UTC+2, mohsen...@gmail.com wrote:
> Hi all,
> I'm looking for an approach, but couldn't find any appropriate answer to my problem:
> On my GUI on a tablet, I have bunch of QlineEdit widgets for the settings of my task.

Do you mean this one: <https://doc.qt.io/qt-6/qlineedit.html>?

I can only find C++ there, then bindings to Python, no JavaScript in sight.

You should clarify what you are talking about and how it relates to JS.

> Because we have no keyboard connected to the tablet, I have put two buttons ("+" and "-") around each QLineEdit widget to increase or decrease its value.
> When the target value is far away from the displayed one in the QLineEdit, I have to click lots of times to reach the end value.
> Due to this ugliness feature, I wanted to offer to the user the possibility to click in the edit field to get another window with a numeric keypad to type the target value. And then by clicking an OK button, the new window will be closed and the typed value will be taken into the QLineEdit widget of my original GUI.
> In all my searches, I found examples to open new windows by clicking a button and not by clicking in an edit field.

Please show that code, or just give a link to it, as that might help clarify few things...

> I tried to use other attributes like focus, textChanged or textEdited. None of them could help me.

Are you just guessing the event names or actually looking at the relevant documentation (whichever that is, see my opening question)?

Julio

Re: Open a new window by mouse clicking in the QLineEdit field and not by clicking of a button

<f46a46ef-a7b4-4f4e-825f-c71c6ee2a4dan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15561&group=comp.lang.python#15561

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:a37:746:: with SMTP id 67mr15645912qkh.465.1633452010816;
Tue, 05 Oct 2021 09:40:10 -0700 (PDT)
X-Received: by 2002:a05:620a:14d:: with SMTP id e13mr97610qkn.105.1633452010691;
Tue, 05 Oct 2021 09:40:10 -0700 (PDT)
Path: rocksolid2!i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 5 Oct 2021 09:40:10 -0700 (PDT)
In-Reply-To: <8e815c18-58b7-4af5-9705-faa42f43add9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.100.49; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.100.49
References: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com> <8e815c18-58b7-4af5-9705-faa42f43add9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f46a46ef-a7b4-4f4e-825f-c71c6ee2a4dan@googlegroups.com>
Subject: Re: Open a new window by mouse clicking in the QLineEdit field and
not by clicking of a button
From: jul...@diegidio.name (Julio Di Egidio)
Injection-Date: Tue, 05 Oct 2021 16:40:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 35
 by: Julio Di Egidio - Tue, 5 Oct 2021 16:40 UTC

On Tuesday, 5 October 2021 at 18:37:37 UTC+2, Julio Di Egidio wrote:
> On Tuesday, 5 October 2021 at 09:04:18 UTC+2, mohsen...@gmail.com wrote:
> > Hi all,
> > I'm looking for an approach, but couldn't find any appropriate answer to my problem:
> > On my GUI on a tablet, I have bunch of QlineEdit widgets for the settings of my task.
> Do you mean this one: <https://doc.qt.io/qt-6/qlineedit.html>?
>
> I can only find C++ there, then bindings to Python, no JavaScript in sight.
>
> You should clarify what you are talking about and how it relates to JS.
> > Because we have no keyboard connected to the tablet, I have put two buttons ("+" and "-") around each QLineEdit widget to increase or decrease its value.
> > When the target value is far away from the displayed one in the QLineEdit, I have to click lots of times to reach the end value.
> > Due to this ugliness feature, I wanted to offer to the user the possibility to click in the edit field to get another window with a numeric keypad to type the target value. And then by clicking an OK button, the new window will be closed and the typed value will be taken into the QLineEdit widget of my original GUI.
> > In all my searches, I found examples to open new windows by clicking a button and not by clicking in an edit field.
> Please show that code, or just give a link to it, as that might help clarify few things...
> > I tried to use other attributes like focus, textChanged or textEdited. None of them could help me.
> Are you just guessing the event names or actually looking at the relevant documentation (whichever that is, see my opening question)?

My apologies, somehow I was convinced I was in comp.lang.javascript...

Julio

Re: Open a new window by mouse clicking in the QLineEdit field and not by clicking of a button

<615c8a98$0$5987$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15562&group=comp.lang.python#15562

  copy link   Newsgroups: comp.lang.python
Path: rocksolid2!news.neodome.net!news.mixmin.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp1-2.free.fr!not-for-mail
Subject: Re: Open a new window by mouse clicking in the QLineEdit field and
not by clicking of a button
Newsgroups: comp.lang.python
References: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
<8e815c18-58b7-4af5-9705-faa42f43add9n@googlegroups.com>
<f46a46ef-a7b4-4f4e-825f-c71c6ee2a4dan@googlegroups.com>
From: pyt...@python.invalid (Python)
Date: Tue, 5 Oct 2021 19:26:30 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.14.0
MIME-Version: 1.0
In-Reply-To: <f46a46ef-a7b4-4f4e-825f-c71c6ee2a4dan@googlegroups.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: fr
Content-Transfer-Encoding: 7bit
Lines: 28
Message-ID: <615c8a98$0$5987$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 05 Oct 2021 19:25:44 CEST
NNTP-Posting-Host: 176.150.91.24
X-Trace: 1633454744 news-1.free.fr 5987 176.150.91.24:53128
X-Complaints-To: abuse@proxad.net
 by: Python - Tue, 5 Oct 2021 17:26 UTC

Crank Julio Di Egidio wrote:
> On Tuesday, 5 October 2021 at 18:37:37 UTC+2, Julio Di Egidio wrote:
>> On Tuesday, 5 October 2021 at 09:04:18 UTC+2, mohsen...@gmail.com wrote:
>>> Hi all,
>>> I'm looking for an approach, but couldn't find any appropriate answer to my problem:
>>> On my GUI on a tablet, I have bunch of QlineEdit widgets for the settings of my task.
>> Do you mean this one: <https://doc.qt.io/qt-6/qlineedit.html>?
>>
>> I can only find C++ there, then bindings to Python, no JavaScript in sight.
>>
>> You should clarify what you are talking about and how it relates to JS.
>>> Because we have no keyboard connected to the tablet, I have put two buttons ("+" and "-") around each QLineEdit widget to increase or decrease its value.
>>> When the target value is far away from the displayed one in the QLineEdit, I have to click lots of times to reach the end value.
>>> Due to this ugliness feature, I wanted to offer to the user the possibility to click in the edit field to get another window with a numeric keypad to type the target value. And then by clicking an OK button, the new window will be closed and the typed value will be taken into the QLineEdit widget of my original GUI.
>>> In all my searches, I found examples to open new windows by clicking a button and not by clicking in an edit field.
>> Please show that code, or just give a link to it, as that might help clarify few things...
>>> I tried to use other attributes like focus, textChanged or textEdited. None of them could help me.
>> Are you just guessing the event names or actually looking at the relevant documentation (whichever that is, see my opening question)?
>
> My apologies, somehow I was convinced I was in comp.lang.javascript...
>
> Julio

Ah ah ah, what a moron!

Re: Open a new window by mouse clicking in the QLineEdit field and not by clicking of a button

<mailman.932.1633469056.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=15568&group=comp.lang.python#15568

  copy link   Newsgroups: comp.lang.python
Path: rocksolid2!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: bar...@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: Open a new window by mouse clicking in the QLineEdit field and
not by clicking of a button
Date: Tue, 5 Oct 2021 22:24:03 +0100
Lines: 60
Message-ID: <mailman.932.1633469056.4164.python-list@python.org>
References: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
<CFBDE37B-AD52-4DA9-A42A-FA03CE5C3FCC@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de UNPhN8ny4Xp5D3fxCB54HAeaKg4B8BY2SS6zacYVLvgA==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: Python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'bunch': 0.05; 'gui': 0.05;
'field.': 0.07; 'task.': 0.07; '(open': 0.09; 'cc:addr:python-
list': 0.09; 'from:addr:barry': 0.09; 'join.': 0.09; 'numeric':
0.09; 'ok,': 0.09; 'received:217.70': 0.09; 'received:gandi.net':
0.09; 'received:mail.gandi.net': 0.09; 'subject:Open': 0.09;
'subject:not': 0.09; 'values.': 0.09; 'widgets': 0.09; 'cc:no real
name:2**0': 0.14; 'url:mailman': 0.15; 'problem.': 0.15;
'approach,': 0.16; 'attributes': 0.16; 'barry': 0.16; 'button,':
0.16; 'buttons': 0.16; 'displayed': 0.16; 'finger': 0.16;
'from:addr:barrys-emacs.org': 0.16; 'gui.': 0.16; 'linear': 0.16;
'message-id:@barrys-emacs.org': 0.16; 'programmed': 0.16;
'searches,': 0.16; 'slow': 0.16; 'subject:clicking': 0.16;
'subject:field': 0.16; 'typing': 0.16; 'wrote:': 0.16;
'cc:addr:python.org': 0.20; 'all,': 0.20; 'closed': 0.22; 'code':
0.23; 'url-ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24':
0.25; 'examples': 0.25; 'url:listinfo': 0.25; 'cc:2**0': 0.25;
'url-ip:188.166/16': 0.25; 'anyone': 0.25; 'tried': 0.26;
'brings': 0.26; 'done': 0.28; 'settings': 0.28; 'error': 0.29;
'url-ip:188/8': 0.31; 'window': 0.32; 'but': 0.32; "i'm": 0.33;
'mailing': 0.33; 'there': 0.33; 'windows': 0.34; 'someone': 0.34;
'header:In-Reply-To:1': 0.34; 'following': 0.35; 'target': 0.36;
'change': 0.36; 'way': 0.38; 'could': 0.38; 'put': 0.38; 'two':
0.39; 'developers': 0.39; 'edit': 0.39; 'list': 0.39; 'use': 0.39;
"couldn't": 0.40; 'should': 0.40; 'tell': 0.60; 'me.': 0.62;
'great': 0.63; 'events': 0.63; 'button': 0.64; 'skip:k 10': 0.64;
'touch': 0.65; 'received:217': 0.67; 'url-ip:18/8': 0.67; 'away':
0.67; 'scale': 0.69; 'times': 0.69; 'reach': 0.69; 'offer': 0.71;
'clicking': 0.76; 'field': 0.78; 'click': 0.83; 'attribute': 0.84;
'feature,': 0.84; 'mouse': 0.84; 'pyqt': 0.84
In-Reply-To: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
X-Mailer: iPad Mail (19A346)
X-Content-Filtered-By: Mailman/MimeDel 2.1.34
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CFBDE37B-AD52-4DA9-A42A-FA03CE5C3FCC@barrys-emacs.org>
X-Mailman-Original-References: <a6129169-3481-43c6-b5f1-1fd9e60e9660n@googlegroups.com>
 by: Barry - Tue, 5 Oct 2021 21:24 UTC

> On 5 Oct 2021, at 22:07, Mohsen Owzar <mohsen.owzar@gmail.com> wrote:
>
> Hi all,
> I'm looking for an approach, but couldn't find any appropriate answer to my problem:
> On my GUI on a tablet, I have bunch of QlineEdit widgets for the settings of my task.
> Because we have no keyboard connected to the tablet, I have put two buttons ("+" and "-") around each QLineEdit widget to increase or decrease its value.
> When the target value is far away from the displayed one in the QLineEdit, I have to click lots of times to reach the end value.
> Due to this ugliness feature, I wanted to offer to the user the possibility to click in the edit field to get another window with a numeric keypad to type the target value. And then by clicking an OK button, the new window will be closed and the typed value will be taken into the QLineEdit widget of my original GUI.
> In all my searches, I found examples to open new windows by clicking a button and not by clicking in an edit field.

What I have done is use mouse move events to change values.
I touch the field then drag my finger to change the value.
I only use linear scaling but you could have code that can tell slow drag
from fast drag and scale the value.

> I used the following line to have an edit field on window1.
>
> self.text_from_window2 = QLineEdit('Setting Value')
>
> And wanted to open another window (window2) in which I programmed a numeric keypad. By typing the desired value on this keypad and enter OK, this value should be taken to the edit field of window1.
> But the following line brings an error that QLineEdit has no attribute "clicked".
>
> self.text_from_window2.clicked().connect(self.show_keypad_window)
>
> I tried to use other attributes like focus, textChanged or textEdited. None of them could help me.
> Is it at all possible to use QLineEdit with mouse click to generate an action (open new window)?
> Has anyone an example of such a code snippet?
> I am very curious to see if someone has a solution to my problem.

By the way there is a great PyQt mailing list that you might like to join.

https://www.riverbankcomputing.com/mailman/listinfo/pyqt

Lots of knowledgeable PyQt developers hang out on that list.

Barry

>
> Regards
> Mohsen
> --
> https://mail.python.org/mailman/listinfo/python-list
>

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor