Make KURLRequester object emit click.

David Harel hareldvd at ergolight-sw.com
Fri Mar 19 20:39:38 GMT 2004


Hi,

I want an object of the type KURLRequester to give me an event whenever 
it has a mouse click on it. ( I don't mind any of, clicked, 
mouseButtonDown, gotFocus or whatever ). Since the KURLRequester is 
composed of, among other things, editText() (of the type KEditText) I do 
not receive by default a click event from it.
I asked a question about this issue before and was advised to create an 
eventFilter but it seems I don't know how to implement eventFilter in 
such a case.

 I tried to create my own object that inherits form KURLRequester and in 
it add an emit clicked() statement but the resolution is the entire 
object and the lineEdit() object still does not emit the proper event. 
What can I do? (Code example or a link will be highly appreciated.)

class myURLRequester : public KURLRequester {
Q_OBJECT
  public:
    myURLRequester (QWidget *parent = 0, const char *name = 0);
    ~myURLRequester();

  signals:
    void clicked(); /**< emitted when someone clicks on it */

  protected:
    bool eventFilter( QObject *o, QEvent *e );
    virtual void mousePressEvent(QMouseEvent *e) {  emit clicked() } ;
};

-- 
Thanks.

David Harel,

==================================

Home office +972 4 6921986
Fax:        +972 4 6921986
Cellular:   +972 54 534502
Snail Mail: Amuka
            D.N Merom Hagalil
            13802
            Israel
Email:      hareldvd at ergolight-sw.com
F


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list