#include "numericalsystemsconverter.h"
#include "ui_numericalsystemsconverter.h"
#include <Qt>
#include <QLabel>
#include <QLineEdit>
#include <QCommandLinkButton>
NumericalSystemsConverter
::NumericalSystemsConverter(QWidget *parent
) : ui(new Ui::NumericalSystemsConverter)
{
ui->setupUi(this);
title->setGeometry(0,0,400,30);
title->setStyleSheet("font-size:20px;");
title->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
title->setText("Numerical Systems Converter");
decimal_entry->setGeometry(0,50,400,30);
decimal_entry->setClearButtonEnabled(true);
decimal_entry->setStyleSheet("font-size:20px;");
decimal_entry->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
decimal_entry->setPlaceholderText("Enter Your Decimal Number Here...");
QCommandLinkButton *dec2bin=new QCommandLinkButton(this);
dec2bin->setGeometry(0,90,400,50);
dec2bin->setStyleSheet("font-size:20px;");
dec2bin->setText("Convert To Binary");
result->setGeometry(0,250,400,30);
result->setStyleSheet("font-size:20px;");
result->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
result->setText("The Result Should Appear Here...");
QObject::connect(dec2bin,
SIGNAL(click
()),result,
SLOT(QLabel::setText("Hello World")));
}
NumericalSystemsConverter::~NumericalSystemsConverter()
{
delete ui;
}
#include "numericalsystemsconverter.h"
#include "ui_numericalsystemsconverter.h"
#include <Qt>
#include <QLabel>
#include <QLineEdit>
#include <QCommandLinkButton>
NumericalSystemsConverter::NumericalSystemsConverter(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::NumericalSystemsConverter)
{
ui->setupUi(this);
QLabel *title=new QLabel(this);
title->setGeometry(0,0,400,30);
title->setStyleSheet("font-size:20px;");
title->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
title->setText("Numerical Systems Converter");
QLineEdit *decimal_entry=new QLineEdit(this);
decimal_entry->setGeometry(0,50,400,30);
decimal_entry->setClearButtonEnabled(true);
decimal_entry->setStyleSheet("font-size:20px;");
decimal_entry->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
decimal_entry->setPlaceholderText("Enter Your Decimal Number Here...");
QCommandLinkButton *dec2bin=new QCommandLinkButton(this);
dec2bin->setGeometry(0,90,400,50);
dec2bin->setStyleSheet("font-size:20px;");
dec2bin->setText("Convert To Binary");
QLabel *result=new QLabel(this);
result->setGeometry(0,250,400,30);
result->setStyleSheet("font-size:20px;");
result->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
result->setText("The Result Should Appear Here...");
QObject::connect(dec2bin,SIGNAL(click()),result,SLOT(QLabel::setText("Hello World")));
}
NumericalSystemsConverter::~NumericalSystemsConverter()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
Bookmarks