各位大侠,帮帮忙。我的程序是这样的:
statusBar()->addWidget(mouseLocationLabel_,0,true);
mouseLocationLabel_->setIndent(6);
mouseLocatonLabel_->setText("x:-;y:-");
void MDI_displayApp::mousePressEvent(QMouseEvent *event)
{
int xCoordinate,yCoordinate;
if (event->button() == LeftButton)
{
xCoordinate=event->pos().x();
yCoordinate=event->pos().y();
};
}
现在我想把xCoordinate和yCoordinate的值显示在statusBar:x: 和y: 后面(顺便请教一下大侠,xCoordinate和yCoordinate是不是能取出鼠标点击位置的坐标值呢? ) 我该怎样做呢? 哎,看了一个下午都不会 还请哪位好心的大侠帮帮忙啊!
[ 此贴被XChinux在2006-05-07 22:06重新编辑 ]