Johnnyj2j
7th July 2012, 16:31
http://i46.tinypic.com/htb2m8.png
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionClose_triggered() //Close the Program "An action in the file menu"
{
}
void MainWindow::on_pushButton_clicked() //Addition
{
}
void MainWindow::on_pushButton_2_clicked() //Subtraction
{
}
void MainWindow::on_pushButton_3_clicked() //Divishion
{
}
void MainWindow::on_pushButton_4_clicked() //Multiplication
{
}
As you can see above im trying to creat a Calculator but iv run into a small problem im extreemly good with C++ which is what im codeing with but i dont now how to use buttons to execute a function or how to hold what is typed in a textline in a variable so if some one could tell me how to do that or show me where i can find a tutorial for it i would be greatfull
also if anyone nows how to close the main window through an action i created called exit that would be great
Thanks in advance sorry if this is noobie :rolleyes:
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionClose_triggered() //Close the Program "An action in the file menu"
{
}
void MainWindow::on_pushButton_clicked() //Addition
{
}
void MainWindow::on_pushButton_2_clicked() //Subtraction
{
}
void MainWindow::on_pushButton_3_clicked() //Divishion
{
}
void MainWindow::on_pushButton_4_clicked() //Multiplication
{
}
As you can see above im trying to creat a Calculator but iv run into a small problem im extreemly good with C++ which is what im codeing with but i dont now how to use buttons to execute a function or how to hold what is typed in a textline in a variable so if some one could tell me how to do that or show me where i can find a tutorial for it i would be greatfull
also if anyone nows how to close the main window through an action i created called exit that would be great
Thanks in advance sorry if this is noobie :rolleyes: