我有我的工具欄上的兩個動作:saveaction和startaction如何將一個插槽內創建的文件從一個獨立的插槽發送到另一個插槽?
saveaction is connected to save() slot
startaction is connected to optimize() slot
是內部優化創建的文件()。我想將文件保存在save()中。
由於當信號被觸發時被調用,它們(槽)應該是獨立的。 所以我有,
void Mainwidnow::optimize()
{
//here a file is created
// and I want to send this file to save()
}
當我推工具欄(saveaction)savebutton。
void Mainwindow::save()
{
//here I want actually get file and save
get = thefile
saveit();
}
我想我不能叫保存()內優化(),因爲它被稱爲每次優化()被調用,但我要的是每當saveaction被觸發,應該叫。 任何幫助表示讚賞。
爲什麼不在優化()中調用this-> save()? – ariwez
因爲有兩種不同的行爲。我想要保存文件調用save(),而不是每次開始優化()。 – amol01