[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: How can I associate spans of text in a QTextEdit with specific objects to be returned when a sure cl
From: inhahe <inhahe () gmail ! com>
Date: 2021-03-31 7:33:35
Message-ID: CAPeSgWoz83=MZWvr5mu3LnmBJhttH54MLBB1fSYPt81GfRi3VQ () mail ! gmail ! com
[Download RAW message or body]
I'm making an IRC client, and I want to make it so that, when the user
right clicks or double clicks on a person's nick in the channel scroll
(where it says whom a message is from), the click function is able to tell
(a) that they clicked on a nick, and (b) what the nick is. So I guess I
need to attach objects or ints or something to those spans, but I don't
know how..
I thought of insertHtml('<span class="nick">some_nick</span>'), but I
wouldn't know how to retrieve the class of the span clicked on or the
contents of the span.
I found 'virtual void insertParagraph ( const QString & text, int para )'
and 'void QTextEdit::clicked ( int para, int pos ) [signal]', which seem to
be what I need (except I'd need right click and double click instead), but
they only seem to be available in Qt, not PyQt.
[Attachment #3 (text/html)]
<div dir="ltr">I'm making an IRC client, and I want to make it so that, when the \
user right clicks or double clicks on a person's nick in the channel scroll \
(where it says whom a message is from), the click function is able to tell (a) that \
they clicked on a nick, and (b) what the nick is. So I guess I need to attach objects \
or ints or something to those spans, but I don't know how.. \
<div><br></div><div>I thought of insertHtml('<span \
class="nick">some_nick</span>'), but I wouldn't know how \
to retrieve the class of the span clicked on or the contents of the span. \
</div><div><br></div><div>I found 'virtual void insertParagraph ( const QString \
& text, int para )' and 'void QTextEdit::clicked ( int para, int pos ) \
[signal]', which seem to be what I need (except I'd need right click and \
double click instead), but they only seem to be available in Qt, not \
PyQt.</div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic