【发布时间】:2014-02-26 22:07:32
【问题描述】:
void Scene::mousePressEvent( QMouseEvent * iEvent )
{
Square temp;
emit GetSquareParameters( temp.color.red, temp.color.green, temp.color.blue, temp.size );
m_Squares.push_back( temp );
}
我从QMouseEvent 获取鼠标坐标,并且需要从MainWindow 的一些滑块获取参数。我在Scene 中创建信号GetSquareParameters,在MainWindow 中创建SendSliderParams 插槽。
信号和槽像aconnect( ui->widget, SIGNAL( GetSquareParameters( int, int,int,int)), this, SLOT( SendSliderParams( int, int,int,int) ) );
我可以通过引用将参数传回信号和插槽吗?如果不是我怎么能实现我想要的行为?
【问题讨论】: