avatar
Articles
255
Tags
100
Categories
23

Theqiqi_blog
Search

Theqiqi_blog

22.QProcess
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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•Cmake•GUI
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 ...
13.控件的属性配置
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
qt控件的属性设置QPushButton的属性设置main.cpp1234567891011121314151617181920212223242526272829303132333435363738#include <QApplication>#include <QPushButton>#include <QWidget>#include <QDebug>void configureAdvancedButton(QPushButton *btn) { // 1. 设置内容 btn->setText("开启静音"); btn->setToolTip("点击切换系统静音状态"); // 2. 核心逻辑配置:变成一个开关 btn->setCheckable(true); btn->setChecked(false); // 初始为关闭状态 // 3. 视觉与交互增强 //btn->setCursor(Qt::Poin ...
1…345…26
avatar
Theqiqi
Articles
255
Tags
100
Categories
23
Follow Me
Announcement
This is my Blog
Recent Post
101.使用Grop网站提供的api2026-01-03
9.压测2025-03-27
8.Linux Socket并发模型http服务器2025-03-27
7.web服务器中收发REST接口2025-03-27
6使用c语言与linux系统写一个web服务器,解析并响应get与post请求2025-03-27
Categories
  • C with Socks16
  • C_Sound10
  • C_Windows_Graphi9
  • Cpp5
  • Cpp_Socket4
  • C语言在Windows中实现抓包4
  • C语言的万种用法9
  • Debian1
Tags
Cmake UltraISO AI rufus C GDI Windows web UDP termux poll mysql BSD Sockets x86汇编程序 ISO html Vmware Socks5 Drvier Compile qemu DLL ipv6 Hook TCP 64位汇编程序 Http PVE Qt linux first pragram OpenGl make android Ipv6 python Debian Websocket Graphi Desktop
Archives
  • January 20261
  • March 202596
  • February 202523
  • September 20242
  • August 202471
  • June 20242
  • March 202411
  • February 20248
Info
Article :
255
UV :
PV :
Last Update :
©2020 - 2026 By Theqiqi
Framework Hexo|Theme Butterfly
Search
Loading the Database