-
大小: 2KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-01
- 語言: 其他
- 標(biāo)簽: QT??TableWidget??分頁效果??源代碼??
資源簡介
QT TableWidget 分頁效果 源代碼 需要就拿走……

代碼片段和文件信息
#include?“tablewidget.h“
#include?
TableWidget::TableWidget(QWidget?*parent)?:
????QWidget(parent)
{
????gridLayout?=?new?QGridLayout(this);
????gridLayout->setobjectName(QString::fromUtf8(“gridLayout“));
????first_page?=?new?QToolButton(this);
????first_page->setobjectName(QString::fromUtf8(“first_page“));
????gridLayout->addWidget(first_page?0?0?1?1);
????up_page?=?new?QToolButton(this);
????up_page->setobjectName(QString::fromUtf8(“up_page“));
????gridLayout->addWidget(up_page?0?1?1?1);
????label?=?new?QLabel(this);
????label->setobjectName(QString::fromUtf8(“l(fā)abel“));
????gridLayout->addWidget(label?0?2?1?1);
????combox?=?new?QComboBox(this);
????combox->setobjectName(QString::fromUtf8(“combox“));
????gridLayout->addWidget(combox?0?3?1?1);
????all_page?=?new?QLabel(this);
????all_page->setobjectName(QString::fromUtf8(“all_page“));
????gridLayout->addWidget(all_page?0?4?1?1);
????next_page?=?new?QToolButton(this);
????next_page->setobjectName(QString::fromUtf8(“next_page“));
????gridLayout->addWidget(next_page?0?5?1?1);
????last_page?=?new?QToolButton(this);
????last_page->setobjectName(QString::fromUtf8(“l(fā)ast_page“));
????gridLayout->addWidget(last_page?0?6?1?1);
????tableWidget?=?new?QTableWidget(this);
????tableWidget->setobjectName(QString::fromUtf8(“tableWidget“));
????tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
????tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
????tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
????gridLayout->addWidget(tableWidget?1?0?1?7);
????first_page->setText(QApplication::translate(“Form2“?“|<“?0?QApplication::UnicodeUTF8));
????up_page->setText(QApplication::translate(“Form2“?“<“?0?QApplication::UnicodeUTF8));
????label->setText(QApplication::translate(“Form2“?“\345\275\223\345\211\215\351\241\265\357\274\232“?0?QApplication::UnicodeUTF8));
????next_page->setText(QApplication::translate(“Form2“?“>“?0?QApplication::UnicodeUTF8));
????last_page->setText(QApplication::translate(“Form2“?“>|“?0?QApplication::UnicodeUTF8));
????gridLayout->setColumnStretch(0?1);
????gridLayout->setColumnStretch(1?1);
????gridLayout->setColumnStretch(3?1);
????gridLayout->setColumnStretch(5?1);
????gridLayout->setColumnStretch(6?1);
????record_page?=?20;
????total_page?=?0;
????curr_page?=?0;
????first_page->setEnabled(false);
????up_page->setEnabled(false);
????next_page->setEnabled(false);
????last_page->setEnabled(false);
????connect(first_pageSIGNAL(clicked())thisSLOT(firstpage()));
????connect(up_pageSIGNAL(clicked())thisSLOT(uppage()));
????connect(next_pageSIGNAL(clicked())thisSLOT(nextpage()));
????connect(last_pageSIGNAL(clicked())thisSLOT(lastpage()));
????connect(comboxSIGNAL(activated(int))thisSLOT(jump_page(int)));
}
void?TableWidget::set_title(QStringList?hor_name)
{
????tableWidget->setColumn
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5391??2011-12-26?22:11??pagination\tablewidget.cpp
?????文件???????1242??2011-12-26?16:36??pagination\tablewidget.h
?????目錄??????????0??2011-12-30?14:22??pagination
-----------?---------??----------?-----??----
?????????????????6633????????????????????3
評論
共有 條評論