look what exactly i would like: i have a very long program in qtc++ ui, i want to divide my programmer in many file ! simple example : instead to write all this: void MainWindow::on_pushButton_S0_clicked() { if(Card_type_R==0) { ui->stackedWidget_2->setCurrentIndex(14); } if(Card_type_R==1) { ui->stackedWidget_2->setCurrentIndex(22); } } i want to write this: void MainWindow::on_pushButton_S0_clicked() { function(): } the program function must be in another file (a.cpp or b.hpp, or c.h....)... thanks for your help
A solution, you just have to create a new file (a new class) so thanks to include call the file in your main file. Then create an object of this class to have access to the function of the latter in the concerned class. Example. class A class B enter class A then include class B (thanks to #include) then create an object on class B in class A and call the function located in class B through the object. We hope we have understood and answered you.