当前位置: 首页 > news >正文

静海网站建设制作如何更改wordpress后台登陆密码

静海网站建设制作,如何更改wordpress后台登陆密码,h5case 网站,wordpress缓冲1. QString 字符串类 QString是Qt中的字符串类#xff0c;与C/C不同的是#xff0c;不再使用ASCII编码#xff0c;而使用Unicode编码。因此一个字符不是8位的char#xff0c;而是16位的QChar#xff0c;这就是为什么之前一个汉字占用一个字符的原因。、 QString几乎向前兼…1. QString 字符串类 QString是Qt中的字符串类与C/C不同的是不再使用ASCII编码而使用Unicode编码。因此一个字符不是8位的char而是16位的QChar这就是为什么之前一个汉字占用一个字符的原因。、 QString几乎向前兼容所有std::string的API。 部分常用函数如下 // 数字 → QString // 参数1要转换的数字 // 参数2进制 // 返回值转换后的字符串 QString QString::number(long n, int base 10) [static]// 数字 → QString // 参数1要转换的数字 // 参数2进制 // 返回值转换后的字符串支持链式调用 QString QString::setNum(int n, int base 10)// QString → 数字 // 参数1转换是否成功 // 参数2进制 // 返回值转换的结果如果转换失败为0 int QString::toInt(bool * ok 0, int base 10) const#include dialog.hDialog::Dialog(QWidget *parent) : QDialog(parent) {// UnicodeQString text 你好あいうㅙㅖабв;// 遍历for(int i0;itext.count();i){// at效率更高[]可以作为左值qDebug() text.at(i);}int a 1;// 数字 → QStringtext QString::number(a);qDebug() text;a 63;QString s QString::number(a, 16); // s 3fQString t QString::number(a, 16).toUpper(); // t 3F// 数字 → QStringtext.setNum(a).append(fklsdh);qDebug() text;// QString → 数字// 函数名称to数据类型text 0;bool result;a text.toInt(result,10);qDebug() a;qDebug() result; }Dialog::~Dialog() {}2. 容器类 Qt基于C的容器重新提供了更轻巧、更安全和更易于使用的新容器类。这些新的容器类可以使程序最终的可执行文件体积减小同时这些容器类可以被多个线程直接读取也兼容C绝大多数API。 2.1 QList类 本例不光讲解容器类的使用同时增加自定义C类的代码。 创建一个C类的操作步骤如下 1. 在Qt Creator中选中项目名称鼠标右键点击“添加新文件”。 2. 在弹出的窗口中按照下图所示进行操作。 3. 在弹出的窗口中输入类名后点击“下一步”。 4. 在项目管理界面直接点击完成。 Qt的容器类都增加了Java风格迭代器与C的STL风格相比只有语法上的不同。对应关系如下 C STL 风格Java风格QList::const_iteratorQListIteratorQList::iteratorQMutableListIterator #ifndef STUDENT_H #define STUDENT_H#include QStringclass Student { public:Student(QString,int,QString);QString getName() const;void setName(const QString value);int getAge() const;void setAge(int value);QString getMajor() const;void setMajor(const QString value);private:QString name;int age;QString major; // 专业 };#endif // STUDENT_H#include student.hStudent::Student(QString name,int age,QString major):name(name) {this-age age;this-major major; }QString Student::getName() const {return name; }void Student::setName(const QString value) {name value; }int Student::getAge() const {return age; }void Student::setAge(int value) {age value; }QString Student::getMajor() const {return major; }void Student::setMajor(const QString value) {major value; }#ifndef DIALOG_H #define DIALOG_H#include QDialog #include QDebug #include QList // 引入学生类 #include student.hclass Dialog : public QDialog {Q_OBJECTpublic:Dialog(QWidget *parent 0);~Dialog(); };#endif // DIALOG_H#include dialog.hDialog::Dialog(QWidget *parent): QDialog(parent) {QListStudent class23061;Student s1(李新宇,33,光电);Student s2(贾洪瑞,18,电子);Student s3(谢德政,22,畜牧);Student s4(陈凯,62,光电);Student s5(王俊杰,63,通信);Student s6(何凯,67,保安);// 增class23061.append(s1);class23061 s2 s4 s5;class23061.prepend(s6); // 前插class23061.insert(1,s3); // 在第二个位置插入s3// 删class23061.removeAt(2); // 删除第三个 // class23061.removeAll(s4); // 删除所有相同元素class23061.removeFirst(); // 删除第一个class23061.removeLast(); // 删除最后一个 // class23061.removeOne(s4); // 删除相同元素的第一个// 改class23061.replace(1,s6); // 把第二个元素替换为s6// 遍历for(int i0;iclass23061.size();i){Student s class23061.at(i);qDebug() s.getName() s.getAge() s.getMajor();}// Java迭代器QListIteratorStudent iter(class23061); // 创建迭代器对象while(iter.hasNext()) // 后续有无元素{Student s iter.next(); // 移动迭代器且取出元素qDebug() s.getName() s.getAge() s.getMajor();} }Dialog::~Dialog() {}2.2 QMap类 QMap也拥有Java风格迭代器 C STL 风格Java风格QMapK,V::const_iteratorQMapIteratorK,VQMapK,V::iteratorQMutableMapIteratorK,V dialog.cpp #include dialog.hDialog::Dialog(QWidget *parent) : QDialog(parent) {QMapQString,int map;// 增加map.insert(月薪,10000);map.insert(年龄,20);map.insert(身高,199);map.insert(体重,100);// 移除// 返回值表示移除的键值对数量map.remove(体重);// 判断某个键在不在if(map.contains(身高))qDebug() 包含身高键;elseqDebug() 不包含身高键;// 修改map[身高] 188;// 取出int result map.value(月薪,-1);qDebug() result;// Java风格迭代器QMutableMapIteratorQString,int iter(map);while(iter.hasNext()){iter.next(); // 向后移动QString k iter.key();int v iter.value();qDebug() k v;}qDebug() map; }Dialog::~Dialog() {}3. Qt数据类型 3.1 跨平台类型 Qt是一种跨平台的开发框架需要保证常见的基本数据类型在各平台具有统一的长度Qt因此为了这些数据类型定义了类型符号。 Qt 数据类型等效定义字节数qint8signed char1qint16signed short2qint32signed int4qint64long long int8qlonglonglong long int8quint8unsigned char1quint16unsigned short2quint32unsigned int4quint64unsigned long long int8qulonglongunsigned long long int8ucharunsigned char1ushortunsigned short2uintunsigned int4ulongunsigned long8qrealdouble8qfloat162 3.2 统一数据类型 QVariant QVariant 类是Qt常见数据类型的统一类型可以完成与常见类型的相互转换。 后续有一些函数的参数或返回值使用此类型因此可以支持很多类型的匹配。 QVariant value(3.14); QString text value.toString(); // “3.14” qDebug() text;3.3 QStringList字符串列表 QStringList是一个字符串列表几乎等同于QList。 4. 时间与日期处理熟悉 在Qt中使用QDate类处理日期使用QTime类处理时间使用QDateTime类同时处理日期和时间。 QDateTime类常用功能有 // 返回1970-1-1 00:00:00到到现在的毫秒数基于格林威治时间 qint64 QDateTime::currentMSecsSinceEpoch() [static]以下是一个生成随机数的例子 qint64 time QDateTime::currentMSecsSinceEpoch(); qDebug() time; // 把time作为种子 qsrand(time); // 生成 1-45 随机数 int rand qrand()%451; qDebug() rand;以下是一个时间戳的例子qint64 time QDateTime::currentMSecsSinceEpoch(); ui-setupUi(this); qDebug() QDateTime::currentMSecsSinceEpoch() - time;// 基于当前时区从系统中返回一个包含当前日期和时间的QDatetime对象 QDateTime QDateTime::currentDateTime() [static]// 把QDateTime中的数据转换为固定格式的字符串 // 参数为格式 QString QDateTime::toString(const QString format) const以下是一个格式化日期和时间的例子 // 拿到QDateTime对象包含当前数据QDateTime dt QDateTime::currentDateTime();// 转换为固定格式QString text dt.toString(yyyy-MM-dd hh:mm:ss);qDebug() text; // 2023-10-20 16:00:44text dt.toString(yyyy年MM月dd日);qDebug() text; // 2023年10月20日相关组件 5. QTimer定时器类掌握 QTimer是定时器类用于设定一个倒计时或者周期性触发的效果。 QTimer的常用属性有 ● interval : int 如果是一次性的定时器此属性表示倒计时时间如果是周期性的定时器此属性表示间隔时间。单位毫秒 ● singleShot : bool 表示是否是一次性 ● active : const bool 表示当前定时器是否正在运行 QTimer常用函数如下 // 启动定时器如果定时器已经在运行调用此函数会停止定时器运行并重新运行 void QTimer::start() [slot]// 停止定时器 void QTimer::stop() [slot]// 定时器每次触发时发射的信号 void QTimer::timeout() [signal]例子电子表 –来自百度网盘超级会员V6的分享 QLcdNumber组件使用 // 给QLcdNumber设置字符串内容 ui-lcdNumber-display(11:23:23);注意定时器对象要设置为堆内存不归ui指针管 对应代码 dialog.h #ifndef DIALOG_H #define DIALOG_H#include QDialog #include QTimer // 定时器 #include QDateTimenamespace Ui { class Dialog; }class Dialog : public QDialog {Q_OBJECTpublic:explicit Dialog(QWidget *parent 0);~Dialog();private:Ui::Dialog *ui;QTimer* timer; // 定时器对象private slots:// 定时器触发的槽函数void timeoutSlot();}; #endif // DIALOG_Hdialog.cpp #include dialog.h #include ui_dialog.hDialog::Dialog(QWidget *parent) :QDialog(parent),ui(new Ui::Dialog) {ui-setupUi(this); // 0// 手动调用槽函数刷新时间// timeoutSlot(); // 解决刚刚运行时显示0的问题timer new QTimer(this); // 创建定时器对象timer-setSingleShot(false); // 设置为周期性timer-setInterval(1000); // 设置间隔时间1000msconnect(timer,SIGNAL(timeout()),this,SLOT(timeoutSlot()));timer-start(); // 启动定时器 } Dialog::~Dialog() {delete ui; } void Dialog::timeoutSlot() {// 获得当前时间QDateTime dt QDateTime::currentDateTime();// 格式化QString text dt.toString(hh:mm:ss);// 设置显示ui-lcdNumber-display(text); }
http://www.zqtcl.cn/news/493519/

相关文章:

  • 鞍山商城网站建设国外代理ip
  • 东莞网站设计风格wordpress不能启动怎么解决
  • 社交网站制作临海建设局网站导航
  • 合肥需要做网站的公司佛山网站制作的公司
  • 哪里有做网站平台建设网站如何盈利
  • dw网站制作素材单人做网站需要掌握哪些知识
  • 网络推广产品公司做移动网站优化首
  • 网站建设dqcx广告网络用语
  • 烟台网站建设首推企汇互联见效付款手机网站宽度自适应
  • 网站建设小程序湖南wordpress插件刷不出来
  • 中国建设银行网站首页joy荣添创意网站建设
  • 市场营销网站网站开发技术项目说明书
  • 销售网站开发的背景wordpress虚线框可序列
  • 免费响应式网站深圳关键词优化
  • 网站宣传模式做微视频的网站
  • 网站改版后的内容福建 网站建设
  • 网站的文件夹企业邮箱在哪查看
  • 开了360网站卫士ssl如何做301深圳制作网站开发费用
  • 在哪里做马可波罗网站公众号自己做电影网站
  • 网站建设音乐插件怎么弄陕西城乡建设部网站首页
  • 全国免费自学网站打开百度网站首页
  • 国外网站开发公司晋江论坛网
  • 问卷调查网站个人网站源码免费下载
  • 网站备案信息核验单填写建设企业网站价钱
  • 相城建设监理有限公司网站网页设计中html代码
  • 做农产品网站高端汽车
  • 工信部网站首页wordpress网站搬家vps
  • wordpress 淘客插件长沙排名优化公司
  • 网站首页怎么制作过程如何自己创作一个游戏
  • 自己做企业网站在哪学习建网站