Are you sure parameter names are allowed in the SLOT
macro? A quick test suggests they're not.
Try with:
connect(divide, SIGNAL(splitterMoved(int,int)),
this, SLOT(splitterMoved(int,int)));
UPDATE:
Another point is that pos
is not 0 when the child widget #1 is collapsed, on the contrary it reaches its maximum value, since it is the distance from the top. Testing QSplitter:sizes()
would be easier.
Example, assuming divide
is a class member:
void Editor::splitterMoved(int pos, int index){
if(divide->sizes().at(1)==0) {
ui->TagButton->setChecked(false);
}
else{
ui->TagButton->setChecked(true);
}