#include "form1.h"
#include "ui_form1.h"
#include "form2.h"
#include <QPixmap>
#include <QPalette>
#include <QDesktopWidget>
#include <QRect>
#include <QSize>
#include <QApplication>
//#include <QIcon>
#include <QMouseEvent>
#include <phonon/MediaObject>
#include <phonon/AudioOutput>
#include <phonon/VolumeSlider>
#include <QLibrary>
#include <windows.h>
ui(new Ui::Form1)
{
ui->setupUi(this);
connect(ui->pushButton_24,SIGNAL(clicked()),this,SLOT(showMinimized()));
// These three line is used for remove 'window title bar'
this->setWindowFlags(Qt::MSWindowsFixedSizeDialogHint);
this->setWindowFlags(Qt::CustomizeWindowHint);
this->setWindowFlags(Qt::FramelessWindowHint);
//this->setWindowFlags(Qt::SplashScreen);
//background image using 'pixmap' and 'palette'
this->setFixedSize(270,350);
QPixmap pixmap1
("E:/workplace/image/two.JPG");
//resize image if it is larger than screen size.
QRect rect
= desktopWidget
->availableGeometry
();
QSize size
(rect.
width() , rect.
height());
//resize as per your requirement..
//QPixmap pixmap(pixmap1.scaled(size));
QPixmap pixmap
(pixmap1.
scaled(270,
350));
p.
setBrush(QPalette::Background, pixmap
);
setPalette(p);
//ui->pushButton->setIcon(QIcon("E:/workplace/image/01.gif"));
//connect(ui->horizontalSlider,SIGNAL(volumeChanged(Phonon::MediaObject,Phonon::AudioOutput)),
//this,SLOT(setVolumeDecibel(Phonon::MediaObject,Phonon::AudioOutput)));
QLibrary myLib
("C:/Windows/System32/MMSYSTEM.DLL");
myLib.load();
if (myLib.isLoaded())
{
connect(ui->horizontalSlider,SIGNAL(sliderMoved(int)),this,SLOT(setAudioOutput()));
}
//Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);
//Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory);
//Phonon::createPath(mediaObject, audioOutput);
//mediaObject->setCurrentSource(Phonon::MediaSource("C:/Windows/Suiystem32/MMSYSTEM.DLL"));
//Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider;
//volumeSlider->setAudioOutput(audioOutput);
}
Form1::~Form1()
{
delete ui;
}
void Form1::one()
{
text1+="1";
//text1+=ui->pushButton->text();
ui->lineEdit->setText(text1);
}
void Form1::two()
{
text1+="2";
//text1+=ui->pushButton_4->text();
ui->lineEdit->setText(text1);
}
void Form1::three()
{
text1+="3";
//text1+=ui->pushButton_3->text();
ui->lineEdit->setText(text1);
}
void Form1::four()
{
text1+="4";
//text1+=ui->pushButton_2->text();
ui->lineEdit->setText(text1);
}
void Form1::five()
{
text1+="5";
//text1+=ui->pushButton_5->text();
ui->lineEdit->setText(text1);
}
void Form1::six()
{
text1+="6";
//text1+=ui->pushButton_6->text();
ui->lineEdit->setText(text1);
}
void Form1::seven()
{
text1+="7";
//text1+=ui->pushButton_7->text();
ui->lineEdit->setText(text1);
}
void Form1::eight()
{
text1+="8";
//text1+=ui->pushButton_8->text();
ui->lineEdit->setText(text1);
}
void Form1::nine()
{
text1+="9";
//text1+=ui->pushButton_9->text();
ui->lineEdit->setText(text1);
}
void Form1::star()
{
text1+="*";
//text1+=ui->pushButton_10->text();
ui->lineEdit->setText(text1);
}
void Form1::zero()
text1+="0";
//text1+=ui->pushButton_11->text();
ui->lineEdit->setText(text1);
}
void Form1::hash()
{
text1+="#";
//text1+=ui->pushButton_12->text();
ui->lineEdit->setText(text1);
}
void Form1::clear()
{
text1 = "";
ui->lineEdit->clear();
}
void Form1::showForm2()
{
Form2 *frm2 = new Form2;
frm2->show();
//this->close();
//this->destroy();
}
void Form1::closeSecondWindow()
{
this->close();
}
{
if (event->buttons() & Qt::LeftButton)
{
move(event->globalPos() - m_dragPosition);
event->accept();
}
}
{
if (event->button() == Qt::LeftButton)
{
m_dragPosition = event->globalPos() - frameGeometry().topLeft();
event->accept();
}
}