#include "mywnd.h"
#include "ui_mywnd.h"
#include<iostream>
#include<QDebug>
#include<QIcon>
#include<QPushButton>
#include<QLineEdit>
#include<QLabel>
mywnd::mywnd(QWidget *parent)
: QWidget(parent)
, ui(new Ui::mywnd)
{
ui->setupUi(this);
qDebug()<<this->size();
qDebug()<<this->width();
qDebug()<<this->height();
this->resize(1000,800);
this->resize(QSize(500,400));
this->setMaximumSize(1000,800);
this->setMinimumSize(200,100);
this->setFixedSize(500,400);
qDebug()<<this->windowTitle();
this->setWindowTitle("Widget");
this->setWindowIcon(QIcon("D:\\hqyj\\wodepeizhenshi"));
//this->setStyleSheet("background-color:pink");
//this->setWindowFlag();
QPushButton *btn1=new QPushButton;
btn1->setParent(this);
btn1->setText("登录");
btn1->resize(100,50);
btn1->setIcon(QIcon("D:\\hqyj\\login"));
btn1->move(200,325);
QPushButton *btn2=new QPushButton(this);
btn2->setText("取消");
btn2->setIcon(QIcon("D:\\hqyj\\cancel"));
btn2->resize(btn1->size());
btn2->move(btn1->x()+150,btn1->y());
QLineEdit *edit1=new QLineEdit(this);
edit1->resize(200,50);
edit1->move(btn1->x(),btn1->y()-150);
edit1->setMaxLength(6);
edit1->setPlaceholderText("输入用户名");
edit1->setAlignment(Qt::AlignCenter);
QLineEdit *edit2=new QLineEdit(this);
edit2->resize(200,50);
edit2->setEchoMode(QLineEdit::Password);
edit2->move(btn1->x(),btn2->y()-75);
edit2->setPlaceholderText("输入密码");
edit2->setAlignment(Qt::AlignCenter);
QLabel *lab1=new QLabel(this);
lab1->resize(50,50);
lab1->setAlignment(Qt::AlignCenter);
lab1->setPixmap(QPixmap("D:\\hqyj\\userName"));
lab1->setScaledContents(true);
lab1->move(btn1->x()-80,btn2->y()-150);
QLabel *lab2=new QLabel(this);
lab2->resize(50,50);
lab2->setAlignment(Qt::AlignCenter);
lab2->setPixmap(QPixmap("D:\\hqyj\\passwd"));
lab2->setScaledContents(true);
lab2->move(btn1->x()-80,btn2->y()-75);
QLabel *lab3=new QLabel(this);
lab3->resize(500,150);
lab3->setStyleSheet("background-color:yellow;");
lab3->setAlignment(Qt::AlignCenter);
lab3->setPixmap(QPixmap("D:\\hqyj\\logo"));
lab3->setScaledContents(true);
}
mywnd::~mywnd()
{
delete ui;
}