[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop
Subject:    catching mouse signal
From:       Oh Jin Suk <sv00116 () ccs ! sogang ! ac ! kr>
Date:       2001-04-13 5:30:58
[Download RAW message or body]

 hi?
 I write program with Kdevelop 1.4
 I'd like to write program that App Class catches mouseMoveEvent signal from View class, as following

> ----------------------app class--------------------------------------
> #include "view.h"
> #include "doc.h"
> class View;
> class Doc;
>
> class App : public KMainWindow
>
> {
>
> ...
>
> void slotChangeXY(int,int);
> ....
>
> private:
> View *view;
> ....
> }
>
> void App::App():KMainWindow(0,"app"),view(new View(new Doc(),this,0,0))
> {
> ...
> initStatusBar();
> connect(view,SIGNAL(signalChangeXY(int,int),this,SLOT(slotChangeXY(int,int)));
>
> ...
> }
>
> void App::initStatusBar()
> {
> statusBar()->insertItem(i18n("Reday"),1);
> statusBar()->insertItem(i18n(" : "),2,0,true);
> }
>
>
> void App::slotChangeXY(int x, int y)
> {
> QString pos;
> pos.sprintf("%d %d",x,y);
> statusBar()->changeItem(pos,2);
> }
>
> ------------------view class---------------------------
> #include "app.h"
> #include "doc.h"
>
> class App;
> class Doc;
>
> class View : public QWidget
>
> {
> ....
> signals :
> void signalChangeXY(int,int);
> ...
> }
>
> View ::View(Doc* pdoc, QWidget *parent, const char* name, int wflags)
> : QWidget(parent, name, wflags)
> {
> ...
> setMouseTracking(true);
> ......
> }
>
> ....
>
> void View::mouseMoveEvent(QMouseEvent *e)
> {
> emit signalChangeXY(e->pos().x(), e->pos().y())
> }
>
> ---------------------------------
 shortly, app catches view's mouse position and show in on statusbar
 but in app class, it doesn't catch signal from view class, what is wrong do you think?

 thank you

from jin



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic