/**
******************************************************************************
* @link https://blog.csdn.net/sy_lixiang
* @author EMMA
* @version V1.0.0
* @date 2024.09.13
* @brief 转载请注明出处
******************************************************************************
*/
#include "qsizedemo.h"
#include <QIcon>
#include <QGroupBox>
#include "source/widget_btnqsize.h"
#include "source/widget_btnqsize2.h"
#include "source/widget_btnboundedto.h"
#include "source/widget_btnexpandedto.h"
#include "source/widget_btnheight.h"
#include "source/widget_btnisempty.h"
#include "source/widget_btnisnull.h"
#include "source/widget_btnisvalid.h"
#include "source/widget_btnrheight.h"
#include "source/widget_btnrwidth.h"
#include "source/widget_btnscale.h"
#include "source/widget_btnscale2.h"
#include "source/widget_btnscaled.h"
#include "source/widget_btnscaled2.h"
#include "source/widget_btnsetheight.h"
#include "source/widget_btnsetwidth.h"
#include "source/widget_btntocgsize.h"
#include "source/widget_btntranspose.h"
#include "source/widget_btntransposed.h"
#include "source/widget_btnwidth.h"
#include "source/widget_btnoperator1.h"
#include "source/widget_btnoperator2.h"
#include "source/widget_btnoperator3.h"
#include "source/widget_btnoperator4.h"
#include "source/widget_btnoperator5.h"
#include "source/widget_btnoperator6.h"
#include "source/widget_btnoperator7.h"
#include "source/widget_btnoperator8.h"
#include "source/widget_btnoperator9.h"
#include "source/widget_btnoperator10.h"
#include "source/widget_btnoperator11.h"
#include "source/widget_btnoperator12.h"
#include "source/widget_btnoperator13.h"
QSizeDemo::QSizeDemo(QWidget *parent)
: QWidget(parent)
{
//设置窗体标题
setWindowTitle(tr("CH2105,Qt基础类之QSize尺寸类"));
//设置窗体图标
QString iconPath="E:\\Git-workdir\\learn_QT5\\learn_-qt5\\QT5\\CH21\\CH2105\\QSizeDemo\\";
QString iconFileName="application-one.png";
QString iconFullPath=iconPath+iconFileName;
setWindowIcon(QIcon(iconFullPath));
//左侧GroupBox
leftGroupBox=new QGroupBox();
leftGroupBox->setTitle(tr("成员函数"));
//右上GroupBox
rightTopGroupBox=new QGroupBox();
rightTopGroupBox->setTitle(tr("非成员函数"));
//右下GroupBox
rightBottomGroupBox=new QGroupBox();
rightBottomGroupBox->setTitle(tr("QSize帮助"));
//左侧功能按钮设置
//成员函数按钮
btnQSize=new QPushButton();
btnQSize2=new QPushButton();
btnboundedTo=new QPushButton();
btnexpandedTo=new QPushButton();
btnheight=new QPushButton();
btnisEmpty=new QPushButton();
btnisNull=new QPushButton();
btnisValid=new QPushButton();
btnrheight=new QPushButton();
btnrwidth=new QPushButton();
btnscale=new QPushButton();
btnscale2=new QPushButton();
btnscaled=new QPushButton();
btnscaled2=new QPushButton();
btnsetHeight=new QPushButton();
btnsetWidth=new QPushButton();
btntoCGSize=new QPushButton();
btntranspose=new QPushButton();
btntransposed=new QPushButton();
btnwidth=new QPushButton();
btnoperator1=new QPushButton();
btnoperator2=new QPushButton();
btnoperator3=new QPushButton();
btnoperator4=new QPushButton();
btnQSize->setText(tr("QSize::QSize()"));
btnQSize2->setText(tr("QSize::QSize(int width, int height)"));
btnboundedTo->setText(tr("QSize QSize::boundedTo(const QSize &&otherSize) const"));
btnexpandedTo->setText(tr("QSize QSize::expandedTo(const QSize &&otherSize) const"));
btnheight->setText(tr("int QSize::height() const"));
btnisEmpty->setText(tr("bool QSize::isEmpty() const"));
btnisNull->setText(tr("bool QSize::isNull() const"));
btnisValid->setText(tr("bool QSize::isValid() const"));
btnrheight->setText(tr("int &&QSize::rheight()"));
btnrwidth->setText(tr("int &&QSize::rwidth()"));
btnscale->setText(tr("void QSize::scale(int width, int height, Qt::AspectRatioMode mode)"));
btnscale2->setText(tr("void QSize::scale(const QSize &&size, Qt::AspectRatioMode mode)"));
btnscaled->setText(tr("QSize QSize::scaled(int width, int height, Qt::AspectRatioMode mode) const"));
btnscaled2->setText(tr("QSize QSize::scaled(const QSize &&s, Qt::AspectRatioMode mode) const"));
btnsetHeight->setText(tr("void QSize::setHeight(int height)"));
btnsetWidth->setText(tr("void QSize::setWidth(int width)"));
btntoCGSize->setText(tr("CGSize QSize::toCGSize() const"));
btntranspose->setText(tr("void QSize::transpose()"));
btntransposed->setText(tr("QSize QSize::transposed() const"));
btnwidth->setText(tr("int QSize::width() const"));
btnoperator1->setText(tr("QSize &&QSize::operator*=(qreal factor)"));
btnoperator2->setText(tr("QSize &&QSize::operator+=(const QSize &&size)"));
btnoperator3->setText(tr("QSize &&QSize::operator-=(const QSize &&size)"));
btnoperator4->setText(tr("QSize &&QSize::operator/=(qreal divisor)"));
//右上功能按钮设置
//非成员函数按钮
btnoperator5=new QPushButton();
btnoperator6=new QPushButton();
btnoperator7=new QPushButton();
btnoperator8=new QPushButton();
btnoperator9=new QPushButton();
btnoperator10=new QPushButton();
btnoperator11=new QPushButton();
btnoperator12=new QPushButton();
btnoperator13=new QPushButton();
btnoperator5->setText(tr("bool operator!=(const QSize &&s1, const QSize &&s2)"));
btnoperator6->setText(tr("const QSize operator*(const QSize &&size, qreal factor)"));
btnoperator7->setText(tr("const QSize operator*(qreal factor, const QSize &&size)"));
btnoperator8->setText(tr("const QSize operator+(const QSize &&s1, const QSize &&s2)"));
btnoperator9->setText(tr("const QSize operator-(const QSize &&s1, const QSize &&s2)"));
btnoperator10->setText(tr("const QSize operator/(const QSize &&size, qreal divisor)"));
btnoperator11->setText(tr("QDataStream &&operator<<(QDataStream &&stream, const QSize &&size)"));
btnoperator12->setText(tr("bool operator==(const QSize &&s1, const QSize &&s2)"));
btnoperator13->setText(tr("QDataStream &&operator>>(QDataStream &&stream, QSize &&size)"));
//多文本框设置
textEdit=new QTextEdit();
textEdit->setReadOnly(true);
textEdit->setText(tr("帮助:"));
textEdit->append(tr(""));
textEdit->append(tr("1.QSize类使用整数点精度定义二维对象的大小。"));
textEdit->append(tr(""));
textEdit->append(tr("2.大小由width()和height()指定。它可以在构造函数中设置,并使用setWidth(), setHeight()或scale()函数或使用算术运算符进行更改。大小也可以通过使用rwidth()和rheight()函数检索对宽度和高度的引用来直接操作。最后,宽度和高度可以使用转置()函数进行交换。"));
textEdit->append(tr(""));
textEdit->append(tr("3.isValid()函数的作用是:确定一个大小是否有效(一个有效的大小的宽度和高度都大于等于零)。isEmpty()函数在宽度和高度中的任何一个小于或等于零时返回true,而isNull()函数仅在宽度和高度都为零时返回true。"));
textEdit->append(tr(""));
textEdit->append(tr("4.使用expandedTo()函数来检索保存该大小和给定大小的最大高度和宽度的大小。类似地,boundedTo()函数返回一个大小,该大小包含该大小和给定大小的最小高度和宽度。"));
textEdit->append(tr(""));
textEdit->append(tr("5.QSize对象可以流化也可以比较。"));
textEdit->append(tr(""));
/*********左侧布局*********/
leftLayout=new QVBoxLayout;
leftLayout->addWidget(btnQSize);
leftLayout->addWidget(btnQSize2);
leftLayout->addWidget(btnboundedTo);
leftLayout->addWidget(btnexpandedTo);
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
QSizeDemo.rar (73个子文件)
QSizeDemo
application-one.ico 162KB
QSizeDemo.pro.user 24KB
application-one.png 8KB
qsizedemo.h 4KB
main.cpp 504B
source
widget_btnqsize2.cpp 2KB
widget_btnqsize2.h 932B
widget_btnoperator13.cpp 2KB
widget_btnoperator5.h 945B
widget_btnoperator4.cpp 3KB
widget_btnisvalid.cpp 5KB
widget_btntransposed.cpp 2KB
widget_btntocgsize.h 940B
widget_btnoperator13.h 950B
widget_btntocgsize.cpp 2KB
widget_btnoperator4.h 945B
widget_btnscale.h 946B
widget_btnoperator2.h 945B
widget_btnscaled.h 951B
widget_btnoperator3.h 945B
widget_btnsetwidth.cpp 3KB
widget_btnexpandedto.cpp 2KB
widget_btnoperator9.h 945B
widget_btnisnull.h 930B
widget_btnoperator8.h 945B
widget_btnisvalid.h 1000B
widget_btnoperator9.cpp 4KB
widget_btnsetwidth.h 938B
widget_btnscaled2.h 978B
widget_btnoperator3.cpp 4KB
widget_btntransposed.h 950B
widget_btnheight.h 930B
widget_btnexpandedto.h 950B
widget_btnoperator10.h 950B
widget_btnoperator8.cpp 4KB
widget_btnoperator11.cpp 2KB
widget_btnboundedto.h 947B
widget_btnoperator2.cpp 3KB
widget_btntranspose.cpp 2KB
widget_btnrwidth.h 930B
widget_btnqsize.h 925B
widget_btnoperator7.h 945B
widget_btnoperator12.cpp 3KB
widget_btnwidth.cpp 3KB
widget_btnoperator1.cpp 4KB
widget_btnboundedto.cpp 2KB
widget_btnsetheight.h 945B
widget_btnisnull.cpp 4KB
widget_btnqsize.cpp 2KB
widget_btnoperator7.cpp 3KB
widget_btnscale2.cpp 4KB
widget_btnoperator6.cpp 3KB
widget_btnoperator10.cpp 3KB
widget_btnrwidth.cpp 3KB
widget_btnscaled2.cpp 5KB
widget_btnrheight.cpp 3KB
widget_btnsetheight.cpp 3KB
widget_btnscale.cpp 5KB
widget_btnoperator12.h 950B
widget_btnisempty.cpp 4KB
widget_btnisempty.h 935B
widget_btnoperator1.h 945B
widget_btnwidth.h 925B
widget_btnscale2.h 973B
widget_btnscaled.cpp 4KB
widget_btntranspose.h 945B
widget_btnrheight.h 935B
widget_btnoperator6.h 945B
widget_btnoperator5.cpp 3KB
widget_btnheight.cpp 3KB
widget_btnoperator11.h 950B
QSizeDemo.pro 3KB
qsizedemo.cpp 20KB
共 73 条
- 1
资源评论
sy_lixiang
- 粉丝: 342
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于 YOLOv10 的麦穗计数系统(包含详细的完整的程序和数据)
- 产生线程安全问题的图解
- 1_duoxiangshi1.zip
- 广义互相关测信号时延的matlab代码,采用TDOA方法,其中延时计算采用GCC方法
- TODA在无线通信基站中用于室内定位的技术显示路径,包括Chan算法和Taylor级数展开算法等
- 【Unity太空RTS套件】Space RTS - Starter Pack
- 声源定位算法,广义互相关的声源定位,空间谱估计的声源定位matlab程序
- 【Unity高级射击和近战第三人称控制器】Invector Third Person Controller
- IT及互联网行业的人才报告PPT演示文档文件
- 使用CAPL脚本在CANoe中接收UDP报文
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功