QT系列第5节 QT中常用输入控件

news2024/9/28 19:16:41

QT中经常利用控件来获取用户输入数据,本篇将介绍常用的用户输入控件

目录

(1) QSpinBox

(2) QDoubleSpinBox

(3)QSlider

(4) QScrollBar

(5)QProgressBar

(6)QDial

(7)QLCDNumer

(8)QDateEdit

(9)QTimeEdit

(10)QDateTimeEdit

(11)QTimer

(12)测试程序


(1) QSpinBox

带其他信息的整数增减输入框

(2) QDoubleSpinBox

带其他信息的浮点数增加输入框

(3)QSlider

滑动条

(4) QScrollBar

卷滚条

(5)QProgressBar

进度条

(6)QDial

表盘样式数值输入组件

(7)QLCDNumer

类似LCD展示面板

(8)QDateEdit

日期控件

(9)QTimeEdit

时间控件

(10)QDateTimeEdit

日期时间控件

(11)QTimer

定时器

(12)测试程序

1.运行效果

  

2.关键代码

widget.h

#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

private:
    QTimer *fTimer;
    QTimer *fTimerCounter;

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

private slots:
    void on_pushButton_clicked();

    void on_horizontalScrollBar_valueChanged(int value);

    void on_horizontalSliderRed_valueChanged(int value);

    void on_horizontalSliderGreen_valueChanged(int value);

    void on_horizontalSliderlue_valueChanged(int value);

    void on_horizontalSliderlueAlpha_valueChanged(int value);

    void on_dial_valueChanged(int value);

    void on_radioButtonDec_clicked();

    void on_radioButtonBin_clicked();

    void on_radioButtonOct_clicked();

    void on_radioButtonHex_clicked();

    void on_pushButton_2_clicked();

    void on_timer_timeout();
    void on_pushButtonStartTimer_clicked();

private:
    Ui::Widget *ui;
};
#endif // WIDGET_H

widget.cpp

#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    fTimer = new QTimer(this);
    fTimer->setInterval(1000);
    fTimer->stop();
    connect(fTimer, SIGNAL(timeout()), this, SLOT(on_timer_timeout()));
}

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


void Widget::on_pushButton_clicked()
{
    int num = ui->spinBox->value();
    float fdata = ui->doubleSpinBox->value();
    qDebug() << num << " " << fdata;

    int value = ui->spinBoxWeight->value();
    ui->spinBoxBin->setValue(value);
    ui->spinBoxDec->setValue(value);
    ui->spinBoxHex->setValue(value);
}


void Widget::on_horizontalScrollBar_valueChanged(int value)
{
    Q_UNUSED(value)
}


void Widget::on_horizontalSliderRed_valueChanged(int value)
{
    Q_UNUSED(value)
    QPalette palette = ui->textEdit->palette();
    QColor color;
    color.setRgb(ui->horizontalSliderRed->value(),
                 ui->horizontalSliderGreen->value(),
                 ui->horizontalSliderBlue->value(),
                 ui->horizontalSliderAlpha->value());
    palette.setColor(QPalette::Base, color);
ui->textEdit->setPalette(palette);
}


void Widget::on_horizontalSliderGreen_valueChanged(int value)
{
    on_horizontalSliderRed_valueChanged(value);
}


void Widget::on_horizontalSliderlue_valueChanged(int value)
{
    on_horizontalSliderRed_valueChanged(value);
}


void Widget::on_horizontalSliderlueAlpha_valueChanged(int value)
{
    on_horizontalSliderRed_valueChanged(value);
}


void Widget::on_dial_valueChanged(int value)
{
    ui->lcdNumber->display(value);
}


void Widget::on_radioButtonDec_clicked()
{
    ui->lcdNumber->setDigitCount(3);
    ui->lcdNumber->setDecMode();
}


void Widget::on_radioButtonBin_clicked()
{
    ui->lcdNumber->setDigitCount(3);
    ui->lcdNumber->setBinMode();
}


void Widget::on_radioButtonOct_clicked()
{
    ui->lcdNumber->setDigitCount(3);
    ui->lcdNumber->setOctMode();
}


void Widget::on_radioButtonHex_clicked()
{
    ui->lcdNumber->setDigitCount(3);
    ui->lcdNumber->setHexMode();
}


void Widget::on_pushButton_2_clicked()
{
    QDateTime curTime = QDateTime::currentDateTime();
    ui->dateTimeEdit->setDateTime(curTime);
    ui->dateEdit->setDate(curTime.date());
    ui->timeEdit->setTime(curTime.time());

    ui->timeEditSelf->setText(curTime.toString("hh:mm:ss"));
    ui->dateEditSelf->setText(curTime.toString("yyyy-MM-dd"));
    ui->lineEditDateTime->setText(curTime.toString("yyyy-MM-dd hh:mm:ss"));

    QString str = curTime.toString("hh:mm:ss");
    QTime times = QTime::fromString(str, "hh:mm:ss");
    ui->timeEdit_2->setTime(times);
    qDebug() << times.toString("hh时mm分ss秒");

    str = curTime.toString("yyyy-MM-dd");
    QDate date = QDate::fromString(str, "yyyy-MM-dd");
    ui->dateEdit_2->setDate(date);
    qDebug() << date.toString("yyyy年M月d日");


    str = curTime.toString("yyyy-MM-dd hh:mm:ss");
    QDateTime dt = QDateTime::fromString(str, "yyyy-MM-dd hh:mm:ss");
    ui->dateTimeEdit_2->setDateTime(dt);
}

void Widget::on_timer_timeout() {
    ui->lcdNumberHour->display(QTime::currentTime().hour());
    ui->lcdNumberMinute->display(QTime::currentTime().minute());
    ui->lcdNumberSecond->display(QTime::currentTime().second());
}


void Widget::on_pushButtonStartTimer_clicked()
{
    fTimer->start();
}

widget.ui

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>Widget</class>
 <widget class="QWidget" name="Widget">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>766</width>
    <height>308</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Widget</string>
  </property>
  <widget class="QSpinBox" name="spinBox">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>161</width>
     <height>22</height>
    </rect>
   </property>
   <property name="value">
    <number>10</number>
   </property>
  </widget>
  <widget class="QDoubleSpinBox" name="doubleSpinBox">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>20</y>
     <width>161</width>
     <height>22</height>
    </rect>
   </property>
   <property name="value">
    <double>1.230000000000000</double>
   </property>
  </widget>
  <widget class="QPushButton" name="pushButton">
   <property name="geometry">
    <rect>
     <x>60</x>
     <y>170</y>
     <width>81</width>
     <height>24</height>
    </rect>
   </property>
   <property name="text">
    <string>控制spinbox</string>
   </property>
  </widget>
  <widget class="QSpinBox" name="spinBoxDec">
   <property name="geometry">
    <rect>
     <x>50</x>
     <y>80</y>
     <width>111</width>
     <height>22</height>
    </rect>
   </property>
   <property name="prefix">
    <string>Dec  </string>
   </property>
   <property name="value">
    <number>12</number>
   </property>
  </widget>
  <widget class="QSpinBox" name="spinBoxBin">
   <property name="geometry">
    <rect>
     <x>50</x>
     <y>110</y>
     <width>111</width>
     <height>22</height>
    </rect>
   </property>
   <property name="prefix">
    <string>Bin  </string>
   </property>
   <property name="displayIntegerBase">
    <number>2</number>
   </property>
  </widget>
  <widget class="QSpinBox" name="spinBoxHex">
   <property name="geometry">
    <rect>
     <x>50</x>
     <y>140</y>
     <width>111</width>
     <height>22</height>
    </rect>
   </property>
   <property name="prefix">
    <string>Hex  </string>
   </property>
   <property name="displayIntegerBase">
    <number>16</number>
   </property>
  </widget>
  <widget class="QSpinBox" name="spinBoxWeight">
   <property name="geometry">
    <rect>
     <x>50</x>
     <y>50</y>
     <width>111</width>
     <height>22</height>
    </rect>
   </property>
   <property name="suffix">
    <string>  KG</string>
   </property>
   <property name="value">
    <number>10</number>
   </property>
  </widget>
  <widget class="QScrollBar" name="horizontalScrollBar">
   <property name="geometry">
    <rect>
     <x>180</x>
     <y>10</y>
     <width>160</width>
     <height>16</height>
    </rect>
   </property>
   <property name="value">
    <number>10</number>
   </property>
   <property name="orientation">
    <enum>Qt::Horizontal</enum>
   </property>
  </widget>
  <widget class="QScrollBar" name="verticalScrollBar">
   <property name="geometry">
    <rect>
     <x>290</x>
     <y>130</y>
     <width>16</width>
     <height>160</height>
    </rect>
   </property>
   <property name="pageStep">
    <number>1</number>
   </property>
   <property name="value">
    <number>20</number>
   </property>
   <property name="orientation">
    <enum>Qt::Vertical</enum>
   </property>
   <property name="invertedAppearance">
    <bool>false</bool>
   </property>
  </widget>
  <widget class="QSlider" name="horizontalSliderRed">
   <property name="geometry">
    <rect>
     <x>180</x>
     <y>30</y>
     <width>160</width>
     <height>22</height>
    </rect>
   </property>
   <property name="maximum">
    <number>255</number>
   </property>
   <property name="orientation">
    <enum>Qt::Horizontal</enum>
   </property>
  </widget>
  <widget class="QSlider" name="verticalSlider">
   <property name="geometry">
    <rect>
     <x>320</x>
     <y>130</y>
     <width>22</width>
     <height>160</height>
    </rect>
   </property>
   <property name="orientation">
    <enum>Qt::Vertical</enum>
   </property>
  </widget>
  <widget class="QDial" name="dial">
   <property name="geometry">
    <rect>
     <x>170</x>
     <y>240</y>
     <width>51</width>
     <height>61</height>
    </rect>
   </property>
  </widget>
  <widget class="QLCDNumber" name="lcdNumber">
   <property name="geometry">
    <rect>
     <x>370</x>
     <y>140</y>
     <width>64</width>
     <height>71</height>
    </rect>
   </property>
  </widget>
  <widget class="QRadioButton" name="radioButtonDec">
   <property name="geometry">
    <rect>
     <x>360</x>
     <y>220</y>
     <width>95</width>
     <height>20</height>
    </rect>
   </property>
   <property name="text">
    <string>十进制</string>
   </property>
   <property name="checked">
    <bool>true</bool>
   </property>
  </widget>
  <widget class="QRadioButton" name="radioButtonBin">
   <property name="geometry">
    <rect>
     <x>360</x>
     <y>240</y>
     <width>95</width>
     <height>20</height>
    </rect>
   </property>
   <property name="text">
    <string>二进制</string>
   </property>
  </widget>
  <widget class="QRadioButton" name="radioButtonOct">
   <property name="geometry">
    <rect>
     <x>360</x>
     <y>260</y>
     <width>95</width>
     <height>20</height>
    </rect>
   </property>
   <property name="text">
    <string>八进制</string>
   </property>
  </widget>
  <widget class="QRadioButton" name="radioButtonHex">
   <property name="geometry">
    <rect>
     <x>360</x>
     <y>280</y>
     <width>95</width>
     <height>20</height>
    </rect>
   </property>
   <property name="text">
    <string>十六进制</string>
   </property>
  </widget>
  <widget class="QSlider" name="horizontalSliderGreen">
   <property name="geometry">
    <rect>
     <x>180</x>
     <y>60</y>
     <width>160</width>
     <height>22</height>
    </rect>
   </property>
   <property name="maximum">
    <number>255</number>
   </property>
   <property name="orientation">
    <enum>Qt::Horizontal</enum>
   </property>
  </widget>
  <widget class="QSlider" name="horizontalSliderBlue">
   <property name="geometry">
    <rect>
     <x>180</x>
     <y>90</y>
     <width>160</width>
     <height>22</height>
    </rect>
   </property>
   <property name="maximum">
    <number>255</number>
   </property>
   <property name="orientation">
    <enum>Qt::Horizontal</enum>
   </property>
  </widget>
  <widget class="QSlider" name="horizontalSliderAlpha">
   <property name="geometry">
    <rect>
     <x>180</x>
     <y>120</y>
     <width>160</width>
     <height>22</height>
    </rect>
   </property>
   <property name="maximum">
    <number>255</number>
   </property>
   <property name="orientation">
    <enum>Qt::Horizontal</enum>
   </property>
  </widget>
  <widget class="QTextEdit" name="textEdit">
   <property name="geometry">
    <rect>
     <x>170</x>
     <y>150</y>
     <width>104</width>
     <height>71</height>
    </rect>
   </property>
   <property name="palette">
    <palette>
     <active>
      <colorrole role="Base">
       <brush brushstyle="SolidPattern">
        <color alpha="255">
         <red>85</red>
         <green>255</green>
         <blue>255</blue>
        </color>
       </brush>
      </colorrole>
     </active>
     <inactive>
      <colorrole role="Base">
       <brush brushstyle="SolidPattern">
        <color alpha="255">
         <red>255</red>
         <green>255</green>
         <blue>255</blue>
        </color>
       </brush>
      </colorrole>
     </inactive>
     <disabled>
      <colorrole role="Base">
       <brush brushstyle="SolidPattern">
        <color alpha="255">
         <red>240</red>
         <green>240</green>
         <blue>240</blue>
        </color>
       </brush>
      </colorrole>
     </disabled>
    </palette>
   </property>
  </widget>
  <widget class="QDateEdit" name="dateEdit">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>10</y>
     <width>110</width>
     <height>22</height>
    </rect>
   </property>
  </widget>
  <widget class="QTimeEdit" name="timeEdit">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>40</y>
     <width>118</width>
     <height>22</height>
    </rect>
   </property>
  </widget>
  <widget class="QDateTimeEdit" name="dateTimeEdit">
   <property name="geometry">
    <rect>
     <x>380</x>
     <y>80</y>
     <width>194</width>
     <height>22</height>
    </rect>
   </property>
  </widget>
  <widget class="QPushButton" name="pushButton_2">
   <property name="geometry">
    <rect>
     <x>680</x>
     <y>130</y>
     <width>75</width>
     <height>24</height>
    </rect>
   </property>
   <property name="text">
    <string>当前时间</string>
   </property>
  </widget>
  <widget class="QLineEdit" name="timeEditSelf">
   <property name="geometry">
    <rect>
     <x>560</x>
     <y>10</y>
     <width>113</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QLineEdit" name="dateEditSelf">
   <property name="geometry">
    <rect>
     <x>560</x>
     <y>40</y>
     <width>113</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QLineEdit" name="lineEditDateTime">
   <property name="geometry">
    <rect>
     <x>590</x>
     <y>80</y>
     <width>171</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QTimeEdit" name="timeEdit_2">
   <property name="geometry">
    <rect>
     <x>450</x>
     <y>120</y>
     <width>118</width>
     <height>22</height>
    </rect>
   </property>
   <property name="displayFormat">
    <string>HH:mm:ss</string>
   </property>
  </widget>
  <widget class="QDateEdit" name="dateEdit_2">
   <property name="geometry">
    <rect>
     <x>450</x>
     <y>150</y>
     <width>110</width>
     <height>22</height>
    </rect>
   </property>
   <property name="displayFormat">
    <string>yyyy/MM/dd</string>
   </property>
  </widget>
  <widget class="QDateTimeEdit" name="dateTimeEdit_2">
   <property name="geometry">
    <rect>
     <x>450</x>
     <y>180</y>
     <width>194</width>
     <height>22</height>
    </rect>
   </property>
   <property name="displayFormat">
    <string>yyyy/MM/dd HH:mm:ss</string>
   </property>
  </widget>
  <widget class="QPushButton" name="pushButtonStartTimer">
   <property name="geometry">
    <rect>
     <x>690</x>
     <y>210</y>
     <width>75</width>
     <height>24</height>
    </rect>
   </property>
   <property name="text">
    <string>启动定时器</string>
   </property>
  </widget>
  <widget class="QLCDNumber" name="lcdNumberHour">
   <property name="geometry">
    <rect>
     <x>450</x>
     <y>210</y>
     <width>64</width>
     <height>23</height>
    </rect>
   </property>
   <property name="segmentStyle">
    <enum>QLCDNumber::Flat</enum>
   </property>
  </widget>
  <widget class="QLCDNumber" name="lcdNumberMinute">
   <property name="geometry">
    <rect>
     <x>520</x>
     <y>210</y>
     <width>64</width>
     <height>23</height>
    </rect>
   </property>
   <property name="frameShape">
    <enum>QFrame::StyledPanel</enum>
   </property>
   <property name="frameShadow">
    <enum>QFrame::Sunken</enum>
   </property>
   <property name="segmentStyle">
    <enum>QLCDNumber::Flat</enum>
   </property>
  </widget>
  <widget class="QLCDNumber" name="lcdNumberSecond">
   <property name="geometry">
    <rect>
     <x>590</x>
     <y>210</y>
     <width>64</width>
     <height>23</height>
    </rect>
   </property>
   <property name="frameShape">
    <enum>QFrame::Box</enum>
   </property>
   <property name="segmentStyle">
    <enum>QLCDNumber::Flat</enum>
   </property>
  </widget>
  <zorder>pushButtonStartTimer</zorder>
  <zorder>spinBox</zorder>
  <zorder>doubleSpinBox</zorder>
  <zorder>pushButton</zorder>
  <zorder>spinBoxDec</zorder>
  <zorder>spinBoxBin</zorder>
  <zorder>spinBoxHex</zorder>
  <zorder>spinBoxWeight</zorder>
  <zorder>horizontalScrollBar</zorder>
  <zorder>verticalScrollBar</zorder>
  <zorder>horizontalSliderRed</zorder>
  <zorder>verticalSlider</zorder>
  <zorder>dial</zorder>
  <zorder>lcdNumber</zorder>
  <zorder>radioButtonDec</zorder>
  <zorder>radioButtonBin</zorder>
  <zorder>radioButtonOct</zorder>
  <zorder>radioButtonHex</zorder>
  <zorder>horizontalSliderGreen</zorder>
  <zorder>horizontalSliderBlue</zorder>
  <zorder>horizontalSliderAlpha</zorder>
  <zorder>textEdit</zorder>
  <zorder>dateEdit</zorder>
  <zorder>timeEdit</zorder>
  <zorder>dateTimeEdit</zorder>
  <zorder>pushButton_2</zorder>
  <zorder>timeEditSelf</zorder>
  <zorder>dateEditSelf</zorder>
  <zorder>lineEditDateTime</zorder>
  <zorder>timeEdit_2</zorder>
  <zorder>dateEdit_2</zorder>
  <zorder>dateTimeEdit_2</zorder>
  <zorder>lcdNumberHour</zorder>
  <zorder>lcdNumberMinute</zorder>
  <zorder>lcdNumberSecond</zorder>
 </widget>
 <resources/>
 <connections/>
</ui>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/96891.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

@MapperScan原理探究

1. 前言 MyBatis在整合Spring的时候&#xff0c;只需要加如下注解&#xff0c;就可以将Mapper实例注册到IOC容器交给Spring管理&#xff0c;它是怎么做到的呢&#xff1f;&#xff1f;&#xff1f; MapperScan("com.xxx.mapper")提出几个问题&#xff1a; Mapper接…

Snipaste的使用

Snipaste截屏软件的使用&#xff1a; 1、开始截屏 第一种方式&#xff1a;快捷键 &#xff08;默认是F1&#xff09;也就是说按一下F1键就会进入截屏状态。 第二种方式&#xff1a;点击软件在任务栏上的图标。 2、选定截屏区域&#xff1a; 进入截屏状态后移动鼠标&#x…

绩效考核管理方案

第一部分 总 则 第一条&#xff1a;目的 1、通过绩效考核&#xff0c;传递组织目标和压力&#xff0c;促使员工提高工作绩效&#xff0c;达到“培养员工、提高员工的工作能力、纠正员工偏差、使之更好地为公司服务&#xff0c;达到公司与个人之间的双赢”的目的。 2、加强公司的…

四、fs文件系统模块

fs模块是Node.js官方提供用来操作文件的模块&#xff0c;属于核心模块&#xff0c;提供了一些列的方法和属性&#xff0c;用来满足用户的操作需求&#xff1b; 引入fs模块 const fs require(fs); fs.readFile() 读取 读取指定的内容&#xff0c;fs.readFile(path[&#xff…

图文排版 之 line-height

图文排版 之 line-height 设置行盒子的高度. line-height 经常被用来设置多行文本的行间距. 对于块级元素, line-height 制定了行盒子的最小高度. 对于非替换的内联元素, line-height 的值用来计算行盒子的高度. 一般来说, 大家都知道一个 div 的高度默认是由其子元素撑起的, …

史上最全 Java 高频面试合集,命中率高达 95%

进大厂是大部分程序员的梦想&#xff0c;而进大厂的门槛也是比较高的&#xff0c;所以这里整理了一份阿里、美团、滴滴、头条等大厂面试大全&#xff0c;其中概括的知识点有&#xff1a;Java、MyBatis、ZooKeeper、Dubbo、Elasticsearch、Memcached、 Redis、MySQL、Spring、S…

现代控制理论

系统的状态空间表达式的建立 建立系统状态空间表达式的三种方法 &#xff08;1&#xff09;根据系统的方框图列写 &#xff08;2&#xff09;从系统的基本原理推导 &#xff08;3&#xff09;根据传递函数或者高阶微分方程实现 方框图法 有些系统的系统机理还没搞清楚可以使…

nodejs+vue高校教室管理系统

摘 要 1 1 系统概述 4 1.1研究背景 4 1.2研究现状 4 1.3主要内容 5 2 系统开发环境 6 2.3 MySql数据库 6 2.4 B/S结构 7 3 需求分析 8 3.1技术可行性&#xff1a;技术背景 8 3.2经济可行性 8 3.3操作可行性 8 3.4系统设计规则 9 3.5系统流程和逻辑 9 4系统概要设计 13 4.1 概…

Delaunay三角网之分治算法

文章目录 一、简介二、实现代码三、实现效果参考资料一、简介 Delaunay三角网现有的构网算法有很多种,有学者曾对其中一些算法进行了调查和评估(如下图所示)。结果表明,在少量点时,Lawson的增量插入算法、Lee和Schachter的分治算法以及Fortune的平面扫描算法在速度上大致相…

Hexo+stun主题+Gitee5分钟快速搭建你的个人Blog

环境配置 首先要下载Node.js&#xff0c;然后安装Git&#xff0c;接着注册码云&#xff0c;最后安装Hexo&#xff0c;Hexo安装命令行(cmd 或 gitbash): npm install hexo-cli -g速度慢可以先改一下安装源: npm config set registry https://registry.npm.taobao.orgHexo搭建 目…

Linux调试器-gdb介绍

文章目录gdb的基础使用gdb是什么gdb的使用gdb的下载**l 显示代码****b 行号 :打断点****info b :查看断点****d 断点序号 :删除断点****r :运行调试****n&#xff08;next&#xff09; &#xff1a;逐过程****s&#xff08;step&#xff09;&#xff1a;逐语句****c&#xff08…

程序员接私活的那些事

每日坚持一点点&#xff0c;就离目标近一点。 文章目录怎么在空闲时间获得格外的收入接私活的有哪些途径接私活的途中需要注意什么格外福利怎么在空闲时间获得格外的收入 今天我们就不聊技术问题&#xff0c;咱们聊聊一个有意思的话题—>怎么在空闲的时间获得格外的收益&…

设计模式3 - 结构型模式

23种设计模式分析与见解开篇、UML、软件设计原则https://blog.csdn.net/lili40342/article/details/128358435创建型模式https://blog.csdn.net/lili40342/article/details/128358392结构型模式https://blog.csdn.net/lili40342/article/details/128358313行为型模式https://bl…

UNIAPP实战项目笔记54 登录时用state存储用户信息并持久化用户登录和退出登录功能

UNIAPP实战项目笔记54 登录时用state存储用户信息并持久化用户登录和退出登录功能 登录信息各个页面同步使用的是state 登录信息的持久化使用的是本地存储 打开APP自动初始化本地存储数据到state中 实际案例图片 登录页面数据渲染 代码 login.vue页面 登录成功后显示的页面 &l…

论文阅读 - Social Bot-Aware Graph Neural Network for Early Rumor Detection - CCF B

目录 摘要&#xff1a; 1 绪论 2 问题定义 3 SBAG模型 3.1社交机器人检测 3.2 机器人感知图神经网络 3.2.1基于GCN的用户发布 3.2.2 基于GAT的用户交互 3.2.3文本编码器 3.2.4 输出层 3.3 训练 4 实验 4.1 数据集 4.2 实验设置 4.3 基线 4.4 实验结果 4.4.1 谣言…

对时间序列数据(牛仔裤销售数据集)进行LSTM预测(Matlab代码实现)

目录 &#x1f4a5;1 概述 &#x1f4da;2 运行结果 &#x1f389;3 参考文献 &#x1f468;‍&#x1f4bb;4 Matlab代码 &#x1f4a5;1 概述 LSTM模型的一个常见用途是对长时间序列数据进行学习预测&#xff0c;例如得到了某商品前一年的日销量数据&#xff0c;我们可以…

【GPU】Nvidia CUDA 编程高级教程——利用蒙特卡罗法求解近似值(NVSHMEM)

博主未授权任何人或组织机构转载博主任何原创文章&#xff0c;感谢各位对原创的支持&#xff01; 博主链接 本人就职于国际知名终端厂商&#xff0c;负责modem芯片研发。 在5G早期负责终端数据业务层、核心网相关的开发工作&#xff0c;目前牵头6G算力网络技术标准研究。 博客…

MyBatis + SQL Server Using Table-Valued Parameters

一、实现原理 参考文档 Using table-valued parametersSystem requirements for the JDBC driverMicrosoft JDBC Driver for SQL Server1、微软官方封装了 JDBC 驱动 jar 包&#xff0c;提供 SQLServerDataTable 类&#xff1b; 2、Mybatis 官方提供自定义类型处理接口 TypeHa…

Python学习笔记-Pygame

目录 一、Pygame概述 1.安装Pyganme 2.Pygame常用模块介绍 2.1 display模块常用方法 2.2 pygame.event模块常用方法 2.3 Surface对象的常用方法 记述关于Pyganme开发的基本知识。 一、Pygame概述 Pygame是跨平台的python模块&#xff0c;转为电子游戏设计&#xff08;包…

Vue打包后的不同版本解析

vue源码打包版本 这里选取我们开发中常见的几个版本进行说明。 1、vue(.runtime).global(.prod).js 在html页面中通过 <script src“...”> 标签直接使用。通过CDN引入和npm下载的Vue就是这个版本。会暴露一个全局的Vue来使用。&#xff08;.runtime&#xff09;和&…