| | |
| | | <item row="0" column="0"> |
| | | <widget class="QTabWidget" name="tabWidget"> |
| | | <property name="currentIndex"> |
| | | <number>0</number> |
| | | <number>2</number> |
| | | </property> |
| | | <widget class="QWidget" name="tab"> |
| | | <attribute name="title"> |
| | |
| | | </widget> |
| | | <widget class="QWidget" name="tab_4"> |
| | | <attribute name="title"> |
| | | <string>综合录入</string> |
| | | <string>内部审计统计综合表</string> |
| | | </attribute> |
| | | <layout class="QGridLayout" name="gridLayout"> |
| | | <item row="0" column="0"> |
New file |
| | |
| | | #include "filedialogdelegate.h" |
| | | #include <QFileDialog> |
| | | #include <QDebug> |
| | | |
| | | FileDialogDelegate::FileDialogDelegate(QObject *parent):QItemDelegate(parent) |
| | | { |
| | | |
| | | } |
| | | |
| | | QWidget *FileDialogDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| | | { |
| | | QFileDialog *fd = new QFileDialog(parent); |
| | | return fd; |
| | | } |
| | | |
| | | void FileDialogDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| | | { |
| | | editor->setGeometry(option.rect); |
| | | } |
| | | |
| | | void FileDialogDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| | | { |
| | | QString fn = ((QFileDialog *)editor)->getOpenFileName(); |
| | | qDebug()<<index<<fn; |
| | | index.model()->setData(index,fn); |
| | | } |
| | | |
| | | void FileDialogDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const |
| | | { |
| | | |
| | | } |
New file |
| | |
| | | #ifndef FILEDIALOGDELEGATE_H |
| | | #define FILEDIALOGDELEGATE_H |
| | | |
| | | #include <QItemDelegate> |
| | | |
| | | |
| | | |
| | | class FileDialogDelegate : public QItemDelegate |
| | | { |
| | | Q_OBJECT |
| | | public: |
| | | FileDialogDelegate(QObject *parent=0); |
| | | |
| | | QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; |
| | | void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; |
| | | void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; |
| | | void setEditorData(QWidget *editor, const QModelIndex &index) const; |
| | | }; |
| | | |
| | | #endif // FILEDIALOGDELEGATE_H |
| | |
| | | problemlist.cpp \ |
| | | problemrectificationresult.cpp \ |
| | | tableitemdelegate.cpp \ |
| | | threemergeproblemlist.cpp |
| | | threemergeproblemlist.cpp \ |
| | | filedialogdelegate.cpp |
| | | |
| | | HEADERS += \ |
| | | clientmainwindow.h \ |
| | |
| | | problemlist.h \ |
| | | problemrectificationresult.h \ |
| | | tableitemdelegate.h \ |
| | | threemergeproblemlist.h |
| | | threemergeproblemlist.h \ |
| | | filedialogdelegate.h |
| | | |
| | | FORMS += \ |
| | | clientmainwindow.ui \ |
| | |
| | | ui(new Ui::ThreeMergeProblemList) |
| | | { |
| | | ui->setupUi(this); |
| | | |
| | | m_fdd = new FileDialogDelegate; |
| | | |
| | | ui->statusbar->hide(); |
| | | ui->menubar->hide(); |
| | | initUi(); // 初始化所有界面 |
| | |
| | | ui->tableWidget->setMinimumHeight(500); // 整改台账 |
| | | ui->tableWidget_2->setMinimumHeight(500); // 整改结果 |
| | | ui->tableWidget_3->setMinimumHeight(500); // 问题清单 |
| | | |
| | | ui->tableWidget->setItemDelegateForColumn(1,m_fdd); |
| | | // 加载公司名 |
| | | readCompanyFromSQL(); |
| | | } |
| | |
| | | #include <QMenu> |
| | | #include <QAction> |
| | | |
| | | #include "filedialogdelegate.h" |
| | | |
| | | namespace Ui { |
| | | class ThreeMergeProblemList; |
| | | } |
| | |
| | | QMenu *m_menu; // 问题清单菜单 |
| | | QMenu *m_menuResult; // 整改成果 |
| | | QMenu *m_menuRectBook; // 整改台账 |
| | | |
| | | FileDialogDelegate *m_fdd; |
| | | }; |
| | | |
| | | #endif // THREEMERGEPROBLEMLIST_H |