Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by i rowCount
#qt database using sqlite
#if 0 #include <QApplication> #include <QMainWindow> #include <QTableView> #include <QSqlDatabase> #include <QSqlTableModel> #include <QDebug> #include <QPushButton> #include <QVBoxLayout> #include <QWidget> #include <QSqlError> // 需要这个头文 #include <QSqlQuery> // 确保包含这个头文件 int main(int argc, char *argv[]) { QApplication app(argc, argv); // 创建主窗口 QMainWindow window; // 设置数据库连接 QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName("example.db"); if (!db.open()) { qDebug() <<...
Qt模型视图代理之QTableView应用的简单介绍_qtableview代理-CSDN博客
往期回顾 Qt绘图与图形视图之绘制带三角形箭头的窗口的简单介绍-CSDN博客 Qt绘图与图形视图之Graphics View坐标系的简单介绍-CSDN博客 Qt模型视图代理之MVD(模型-视图-代理)概念的简单介绍-CSDN博客 Qt模型视图代理之QTableView应用的简单介绍 一、最终效果 二、设计思路 这里我们做了三个自定义代理,我们重点看一下是怎么实现的,以及打开excle表格的操作,其他的了解为主,因为实际开发中一般是不用这个来做的。 1.1、QAxObject类 1.1.1、基本概念 QAxObject是Qt中用于与ActiveX对象进行交互的类。通过QAxObject,可以在Qt应用程序中使用COM组件和ActiveX控件,从而实现与外部应用程序的集成。 QAxObject类提供了许多方法和属性,用于管理ActiveX对象的创建、调用方法、设置属性和获取属性等操作。可以使用QAxObject来实例化COM组件,并与其进行通信,从而实现对外部功能的调用和控制。 1.1.2、常用方法和属性 setProperty(propertyName, value):...
Qt:第三章:常用控件介绍_qt中qwidget控件介绍-CSDN博客
一、窗口控件 窗口分为三种:普通窗口、无边框窗口以及顶层窗口(顶层窗口永远在最上面) //普通窗口 QWidget *widget = new QWidget(nullptr,Qt::Tool|Qt::WindowCloseButtonHint|Qt::WindowMaximizeButtonHint); widget->setWindowTitle(QStringLiteral("widget窗口")); widget->show(); //无边框 QWidget *widget1 = new QWidget(nullptr, Qt::FramelessWindowHint); widget1->show(); //作为顶层窗口出现 QWidget *widget2 = new QWidget(nullptr,Qt::Dialog| Qt::WindowStaysOnTopHint); widget2->setWindowTitle("top widget"); widget2->show(); 1、模态对话框和非模态对话框...
QTableWidget自定义单元格_qtablewidget设置单元格内容_千册的博客-CSDN博客
一 自定义QTableWidget 创建一个Widget项目,注释掉其中的ui->setupUi(this);使用自定义的布局。 #include "widget.h" #include "ui_widget.h" #include <QTableWidget> #include <QTableWidgetItem> #include <QLineEdit> #include <QHBoxLayout> #include <QVBoxLayout> Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { QVBoxLayout *v = new QVBoxLayout(this); //ui->setupUi(this); QTableWidget * table = new QTableWidget(this); table->setRowCount(0); table->setColumnCount(1); QTableWidgetItem *head_item1 = new...
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with i
Contact i, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack