Qt-interest Archive, March 2008
label
Message 1 in thread
is there a way to add clicked() slot to labeles?
is there a way to define "hit zone" for labels?
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Message 2 in thread
Hi,
> is there a way to add clicked() slot to labeles?
You probably mean a clicked() signal? Yes, just inherit QLabel, override
mousePressEvent() and emit the signal from there.
Some of the Qt examples override mousePressEvent() themeselves. You might have
a look at these examples for inspiration.
> is there a way to define "hit zone" for labels?
I'm not sure what a "hit zone" is, I guess it defines the part of the QLabel a
clicked() signal should be emitted when it's clicked on. If so, just handle
that in mousePressEvent().
--
[ signature omitted ]