当前位置: 首页> 财经> 产业 > 火星wap建站_营销策略的概念和内容_广州aso优化公司 有限公司_企业网站建设推广

火星wap建站_营销策略的概念和内容_广州aso优化公司 有限公司_企业网站建设推广

时间:2025/7/9 16:23:20来源:https://blog.csdn.net/m0_46380369/article/details/142621795 浏览次数:2次
火星wap建站_营销策略的概念和内容_广州aso优化公司 有限公司_企业网站建设推广

1.头文件

#ifndef LOGINWINDOW_H
#define LOGINWINDOW_H#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QVBoxLayout>class LoginWindow : public QWidget {Q_OBJECTpublic:// 构造函数LoginWindow(QWidget *parent = nullptr);private:// 用户名输入框QLineEdit *usernameEdit;// 密码输入框QLineEdit *passwordEdit;// 登录按钮QPushButton *loginButton;
};#endif

2.源文件

#include "loginwindow.h"// 构造函数实现
LoginWindow::LoginWindow(QWidget *parent) : QWidget(parent) {// 创建布局和控件QVBoxLayout *layout = new QVBoxLayout(this);usernameEdit = new QLineEdit(this);usernameEdit->setPlaceholderText("account"); // 设置用户名占位符passwordEdit = new QLineEdit(this);passwordEdit->setEchoMode(QLineEdit::Password); // 设置为密码模式passwordEdit->setPlaceholderText("password"); // 设置密码占位符loginButton = new QPushButton("login", this);// 添加控件到布局layout->addWidget(usernameEdit);layout->addWidget(passwordEdit);layout->addWidget(loginButton);
}

3.main函数

#include "loginwindow.h"
#include <QApplication>int main(int argc, char *argv[]) {QApplication app(argc, argv);LoginWindow window; // 创建窗口实例window.resize(300, 150);window.setWindowTitle("login");window.show();return app.exec();
}

关键字:火星wap建站_营销策略的概念和内容_广州aso优化公司 有限公司_企业网站建设推广

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: