QT作业补

2023-6-13作业补

简易功能

//头文件
#ifndef WINDOW_H
#define WINDOW_H

#include <QWidget>
#include<QDebug>
#include<QPushButton>
#include<QString>
#include<QLineEdit>
#include<QCheckBox>
QT_BEGIN_NAMESPACE
namespace Ui { class Window; }
QT_END_NAMESPACE

class Window : public QWidget
{
    Q_OBJECT

public:
    Window(QWidget *parent = nullptr);
    ~Window();

private:
    Ui::Window *ui;
};
#endif // WINDOW_H


//源文件
#include "window.h"
#include "ui_window.h"

Window::Window(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Window)
{
    this->resize(620,300);        //主窗口
    this->setWindowTitle("GoAshore");      //标题
    this->setWindowIcon(QIcon("C:/Users/choice/Desktop/Qt/file/icon_nhgbq8i4bf/icon_nhgbq8i4bf/QQ.png"));
    this->setWindowOpacity(.77);
    this->setStyleSheet("background-color:orange;""border-radius:5px;");

    QPushButton*btnW=new QPushButton;    //logo框
    btnW->setParent(this);
    btnW->resize(620,110);
    btnW->move(0,0);
    btnW->setStyleSheet("background-color:cyan;""border-radius:5px;");
    btnW->setIcon(QIcon("C:/Users/choice/Desktop/Qt/file/icon_nhgbq8i4bf/icon_nhgbq8i4bf/aichegujiabeifen6.png"));


    QPushButton*btn=new QPushButton;     //按钮1
    btn->setParent(this);
    btn->resize(140,35);
    btn->setText(">Cancel<");
    btn->setIcon(QIcon("C:/Users/choice/Desktop/Qt/file/icon_nhgbq8i4bf/icon_nhgbq8i4bf/quxiao.png"));
    btn->move(390,240);
    btn->setStyleSheet("background-color:grey;""border-radius:10px;");

    QPushButton*btn1=new QPushButton(this);    //按钮2
    btn1->resize(btn->size());
    btn1->setText(">Begin<");
    btn1->setIcon(QIcon("C:/Users/choice/Desktop/Qt/file/icon_nhgbq8i4bf/icon_nhgbq8i4bf/denglu_1.png"));
    btn1->move(150,240);
    btn1->setStyleSheet("border-radius:10px;""background-color:grey;");

    QLineEdit*edit=new QLineEdit(this);    //文本1
    edit->move(135,190);
    edit->resize(410,40);
    edit->setEchoMode(QLineEdit::Password);
    edit->setPlaceholderText("  Password");
    edit->setStyleSheet("border-radius:15px;""background-color:white;");

    QLineEdit*edit1=new QLineEdit(this);    //文本2
    edit1->resize(edit->size());
    edit1->move(135,140);
    edit1->setPlaceholderText("  User");
    edit1->setStyleSheet("border-radius:15px;""background-color:white;");


    QPushButton*btn2=new QPushButton;    //logo二
    btn2->setParent(this);
    btn2->resize(55,40);
    btn2->setIcon(QIcon("C:/Users/choice/Desktop/Qt/file/icon_nhgbq8i4bf/icon_nhgbq8i4bf/denglu.png"));
    btn2->move(60,140);
    btn2->setStyleSheet("background-color:grey;""border-radius:5px;");

    QPushButton*btn3=new QPushButton;    //logo三
    btn3->setParent(this);
    btn3->resize(55,40);
    btn3->setIcon(QIcon("C:/Users/choice/Desktop/Qt/file/icon_nhgbq8i4bf/icon_nhgbq8i4bf/denglumima.png"));
    btn3->move(60,190);
    btn3->setStyleSheet("background-color:grey;""border-radius:5px;");

}

Window::~Window()
{
    delete ui;
}

窗口

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值