QTday1

QTday1_第1张图片

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    //窗口设置
    this->resize(536,445);
    this->setWindowTitle("(>△<)");
    this->setWindowIcon(QIcon("C:\\桌面\\学习\\c++与qt\\mika.jpg"));
    this->setStyleSheet("background-color:white");//设置背景颜色
    //背景设置
    this->setStyleSheet("background-color:white");
    QLabel *lab1 =new QLabel(this);
    QMovie *mv1 = new QMovie("C:\\桌面\\学习\\c++与qt\\ken.gif");
    lab1->resize(536,160);
    lab1->setMovie(mv1);
    mv1->setScaledSize(lab1->size());
    mv1->start();
    //标签设置
    QLabel *lab2 =new QLabel(this);
    QMovie *mv2 = new QMovie("C:\\桌面\\学习\\c++与qt\\cat1.gif");
    lab2->move(225,160);
    lab2->resize(86,78);
    lab2->setMovie(mv2);
    mv2->setScaledSize(lab2->size());
    mv2->start();
    QLabel *lab3 = new QLabel(this);
    lab3->move(118,318);
    lab3->resize(100,20);
    lab3->setText("自动登录");
    QLabel *lab4 = new QLabel(this);
    lab4->move(218,318);
    lab4->resize(100,20);
    lab4->setText("记住密码");
    QLabel *lab5 = new QLabel(this);
    lab5->move(78,238);
    lab5->resize(40,40);
    lab5->setPixmap(QPixmap("C:\\桌面\\学习\\c++与qt\\吃瘪.jpg"));
    lab5->setScaledContents(true);
    QLabel *lab6 = new QLabel(this);
    lab6->move(78,278);
    lab6->resize(40,40);
    lab6->setPixmap(QPixmap("C:\\桌面\\学习\\c++与qt\\嘲笑.jpg"));
    lab6->setScaledContents(true);

    //行设置
    QLineEdit *ed1 = new QLineEdit(this);
    ed1->move(118,238);
    ed1->resize(300,40);
    ed1->setPlaceholderText("账号");//设置占位
    QLineEdit *ed2 = new QLineEdit(this);
    ed2->move(118,278);
    ed2->resize(300,40);
    ed2->setPlaceholderText("密码");//设置占位
    ed2->setEchoMode(QLineEdit::Password);// 密码形式的不可见

    //按钮设置
    QPushButton *btn1 = new QPushButton("启动",this);
    btn1->resize(150,40);
    btn1->move(193,340);//移动
    btn1->setStyleSheet("background-color:rgb(124,251,254);");
    QPushButton *btn2 = new QPushButton(this);
    btn2->move(318,318);
    btn2->resize(100,20);
    btn2->setText("找回密码");
    QPushButton *btn3 = new QPushButton(this);
    btn3->move(0,425);
    btn3->resize(100,20);
    btn3->setText("注册账号");
}

你可能感兴趣的:(数据库)