@gauravsharma0190 I already said that: mainwindow.h and mainwindow.cpp
I provided you a link where you can learn how signals and slots in Qt work, here it is again: http://doc.qt.io/qt-5.7/signalsandslots.html
Please read it! Else you will not be able to use Qt much - signals/slots is one of the most important concepts in Qt.
Short description: QPushButton has a signal clicked() (see http://doc.qt.io/qt-5/qabstractbutton.html#clicked). This signal is emitted when user presses the button. You need to connect a slot to that signal, then this slot will be called when you press the button.

@jsulm
i got it tht how to use push button.
using connect i know it because i did it with my code.
but i want to know how to declare and defination of function in qt and use these in pushbutton.
Like we do in c as declare and defination of function and use it main()
as in c++ declare and defination and use it in main function or classes.
please give me a simple example or link.

@gauravsharma0190 I don't understand the problem. Qt is not a programming language. You use C++ with qt. So you define and use your function/method as any other function/method in C++.
I already gave you an example showing how to use a push button to execute a method when the button is clicked. Isn't that what you want to do?
Please explain what is the problem! Maybe some code?

Hi
As @jsulm says, its a bit unclear what you ask.
You can use functions just like you would in c, but in c++ gui program,
normally main is the not the center of the application. QMainwindow is or some other class.
Maybe this helps:

Yes sir see i have a c code of opencv which process the image.
Now my problem is i want to use this code with qt as when button is pressed my push button calls the function of that C code in which main part of Process is defined.
Here is the C code.
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>

return 0;
}
Now i make a Push button Name Process_image in MainWindow.ui and connect to slot as clicked() by right clicking of mouse.
here comes the slot to mainwindow.cpp
void mainwidow::Process_image_clicke()
{
}
Now i don't understand how to make function of my C code and use it in Pusebutton.

@jsulm Yes sir see i have a c code of opencv which process the image.
Now my problem is i want to use this code with qt as when button is pressed my push button calls the function of that C code in which main part of Process is defined.
Here is the C code.
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>

return 0;
}
Now i make a Push button Name Process_image in MainWindow.ui and connect to slot as clicked() by right clicking of mouse.
here comes the slot to mainwindow.cpp
void mainwidow::Process_image_clicke()
{
}
Now i don't understand how to make function of my C code and use it in Pusebutton.

@gauravsharma0190 Where is this function declared? In which header file? "function not declared" means the function is not known. You have to make it visible including the header file. It is the same story as in C.

Sorry, but the code you posted is invalid C/C++! First of all: why do you have 2 main functions?
Why did you put other functions inside void MainWindow::onTrackball_clicked(int,void*)? This is not going to compile and I'm not going to fix it for you. How familiar are you actually with C/C++?
What you have to do is: do not put the C function definitions inside void MainWindow::onTrackball_clicked(int,void*), instead put them inside another source code file and header, include the header file in MainWindow and then call the functions in void MainWindow::onTrackball_clicked(int,void*). As an alternative you can have those C functions in MainWindow.cpp but not inside void MainWindow::onTrackball_clicked(int,void*) !

@gauravsharma0190 You call it like this CannyThreshold(0, 0); and in ontrack.cpp it is defined like void CannyThreshold(int, void*). But in ontrack.h it is void cannyThresold(int,void*); please fix the name of the function.