QTableView *view = new QTableView;view->setModel(model);QHBoxLayout *mainLayout = new QHBoxLayout;mainLayout->addWidget(view);setLayout(mainLayout);
CREATE TABLE catalogs.ref_spareparts( id uuid NOT NULL, -- Уникальный идентификатор code bigint NOT NULL, -- Код relname character varying(255) NOT NULL, -- Наименование article character varying(50) NOT NULL, -- Артикул fullarticle character varying(50) NOT NULL, -- Представление артикула producer uuid NOT NULL, -- Производитель unit uuid NOT NULL, -- Единица измерения crgroup uuid NOT NULL, -- Группа кроссов classsize uuid, -- Классификатор размеров fullname character varying(250), -- Полное наименование partsgroup uuid, -- Товарная группа tradegroup uuid, -- Торговая группа length integer, -- Длина width integer, -- Ширина height integer, -- Высота weight numeric(15,3), -- Вес typelabel uuid, -- Тип этикетки printlabel boolean NOT NULL, -- Печатать этикетку cunitbar integer NOT NULL, -- Единиц на этикетку tsv tsvector, CONSTRAINT ref_spareparts_pkey PRIMARY KEY (id), CONSTRAINT ref_spareparts_classsize_fkey FOREIGN KEY (classsize) REFERENCES catalogs.ref_class_size (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_crgroup_fkey FOREIGN KEY (crgroup) REFERENCES catalogs.ref_cross_group (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_partsgroup_fkey FOREIGN KEY (partsgroup) REFERENCES catalogs.ref_partsgroups (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_producer_fkey FOREIGN KEY (producer) REFERENCES catalogs.ref_producers (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_tradegroup_fkey FOREIGN KEY (tradegroup) REFERENCES catalogs.ref_tradegroups (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_typelabel_fkey FOREIGN KEY (typelabel) REFERENCES enumerations.enu_type_label (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_unit_fkey FOREIGN KEY (unit) REFERENCES catalogs.ref_units (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT ref_spareparts_code_key UNIQUE (code))WITH ( OIDS=FALSE);