Have you ever heard about signals and slots mechanism? Create slot, where you'll call one of those methods and connect it to clicked() signal.
Let's say that your button is named "pushButton1" and your window class name is "Window"
window.h
(...)
protected slots:
void resizeWindow();
(...)
(...)
protected slots:
void resizeWindow();
(...)
To copy to clipboard, switch view to plain text mode
window.cpp
Window::Window(...)
{
(...)
connect(ui->pushButton1, SIGNAL(clicked()), this, SLOT(resizeWindow()));
(...)
}
void Window::resizeWindow(){
/* here do what you want
this->resize(QSize(x, y));
for example */
}
Window::Window(...)
{
(...)
connect(ui->pushButton1, SIGNAL(clicked()), this, SLOT(resizeWindow()));
(...)
}
void Window::resizeWindow(){
/* here do what you want
this->resize(QSize(x, y));
for example */
}
To copy to clipboard, switch view to plain text mode
Bookmarks