avatar
Articles
287
Tags
106
Categories
25

Theqiqi_blog
Search

Theqiqi_blog

23.QDateTimeEdit
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QDateTimeEditmain.cpp123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#include <QApplication>#include <QWidget>#include <QDateTimeEdit>#include <QVBoxLayout>#include <QLabel>#include <QDateTime>#include <QDebug>void setupDateTimeEditDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础日期时间框 --- QLabel *label1 = new QLabel("选择出发时间(默认格式):", parent); Q ...
22.QProcess
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QProcessmain.cpp12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#include <QApplication>#include <QWidget>#include <QProgressBar>#include <QSlider>#include <QVBoxLayout>#include <QLabel>void setupProgressBarDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 标准进度条 --- QLabel *label1 = new QLabel("当前任务进度:", parent); QProgressBar *bar = new QProgressBar(pa ...
21.QSlider
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QSlidermain.cpp12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include <QApplication>#include <QWidget>#include <QSlider>#include <QLCDNumber>#include <QVBoxLayout>#include <qlabel.h>void setupSliderDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 创建滑动条 --- // Qt::Horizontal 是横向,Qt::Vertical 是纵向 QSlider *slider = new QSlider(Qt::Horizontal, parent); slider->setRang ...
20.QComboBox
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QComboBoxmain.cpp123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263#include <QComboBox>#include <QVBoxLayout>#include <QLabel>#include <QDebug>#include <qapplication.h>void setupComboBoxDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础下拉框 (只读模式) --- QLabel *label1 = new QLabel("选择你的职业:", parent); QComboBox *jobCombo = new QComboBox(parent); ...
19.QDoubleSpinBox
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QDoubleSpinBoxmain.cpp1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include <QDoubleSpinBox>#include <QVBoxLayout>#include <QLabel>#include <QDebug>#include <qapplication.h>void setupDoubleSpinBoxDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础价格选择框 (货币模式) --- QLabel *label1 = new QLabel("商品单价设置 (0.00 - 999.99):", parent); QDoubleSpinBox *pri ...
18.QSpinBox
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QSpinBoxmain.cpp1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#include <QSpinBox>#include <QVBoxLayout>#include <QLabel>#include <QDebug>#include <qapplication.h>void setupSpinBoxDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础年龄选择框 --- QLabel *label1 = new QLabel("请选择年龄 (0-150):", parent); QSpinBox *ageBox = new QSpinBox(parent); // 设置属性 ageB ...
17.QPlainTextEdit
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QPlainTextEditmain.cpp1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include <QPlainTextEdit>#include <QVBoxLayout>#include <QPushButton>#include <QLabel>#include <QTime>#include <qapplication.h>void setupPlainTextEditDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 创建纯文本编辑器 --- QPlainTextEdit *plainEdit = new QPlainTextEdit(parent); plainEdit->se ...
16.QTextEdit
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
QTextEditmain.cpp123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#include <QTextEdit>#include <QVBoxLayout>#include <QPushButton>#include <QLabel>#include <qapplication.h>void setupTextEditDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 创建多行文本框 --- QTextEdit *textEdit = new QTextEdit(parent); textEdit->setPlaceholderText("请输入详细描述内容(支持 HTML 标签)...& ...
15.LineEdit
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
qt LineEditmain.cpp12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364#include <QApplication>#include <QLineEdit>#include <QLabel>#include <QVBoxLayout>#include <QDebug>void setupLineEditDemo(QWidget *parent) { // 创建一个垂直布局,让控件排好队 QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础输入框 --- QLabel *label1 = new QLabel("普通输入框:", parent); QLineEdit *editNormal = new ...
14.Label
Created2025-03-24|QT6_Gui|C++•Qt6•GUI•Cmake
qt Labelmain.cpp123456789101112131415161718192021222324252627282930313233343536#include <QApplication>#include <QWidget>#include <QLabel>#include <QVBoxLayout>void testLabelVariety(QWidget *parent) { // 使用布局,让它们自动排列 QVBoxLayout *layout = new QVBoxLayout(parent); QLabel *txtLabel = new QLabel("这是一段普通的文字"); // 这里可以不传parent,因为下面的addWidget会自动绑定 QLabel *styleLabel = new QLabel(); styleLabel->setText("<b>加粗文字</b> <i style=&#x ...
1…345…29
avatar
Theqiqi
Articles
287
Tags
106
Categories
25
Follow Me
Announcement
This is my Blog
Recent Post
101.使用Grop网站提供的api2026-01-03
光猫开telnet与配置2025-04-13
9.压测2025-03-27
8.Linux Socket并发模型http服务器2025-03-27
7.web服务器中收发REST接口2025-03-27
Categories
  • C with Socks16
  • C_Sound10
  • C_Windows_Graphi9
  • Cpp5
  • Cpp_Socket4
  • C语言在Windows中实现抓包4
  • C语言的万种用法9
  • Debian1
Tags
lib Graphi sql graphi Ninja epoll jsp mysql android Sound Hacking UltraISO qemu WindowsDriver javascript GUI OperatingSystem Python Websocket Capture Socket assembly Ethernet Makefile Socks compiled glfw3 nasm rufus linux WindowsDrive link system x86汇编程序 c first pragram Linux OpenGl UDP vcpkg
Archives
  • January 20261
  • April 20251
  • March 202595
  • February 202523
  • September 20242
  • August 202471
  • June 20242
  • March 202443
Info
Article :
287
UV :
PV :
Last Update :
©2020 - 2026 By Theqiqi
Framework Hexo|Theme Butterfly
Search
Loading the Database