Remove old code
This commit is contained in:
parent
04ce099adf
commit
70f4601aa9
6 changed files with 0 additions and 168 deletions
|
|
@ -72,8 +72,6 @@ set(PGLAB_SOURCES
|
||||||
EditTableWidget.cpp
|
EditTableWidget.cpp
|
||||||
EditColumnTableModel.cpp
|
EditColumnTableModel.cpp
|
||||||
DatabaseWindow.cpp
|
DatabaseWindow.cpp
|
||||||
widgets/SingleRecordModel.cpp
|
|
||||||
widgets/SingleRecordWidget.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(PGLAB_FORMS
|
set(PGLAB_FORMS
|
||||||
|
|
@ -85,7 +83,6 @@ set(PGLAB_FORMS
|
||||||
ProcessStdioWidget.ui
|
ProcessStdioWidget.ui
|
||||||
crud/CrudTab.ui
|
crud/CrudTab.ui
|
||||||
CodeGenerator.ui
|
CodeGenerator.ui
|
||||||
widgets/SingleRecordWidget.ui
|
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(pglab
|
add_executable(pglab
|
||||||
|
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
#include "SingleRecordModel.h"
|
|
||||||
#include "CustomDataRole.h"
|
|
||||||
|
|
||||||
SingleRecordModel::SingleRecordModel(QObject *parent)
|
|
||||||
: QAbstractTableModel(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant SingleRecordModel::headerData(int section, Qt::Orientation orientation, int role) const
|
|
||||||
{
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
int SingleRecordModel::rowCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
if (parent.isValid())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return elems.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
int SingleRecordModel::columnCount(const QModelIndex &parent) const
|
|
||||||
{
|
|
||||||
if (parent.isValid())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return ColCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant SingleRecordModel::data(const QModelIndex &index, int role) const
|
|
||||||
{
|
|
||||||
if (!index.isValid())
|
|
||||||
return QVariant();
|
|
||||||
|
|
||||||
const int row = index.row();
|
|
||||||
if (role == Qt::DisplayRole)
|
|
||||||
{
|
|
||||||
switch (index.column())
|
|
||||||
{
|
|
||||||
case NameCol:
|
|
||||||
return elems[row].name;
|
|
||||||
case ValueCol:
|
|
||||||
return elems[row].value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (role == CustomDataTypeRole)
|
|
||||||
{
|
|
||||||
switch (index.column())
|
|
||||||
{
|
|
||||||
case NameCol:
|
|
||||||
return Pgsql::text_oid;
|
|
||||||
case ValueCol:
|
|
||||||
return elems[row].oid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (role == CustomDataMeaningRole)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QAbstractTableModel>
|
|
||||||
#include "Pgsql_oids.h"
|
|
||||||
|
|
||||||
class SingleRecordModel : public QAbstractTableModel
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit SingleRecordModel(QObject *parent = nullptr);
|
|
||||||
|
|
||||||
// Header:
|
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
||||||
|
|
||||||
// Basic functionality:
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
enum Columns {
|
|
||||||
NameCol,
|
|
||||||
ValueCol,
|
|
||||||
|
|
||||||
ColCount
|
|
||||||
};
|
|
||||||
|
|
||||||
class Elem {
|
|
||||||
public:
|
|
||||||
QString name;
|
|
||||||
QString value;
|
|
||||||
Oid oid;
|
|
||||||
};
|
|
||||||
using Elems = std::vector<Elem>;
|
|
||||||
Elems elems;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
#include "SingleRecordWidget.h"
|
|
||||||
#include "ui_SingleRecordWidget.h"
|
|
||||||
|
|
||||||
SingleRecordWidget::SingleRecordWidget(QWidget *parent) :
|
|
||||||
QWidget(parent),
|
|
||||||
ui(new Ui::SingleRecordWidget)
|
|
||||||
{
|
|
||||||
ui->setupUi(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
SingleRecordWidget::~SingleRecordWidget()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
namespace Ui {
|
|
||||||
class SingleRecordWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SingleRecordWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit SingleRecordWidget(QWidget *parent = nullptr);
|
|
||||||
~SingleRecordWidget();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::SingleRecordWidget *ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>SingleRecordWidget</class>
|
|
||||||
<widget class="QWidget" name="SingleRecordWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>500</width>
|
|
||||||
<height>679</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Form</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="PgLabTableView" name="properties"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>PgLabTableView</class>
|
|
||||||
<extends>QTableView</extends>
|
|
||||||
<header>util/PgLabTableView.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue