Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 208 → Rev 209

/trunk/DBViewer/treedelegateform.cpp
New file
0,0 → 1,14
#include "treedelegateform.h"
#include "ui_treedelegateform.h"
 
TreeDelegateForm::TreeDelegateForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::TreeDelegateForm)
{
ui->setupUi(this);
}
 
TreeDelegateForm::~TreeDelegateForm()
{
delete ui;
}
/trunk/DBViewer/mainwindow.h
8,6 → 8,7
#include "settingform.h"
#include "delegate.h"
// #include "fileform.h"
#include "treedelegateform.h"
 
#include <QMainWindow>
#include <QStandardItemModel>
63,6 → 64,7
private:
Ui::MainWindow *ui;
//FileForm fileForm;
TreeDelegateForm treeForm;
 
settingForm setFrm;
//ïåðåìåííûå äëÿ ñîåäèíåíèÿ ñ áàçîé
/trunk/DBViewer/treedelegateform.h
New file
0,0 → 1,26
#ifndef TREEDELEGATEFORM_H
#define TREEDELEGATEFORM_H
 
#include <QWidget>
 
namespace Ui {
class TreeDelegateForm;
}
 
class TreeDelegateForm : public QWidget
{
Q_OBJECT
 
public:
explicit TreeDelegateForm(QWidget *parent = 0);
~TreeDelegateForm();
void setClassID(QString new_class_id){class_id = new_class_id;} //устанавливаем идентификатор класса, к объектам которого будет применяться фильтр
 
private:
Ui::TreeDelegateForm *ui;
QString class_id; //идентификатор класса, к объектам которого будет применяться фильтр
 
 
};
 
#endif // TREEDELEGATEFORM_H
/trunk/DBViewer/DBViewer.pro
20,15 → 20,18
mymodel.cpp \
settingform.cpp \
iconform.cpp \
fileform.cpp
fileform.cpp \
treedelegateform.cpp
HEADERS += mainwindow.h \
delegate.h \
mymodel.h \
settingform.h \
iconform.h \
fileform.h
fileform.h \
treedelegateform.h
FORMS += mainwindow.ui \
settingform.ui \
iconform.ui \
fileform.ui
fileform.ui \
treedelegateform.ui
RESOURCES += dbviewer.qrc
/trunk/DBViewer/mainwindow.ui
191,6 → 191,11
<string>row</string>
</property>
</column>
<column>
<property name="text">
<string>Фильтр</string>
</property>
</column>
</widget>
</item>
<item>
/trunk/DBViewer/treedelegateform.ui
New file
0,0 → 1,21
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>TreeDelegateForm</class>
<widget class="QWidget" name="TreeDelegateForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<pixmapfunction/>
<connections/>
</ui>
/trunk/DBViewer/mainwindow.cpp
35,6 → 35,7
ui->treeWidget_2->setAlternatingRowColors(true);
 
ui->treeWidget->setIconSize(QSize(30,30));
ui->treeWidget->setColumnWidth(0, 400);
ui->treeWidget_2->setIconSize(QSize(128,128));
 
MainWindow::readSettings();
86,6 → 87,7
ui->pushButton_4->setEnabled(false);
 
// setFrm.show();
treeForm.show();
 
connect(ui->getsettingAct, SIGNAL(triggered()), this, SLOT(getSetting())); // âûáîð â ãëàâíîé ôîðìå â ìåíþ "Áàçà äàííûõ" ïóíêòà "Ïàðàìåòðû ñîåäèíåíèÿ"
connect(setFrm.pushButton, SIGNAL(clicked()), this, SLOT(applySetting()));
192,7 → 194,17
// // // parents.last()->appendChild(new QTreeWidgetItem(columnData, parents.last()));
QTreeWidgetItem* itm_tmp;
itm_tmp = new QTreeWidgetItem( parents.last());
itm_tmp->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled);
 
/*
QLineEdit * edit_line;
edit_line = new QLineEdit(this);
ui->treeWidget->setItemWidget(itm_tmp, 5, edit_line);
*/
//static QStandartDelegate delegate;
ui->treeWidget->setItemDelegateForColumn(5, &standart_delegate);
 
 
itm_tmp->setText(0, QString(columnData.at(0).toString()));
if (columnData.at(1).toString() == "true") {
itm_tmp->setCheckState(0,Qt::Checked);