• QT_day1


    1. #include "mywidget.h"
    2. MyWidget::MyWidget(QWidget *parent)
    3. : QWidget(parent)
    4. {
    5. //窗口相关设置
    6. this->setWindowTitle("登录窗口");
    7. this->setWindowIcon(QIcon("C:\\Users\\EDY\\Desktop\\pictrue\\qq.png"));
    8. this->setWindowFlag(Qt::FramelessWindowHint);
    9. this->setStyleSheet("background-color:white;border:3px");
    10. this->resize(430,330);
    11. //动图
    12. QLabel *lab1 = new QLabel(this);
    13. lab1->resize(430,120);
    14. QMovie *mv = new QMovie("C:\\Users\\EDY\\Desktop\\pictrue\\motion.gif");
    15. mv->start();
    16. lab1->setMovie(mv);
    17. lab1->setScaledContents(true);
    18. //qq图标
    19. QLabel *lab2 = new QLabel(this);
    20. lab2->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\icon.png"));
    21. lab2->move(15,15);
    22. lab2->resize(30,30);
    23. lab2->setScaledContents(true);
    24. //qq文字
    25. QLabel *lab3 = new QLabel(this);
    26. lab3->setText("QQ");
    27. lab3->setStyleSheet("background-color:transparent;color:white;front:20px");
    28. lab3->move(50,20);
    29. lab3->resize(40,20);
    30. QFont ft;
    31. ft.setPointSize(20);
    32. lab3->setFont(ft);
    33. //账号
    34. QLabel *lab4 = new QLabel(this);
    35. lab4->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\wodepeizhenshi.png"));
    36. lab4->move(96,172);
    37. lab4->resize(15,20);
    38. lab4->setScaledContents(true);
    39. QLineEdit *ed1 = new QLineEdit(this);
    40. ed1->move(121,168);
    41. ed1->resize(230,33);
    42. ed1->setPlaceholderText("QQ号码/手机/邮箱");
    43. //密码
    44. QLabel *lab5 = new QLabel(this);
    45. lab5->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\passwd.jpg"));
    46. lab5->move(96,200);
    47. lab5->resize(15,20);
    48. lab5->setScaledContents(true);
    49. QLineEdit *ed2 = new QLineEdit(this);
    50. ed2->move(121,196);
    51. ed2->resize(230,33);
    52. ed2->setPlaceholderText("密码");
    53. ed2->setEchoMode(QLineEdit::Password);
    54. //自动登录
    55. QCheckBox *box1 = new QCheckBox(this);
    56. box1->move(96,240);
    57. box1->resize(15,15);
    58. QLabel *lab6 = new QLabel(this);
    59. lab6->setText("自动登录");
    60. lab6->move(115,237);
    61. lab6->resize(50,20);
    62. //记住密码
    63. QCheckBox *box2 = new QCheckBox(this);
    64. box2->move(195,240);
    65. box2->resize(15,15);
    66. QLabel *lab7 = new QLabel(this);
    67. lab7->setText("记住密码");
    68. lab7->move(214,237);
    69. lab7->resize(50,20);
    70. //找回密码
    71. QLabel *lab8 = new QLabel(this);
    72. lab8->setText("找回密码");
    73. lab8->move(294,237);
    74. lab8->resize(50,20);
    75. //登录
    76. QPushButton *btn1 = new QPushButton("登录",this);
    77. btn1->move(96,270);
    78. btn1->resize(250,36);
    79. btn1->setStyleSheet("background-color:rgb(10,200,255);color:white;border-radius:3");
    80. //注册账号
    81. QPushButton *btn2 = new QPushButton("注册账号",this);
    82. btn2->move(15,306);
    83. btn2->resize(55,25);
    84. //二维码
    85. QLabel *lab9 = new QLabel(this);
    86. lab9->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\code.png"));
    87. lab9->move(393,300);
    88. lab9->resize(30,30);
    89. lab9->setScaledContents(true);
    90. //头像
    91. QLabel *lab10 = new QLabel(this);
    92. lab10->setPixmap(QPixmap("C:\\Users\\EDY\\Desktop\\pictrue\\qq.png"));
    93. lab10->move(180,90);
    94. lab10->resize(70,70);
    95. lab10->setScaledContents(true);
    96. }
    97. MyWidget::~MyWidget()
    98. {
    99. }

  • 相关阅读:
    【python】--python环境安装及配置
    NLP-信息抽取-三元组-联合抽取-多任务学习-2019:spERT【采用分类的思想实现联合抽取,实体抽取和关系抽取模型均为分类模型】
    收藏:不能不刷的数字后端面试题,含解析
    跨平台开发:在Linux上构建Windows应用程序
    SiTime扩频时钟振荡器
    MySQL 开启远程连接
    (iView)表格JSON字符串转为键值对,去掉对象的双引号和花括号,省略号隐藏,悬浮显示完整内容
    用Unity来下一场雪吧——Particle System 下雪粒子特效
    一文看懂推荐系统:排序04:视频播放建模
    运维知识点-Apache HTTP Server
  • 原文地址:https://blog.csdn.net/2301_79218296/article/details/133890248