//this would idealy draw the items, add them to scene, and display in view without any scaling
connect(pushButton, SIGNAL(clicked()), this, SLOT(process(1,1)));
//this would idealy draw the items, add them to scene, and display in view without any scaling
connect(pushButton, SIGNAL(clicked()), this, SLOT(process(1,1)));
To copy to clipboard, switch view to plain text mode
As it was said in the post above, you can give values in a connect() statment.
i.e you can't do this-> process(1,1).
Also, this connect statment makes no sense, since clicked() doesn't deliver any paremeters.
you should do:
connect(pushButton, SIGNAL(clicked()), this, SLOT(process()));
connect(pushButton, SIGNAL(clicked()), this, SLOT(process()));
To copy to clipboard, switch view to plain text mode
And define process() accordingly.
//this would scale horizontally only
connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(process(int,1)));
//this would scale horizontally only
connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(process(int,1)));
To copy to clipboard, switch view to plain text mode
Again the same thing:
connect(horizontalSlider, SIGNAL(valueChangedRight(int)), this, SLOT(processRight(int)));
connect(horizontalSlider, SIGNAL(valueChangedLeft(int)), this, SLOT(processLeft(int)));
connect(horizontalSlider, SIGNAL(valueChangedRight(int)), this, SLOT(processRight(int)));
connect(horizontalSlider, SIGNAL(valueChangedLeft(int)), this, SLOT(processLeft(int)));
To copy to clipboard, switch view to plain text mode
I know these signals do not exist, but the connect statment is correct.
You will have to insert some logic that analyzes if it is an incriment or decriment, by the current and previous slider values.
so:
connect(horizontalSlider, SIGNAL(valueChangedRight(int)), this, SLOT(process(int)));
void MyClass::process(int pos)
{
if(pos > prevPos) //we moved right
else //we moved left
}
connect(horizontalSlider, SIGNAL(valueChangedRight(int)), this, SLOT(process(int)));
void MyClass::process(int pos)
{
if(pos > prevPos) //we moved right
else //we moved left
}
To copy to clipboard, switch view to plain text mode
Bookmarks