this is getting to specific.
We need to see ALL the relevant code.
this is getting to specific.
We need to see ALL the relevant code.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
this->setMouseTracking(true);
Q3DockWindow * myDockWidget=new Q3DockWindow(this);
QLabel * myTitle = new QLabel(myDockWidget);
myTitle->setText("hello this is my Title bar");
myDockWidget->setWidget(myTitle);
this->addDockWindow(myDockWidget,Qt:ockTop);
this->moveDockWindow(myDockWidget,Qt:ockTop);
QTabWidget * myTb = new QTabWidget(this);
myPixMap.loadFromData(contact_png,sizeof(contact_p ng),"PNG");
QIcon myContactIcon(myPixMap);
myTb->addTab(cvlist,myContactIcon,NULL);
myPixMap.loadFromData(treasure_png,sizeof(treasure _png),"PNG");
QIcon myTreasureIcon(myPixMap);
QAxWidget * object = new QAxWidget("8856F961-340A-11D0-A96B-00C04FD705A2");
object->dynamicCall("Navigate(const QString&)",treasureWebSite);
myTb->addTab(object,myTreasureIcon,NULL);
myPixMap.loadFromData(friend_png,sizeof(friend_png ),"PNG");
QIcon myFriendIcon(myPixMap);
QAxWidget * object1 = new QAxWidget("8856F961-340A-11D0-A96B-00C04FD705A2");
object1->dynamicCall("Navigate(const QString&)",friendWebSite);
myTb->addTab(object1,myFriendIcon,NULL);
myTb->setIconSize(QSize(18,20));
myTb->setTabPosition ( QTabWidget::West);
myUserInfoButton.setIcon(PsiIconset::instance()->statusPtr(STATUS_OFFLINE)->pixmap());
myUserInfoButton.setText(" ");
d->vb_main->addWidget(&myUserInfoButton);
d->vb_main->addWidget(myTb);
this is the relevant code, please check up, if some thing wrong with the code!
and the mouseMoveEvent()?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
void MainWin::mouseMoveEvent ( QMouseEvent * event ){
if(this->hasMouseTracking()){
QMessageBox myMB1;
myMB1.setText("hasMouseTracking");
myMB1.exec();
}else{
QMessageBox myMB1;
myMB1.setText("has no hasMouseTracking");
myMB1.exec();
}
return;
}
this is mouseMoveEvent function!
and what is the behaviour? are you getting no message box at all?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
hmm... strange.
I can't explain that behaviour from what I see...
EDIT:
Wait, this is a main window right?
So it might be that you have to set the mouse tracking on each element of the main widnow...
What do you have on your main window when you run this?
Last edited by high_flyer; 22nd June 2007 at 11:55.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
wygggyxtf (23rd June 2007)
I have resove the trouble, above the code i have put up, there is a paragraph:
QWidget *center = new QWidget (this, "Central widget");
setCentralWidget ( center );
d->vb_main = new QVBoxLayout(center);
cvlist = new ContactView(center);
now i add a sentence:
center->setMouseTracking(true);
that's OK!
please put up your code that you customize QMainWindow to me! thanks!
Try create message box
QMessageBox *myMB1 = new QMessageBox(...);
myMB1->show(); (exec())
or change something on your widget to see work mousemove or not!
example
QLabel *label;
in your constructor
label = new QLabel ("ddd");
label->setGeometry(...);
and in mouseevent
label->setCaption("Work");
Bookmarks