Skip to content
Browse files

Fixed bug that was crashing pgModeler on printing model. (issue #1)

Added a advanced tab on relationship editing form in order to show the
objects that represents the relationship (fks, tables, uq, pks) (issue
  • Loading branch information...
1 parent 14fd049 commit d716a3ee91ae0c812b9592789df202870c8e6f7d @rkhaotix rkhaotix committed Dec 28, 2012
View
2 conf/defaults/pgmodeler.conf
@@ -14,6 +14,8 @@
paper-type="4"
paper-orientation="landscape"
paper-margin="10,10,10,10"
+ print-grid="true"
+ print-pg-num="true"
save-session="true"
save-widgets="true"/>
<widget-conf>
View
4 conf/dtd/pgmodeler.dtd
@@ -17,6 +17,8 @@
<!ATTLIST configuration paper-margin CDATA #IMPLIED>
<!ATTLIST configuration save-session (false|true) "true">
<!ATTLIST configuration save-widgets (false|true) "true">
+<!ATTLIST configuration print-grid (false|true) "true">
+<!ATTLIST configuration print-pg-num (false|true) "true">
<!ELEMENT widget-conf (widget+)>
<!ELEMENT widget EMPTY>
@@ -28,4 +30,4 @@
<!ELEMENT session (file+)>
<!ELEMENT file EMPTY>
<!ATTLIST file id CDATA #REQUIRED>
-<!ATTLIST file path CDATA #REQUIRED>
+<!ATTLIST file path CDATA #REQUIRED>
View
2 conf/pgmodeler.conf
@@ -14,6 +14,8 @@
paper-type="4"
paper-orientation="landscape"
paper-margin="10,10,10,10"
+ print-grid="true"
+ print-pg-num="true"
save-session="true"
save-widgets="true"/>
<widget-conf>
View
2 conf/schemas/pgmodeler.sch
@@ -24,6 +24,8 @@ $sp [<configuration op-list-size="] @{op-list-size} ["] $br
[ paper-type="] @{paper-type} ["] $br
[ paper-orientation="] @{paper-orientation} ["] $br
[ paper-margin="] @{paper-margin} ["] $br
+[ print-grid="] %if @{print-grid} %then true %else false %end ["] $br
+[ print-pg-num="] %if @{print-pg-num} %then true %else false %end ["] $br
[ save-session="] %if @{save-session} %then true %else false %end ["] $br
[ save-widgets="] %if @{save-widgets} %then true %else false %end ["/>] $br
View
104 libpgmodeler/src/relationship.cpp
@@ -85,21 +85,6 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab,
}
}
-vector<QString> Relationship::getRelationshipColumns(void)
-{
- unsigned count, i;
- vector<QString> name_vect;
-
- count=ref_columns.size();
- for(i=0; i < count; i++)
- {
- name_vect.push_back(QString::fromUtf8(ref_columns[i]->getName()) + " (" +
- QString::fromUtf8(*ref_columns[i]->getType()) + ")");
- }
-
- return(name_vect);
-}
-
void Relationship::setMandatoryTable(unsigned table_id, bool value)
{
BaseRelationship::setMandatoryTable(table_id, value);
@@ -196,9 +181,9 @@ void Relationship::createSpecialPrimaryKey(void)
count=column_ids_pk_rel.size();
for(i=0; i < count; i++)
{
- if(column_ids_pk_rel[i] < ref_columns.size() &&
- !pk_special->isColumnExists(ref_columns[column_ids_pk_rel[i]], Constraint::SOURCE_COLS))
- pk_special->addColumn(ref_columns[column_ids_pk_rel[i]], Constraint::SOURCE_COLS);
+ if(column_ids_pk_rel[i] < gen_columns.size() &&
+ !pk_special->isColumnExists(gen_columns[column_ids_pk_rel[i]], Constraint::SOURCE_COLS))
+ pk_special->addColumn(gen_columns[column_ids_pk_rel[i]], Constraint::SOURCE_COLS);
}
try
@@ -292,8 +277,8 @@ bool Relationship::isColumnExists(Column *column)
if(!column)
throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__);
- itr=ref_columns.begin();
- itr_end=ref_columns.end();
+ itr=gen_columns.begin();
+ itr_end=gen_columns.end();
while(itr!=itr_end && !found)
{
@@ -485,27 +470,30 @@ void Relationship::removeConstraint(unsigned constr_idx)
removeObject(constr_idx, OBJ_CONSTRAINT);
}
-Column *Relationship::getReferencedColumn(const QString &col_name)
+vector<Column *> Relationship::getGeneratedColumns(void)
{
- vector<Column *>::iterator itr, itr_end;
- Column *col=NULL;
- bool found=false, format;
+ return(gen_columns);
+}
- format=col_name.contains("\"");
- itr=ref_columns.begin();
- itr_end=ref_columns.end();
+Table *Relationship::getGeneratedTable(void)
+{
+ return(table_relnn);
+}
- while(itr!=itr_end && !found)
- {
- col=(*itr);
- found=(col->getName(format)==col_name);
- itr++;
- }
+vector<Constraint *> Relationship::getGeneratedConstraints(void)
+{
+ vector<Constraint *> vect;
- if(found)
- return(col);
- else
- return(NULL);
+ if(fk_rel1n)
+ vect.push_back(fk_rel1n);
+
+ if(uq_rel11)
+ vect.push_back(uq_rel11);
+
+ if(pk_relident)
+ vect.push_back(pk_relident);
+
+ return(vect);
}
TableObject *Relationship::getObject(unsigned obj_idx, ObjectType obj_type)
@@ -852,9 +840,9 @@ void Relationship::addColumnsRelGen(void)
in the list of referencing columns, and additionally the
relationship columns will also be inserted directly in the
source table, which inherits or copy table columns from target table */
- ref_columns=columns;
- itr=ref_columns.begin();
- itr_end=ref_columns.end();
+ gen_columns=columns;
+ itr=gen_columns.begin();
+ itr_end=gen_columns.end();
while(itr!=itr_end)
{
src_tab->addColumn((*itr));
@@ -1009,9 +997,9 @@ void Relationship::configureIndentifierRel(Table *dst_tab)
}
//Adds the columns from the strong entity primary key on the weak entity primary key
- count=ref_columns.size();
+ count=gen_columns.size();
for(i=0; i < count; i++)
- pk->addColumn(ref_columns[i], Constraint::SOURCE_COLS);
+ pk->addColumn(gen_columns[i], Constraint::SOURCE_COLS);
//Inserts the configured primary key on the receiver table (if there is no pk on it)
if(new_pk)
@@ -1041,11 +1029,11 @@ void Relationship::addUniqueKey(Table *ref_tab, Table *recv_tab)
}
//Adds the referenced columns as the unique key columns
- count=ref_columns.size();
+ count=gen_columns.size();
i=0;
while(i < count)
- uq->addColumn(ref_columns[i++], Constraint::SOURCE_COLS);
+ uq->addColumn(gen_columns[i++], Constraint::SOURCE_COLS);
//Configures the name for the constraint
i=1;
@@ -1103,7 +1091,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del
/* Gets the primary key from the reference table in order to reference its columns
on the primary key */
pk=ref_tab->getPrimaryKey();
- qty=ref_columns.size();
+ qty=gen_columns.size();
i=i1=0;
/* Special condition for n-n relationships.
@@ -1139,7 +1127,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del
while(i < qty)
{
- column=ref_columns[i];
+ column=gen_columns[i];
column_aux=pk->getColumn(i1, Constraint::SOURCE_COLS);
//Link the two columns on the foreign key
@@ -1271,7 +1259,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null)
aux="";
column=new Column;
- ref_columns.push_back(column);
+ gen_columns.push_back(column);
//Add the current primary key source column on the list
column_aux=pk->getColumn(i, Constraint::SOURCE_COLS);
@@ -1483,10 +1471,10 @@ void Relationship::addColumnsRelNn(void)
pk_tabnn->setName(table_relnn->getName() + "_pk");
pk_tabnn->setConstraintType(ConstraintType::primary_key);
pk_tabnn->setAddedByLinking(true);
- count=ref_columns.size();
+ count=gen_columns.size();
for(i=0; i < count; i++)
- pk_tabnn->addColumn(ref_columns[i],Constraint::SOURCE_COLS);
+ pk_tabnn->addColumn(gen_columns[i],Constraint::SOURCE_COLS);
table_relnn->addConstraint(pk_tabnn);
@@ -1766,8 +1754,8 @@ void Relationship::disconnectRelationship(bool rem_tab_objs)
}
- itr=ref_columns.begin();
- itr_end=ref_columns.end();
+ itr=gen_columns.begin();
+ itr_end=gen_columns.end();
//Destroy the columns created by the relationship
while(itr!=itr_end)
@@ -1781,7 +1769,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs)
delete(column);
}
- ref_columns.clear();
+ gen_columns.clear();
pk_columns.clear();
col_suffixes.clear();
@@ -1893,7 +1881,7 @@ bool Relationship::isInvalidated(void)
for(i=0; i < rel_cols_count && valid; i++)
{
//Gets one column from the foreign key
- col2=ref_columns[i];
+ col2=gen_columns[i];
//Gets one column from the primary key
col1=pk_columns[i];
@@ -1940,14 +1928,14 @@ bool Relationship::isInvalidated(void)
/* Gets the number of columns created with the connection of the relationship
and summing with the number of columns rejected at the time of connection
according to the rules of copyColumns() method */
- rel_cols_count=ref_columns.size() + rejected_col_count;
+ rel_cols_count=gen_columns.size() + rejected_col_count;
valid=(rel_cols_count == tab_cols_count);
/* Checking if the columns created with inheritance / copy still exist
in reference table */
- for(i=0; i < ref_columns.size() && valid; i++)
- valid=table->getColumn(ref_columns[i]->getName(true));
+ for(i=0; i < gen_columns.size() && valid; i++)
+ valid=table->getColumn(gen_columns[i]->getName(true));
/* Checking if the reference table columns are in the receiver table.
In theory all columns must exist in the two table because one
@@ -2130,7 +2118,7 @@ QString Relationship::getCodeDefinition(unsigned def_type)
count=column_ids_pk_rel.size();
for(i=0; i < count; i++)
{
- if(!ref_columns.empty() && i < ref_columns.size())
+ if(!gen_columns.empty() && i < gen_columns.size())
{
attributes[ParsersAttributes::SPECIAL_PK_COLS]+=QString("%1").arg(column_ids_pk_rel[i]);
if(i < count-1) attributes[ParsersAttributes::SPECIAL_PK_COLS]+=",";
@@ -2173,7 +2161,7 @@ void Relationship::operator = (Relationship &rel)
this->tab_name_relnn=rel.tab_name_relnn;
this->table_relnn=NULL;
this->fk_rel1n=pk_relident=pk_special=NULL;
- this->ref_columns.clear();
+ this->gen_columns.clear();
this->auto_suffix=rel.auto_suffix;
}
View
22 libpgmodeler/src/relationship.h
@@ -130,7 +130,7 @@ class Relationship: public BaseRelationship {
/* Stores the columns which are created to be referenced by foreign keys
in order to represent the relationship */
- vector<Column *> ref_columns,
+ vector<Column *> gen_columns,
/* Stores the primary key columns which from the referenced table
This vector is used by the relationship validation method. */
@@ -254,6 +254,17 @@ class Relationship: public BaseRelationship {
//Destroy all the relationship attributes and constraints
void destroyObjects(void);
+ //Returns all the refenced columns of the relationship
+ vector<Column *> getGeneratedColumns(void);
+
+ //Returns the table generated by the n-n relationship
+ Table *getGeneratedTable(void);
+
+ /* Returns the generated foreign key that represents the 1-1, 1-n relationship,
+ as well the primary key generated by the identifier relationship and the
+ unique key used in 1-1 relationships */
+ vector<Constraint *> getGeneratedConstraints(void);
+
public:
//String used as the name suffix separator. Default '_'
static const QString SUFFIX_SEPARATOR;
@@ -275,9 +286,6 @@ class Relationship: public BaseRelationship {
deallocating all the created object. */
void disconnectRelationship(bool rem_tab_objs=true);
- //Returns the relationship generated columns names
- vector<QString> getRelationshipColumns(void);
-
//Defines the mandatory participation for the specified table
void setMandatoryTable(unsigned table_id, bool value);
@@ -376,10 +384,7 @@ class Relationship: public BaseRelationship {
Constraint *getConstraint(unsigned constr_idx);
//Gets an constraint using its name
- Constraint *getConstraint(const QString &name);
-
- //Returns a referenced column using its name
- Column *getReferencedColumn(const QString &col_name);
+ Constraint *getConstraint(const QString &name);
/* Returns the index of a relationship attribute or constraint. Returns -1
when the object doesn't exists */
@@ -425,6 +430,7 @@ class Relationship: public BaseRelationship {
void operator = (Relationship &rel);
friend class DatabaseModel;
+ friend class RelacionamentoWidget;
};
#endif
View
8 libpgmodeler_ui/src/confgeralwidget.cpp
@@ -28,6 +28,8 @@ ConfGeralWidget::ConfGeralWidget(QWidget * parent) : QWidget(parent)
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_WIDGETS]="";
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]="";
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGET]="";
+ params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]="";
+ params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]="";
}
void ConfGeralWidget::carregarConfiguracao(void)
@@ -54,6 +56,9 @@ void ConfGeralWidget::carregarConfiguracao(void)
salvar_wgts_chk->setChecked(params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_WIDGETS]==ParsersAttributes::_TRUE_);
salvar_sessao_chk->setChecked(params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_SESSION]==ParsersAttributes::_TRUE_);
+ print_grid_chk->setChecked(params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]==ParsersAttributes::_TRUE_);
+ print_pg_num_chk->setChecked(params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]==ParsersAttributes::_TRUE_);
+
papel_cmb->setCurrentIndex((params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]).toUInt());
retrato_rb->setChecked(params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]==ParsersAttributes::PORTRAIT);
paisagem_rb->setChecked(params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]==ParsersAttributes::LANDSCAPE);
@@ -106,6 +111,9 @@ void ConfGeralWidget::salvarConfiguracao()
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_SESSION]=(salvar_sessao_chk->isChecked() ? "1" : "");
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_WIDGETS]=(salvar_wgts_chk->isChecked() ? "1" : "");
+ params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? "1" : "");
+ params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]=(print_grid_chk->isChecked() ? "1" : "");
+
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]="";
params_config[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGET]="";
View
39 libpgmodeler_ui/src/formprincipal.cpp
@@ -989,42 +989,7 @@ void FormPrincipal::imprimirModelo(void)
QPrinter::Orientation orientacao, orient_atual;
QRectF margens;
unsigned ml,mt,mr,mb, ml1, mt1, mr1, mb1;
- QCheckBox *impgrade_chk=NULL, *impnumpag_chk;
- QVBoxLayout *layout=NULL;
- QGridLayout *grid=NULL;
- deque<QWidget *> wgts;
- QGroupBox *gb=new QGroupBox(&print_dlg);
-
- /* Cria dois checkboxes no diálogo de impressão, um
- que indica a impressão da grade e outro do número de páginas */
- impgrade_chk=new QCheckBox(&print_dlg);
- impgrade_chk->setText(trUtf8("Print grid"));
- impgrade_chk->setChecked(true);
-
- impnumpag_chk=new QCheckBox(&print_dlg);
- impnumpag_chk->setText(trUtf8("Print page numbers"));
- impnumpag_chk->setChecked(true);
-
- grid=new QGridLayout;
- grid->addWidget(impgrade_chk,0,0,1,1);
- grid->addWidget(impnumpag_chk,0,1,1,1);
- gb->setLayout(grid);
- gb->setTitle(trUtf8("Model Options"));
-
- layout=dynamic_cast<QVBoxLayout *>(print_dlg.layout());
- while(layout->count()!=0)
- {
- wgts.push_back(layout->itemAt(0)->widget());
- layout->removeItem(layout->itemAt(0));
- }
-
- //Adiciona os widgets no diálogo
- layout->addWidget(gb);
- while(!wgts.empty())
- {
- layout->addWidget(wgts.front());
- wgts.pop_front();
- }
+ ConfGeralWidget *conf_wgt=dynamic_cast<ConfGeralWidget *>(fconfiguracao->obterWidgetConfiguracao(0));
print_dlg.setOption(QAbstractPrintDialog::PrintCurrentPage, false);
print_dlg.setWindowTitle(trUtf8("Database model printing"));
@@ -1073,7 +1038,7 @@ void FormPrincipal::imprimirModelo(void)
}
//Imprime o modelo com as configurações setadas
- modelo_atual->imprimirModelo(printer, impgrade_chk->isChecked(), impnumpag_chk->isChecked());
+ modelo_atual->imprimirModelo(printer, conf_wgt->print_grid_chk->isChecked(), conf_wgt->print_pg_num_chk->isChecked());
}
}
}
View
184 libpgmodeler_ui/src/relacionamentowidget.cpp
@@ -1,10 +1,12 @@
#include "relacionamentowidget.h"
#include "restricaowidget.h"
#include "colunawidget.h"
+#include "tabelawidget.h"
#include "caixamensagem.h"
extern RestricaoWidget *restricao_wgt;
extern ColunaWidget *coluna_wgt;
+extern TabelaWidget *tabela_wgt;
extern CaixaMensagem *caixa_msg;
RelacionamentoWidget::RelacionamentoWidget(QWidget *parent): ObjetoBaseWidget(parent, OBJ_RELATIONSHIP)
@@ -41,6 +43,8 @@ RelacionamentoWidget::RelacionamentoWidget(QWidget *parent): ObjetoBaseWidget(pa
(TabelaObjetosWidget::BTN_ATUALIZAR_ITEM |
TabelaObjetosWidget::BTN_MOVER_ITENS), true, this);
+ tab_objs_avancados=new TabelaObjetosWidget(TabelaObjetosWidget::BTN_EDITAR_ITEM, true, this);
+
//Configurando os rótulos e ícones das colunas das tabelas
tab_atributos->definirNumColunas(2);
tab_atributos->definirRotuloCabecalho(trUtf8("Attribute"), 0);
@@ -54,6 +58,14 @@ RelacionamentoWidget::RelacionamentoWidget(QWidget *parent): ObjetoBaseWidget(pa
tab_restricoes->definirRotuloCabecalho(trUtf8("Type"), 1);
tab_restricoes->definirIconeCabecalho(QPixmap(":/icones/icones/usertype.png"),1);
+ tab_objs_avancados->definirNumColunas(2);
+ tab_objs_avancados->definirRotuloCabecalho(trUtf8("Name"), 0);
+ tab_objs_avancados->definirIconeCabecalho(QPixmap(":/icones/icones/column.png"),0);
+ tab_objs_avancados->definirRotuloCabecalho(trUtf8("Type"), 1);
+ tab_objs_avancados->definirIconeCabecalho(QPixmap(":/icones/icones/usertype.png"),1);
+
+ connect(tab_objs_avancados, SIGNAL(s_linhaEditada(int)), this, SLOT(exibirObjetoAvancado(int)));
+
//Adiciona as tabelas alocadas s respectivas abas
grid=new QGridLayout;
grid->addWidget(tab_atributos, 0,0,1,1);
@@ -73,11 +85,22 @@ RelacionamentoWidget::RelacionamentoWidget(QWidget *parent): ObjetoBaseWidget(pa
grid=dynamic_cast<QGridLayout *>(atributosrel_tbw->widget(3)->layout());
//Gera um frame de informação sobre a criação de chave primária especial
- frame=gerarFrameInformacao(trUtf8("Use the special primary key if you want to include a primary key containing inherited / copied columns to the receiving table. This is a feature available only for generalization / dependency relationships."));
+ frame=gerarFrameInformacao(trUtf8("Use the special primary key if you want to include a primary key containing inherited / copied columns to the receiving table. This is a feature available only for generalization / copy relationships."));
grid->addWidget(frame, 1, 0, 1, 1);
frame->setParent(atributosrel_tbw->widget(3));
+ grid=new QGridLayout;
+ grid->setContentsMargins(2,2,2,2);
+
+ grid->addWidget(tab_objs_avancados, 0, 0, 1, 1);
+
+ //Gera um frame de informação sobre a aba avançada
+ frame=gerarFrameInformacao(trUtf8("This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables."));
+ grid->addWidget(frame, 1, 0, 1, 1);
+
+ atributosrel_tbw->widget(4)->setLayout(grid);
+
configurarLayouFormulario(relacionamento_grid, OBJ_RELATIONSHIP);
janela_pai->setMinimumSize(600, 520);
@@ -197,8 +220,8 @@ void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList
void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList *lista_op, BaseRelationship *relacao)
{
- static QWidget *tabs[3]={ atributosrel_tbw->widget(1), atributosrel_tbw->widget(2), atributosrel_tbw->widget(3) };
- static QString rot_tabs[3]={ atributosrel_tbw->tabText(1), atributosrel_tbw->tabText(2), atributosrel_tbw->tabText(3) };
+ static QWidget *tabs[4]={ atributosrel_tbw->widget(1), atributosrel_tbw->widget(2), atributosrel_tbw->widget(3), atributosrel_tbw->widget(4) };
+ static QString rot_tabs[4]={ atributosrel_tbw->tabText(1), atributosrel_tbw->tabText(2), atributosrel_tbw->tabText(3), atributosrel_tbw->tabText(4)};
unsigned tipo_rel, i;
Relationship *relacao_aux=NULL;
bool rel1n, relnn, relgen_dep;
@@ -241,7 +264,8 @@ void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList
//Caso o relacionamento seja entre tabelas
if(relacao->getObjectType()==OBJ_RELATIONSHIP)
{
- vector<QString> vet_cols;
+ //vector<QString> vet_cols;
+ vector<Column *> vet_cols;
vector<unsigned> vet_id_cols;
int qtd, i;
QListWidgetItem *item=NULL;
@@ -281,11 +305,13 @@ void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList
if(this->novo_obj)
{
relacao_aux->connectRelationship();
- vet_cols=relacao_aux->getRelationshipColumns();
+ //vet_cols=relacao_aux->getRelationshipColumnsNames();
+ vet_cols=relacao_aux->getGeneratedColumns();
relacao_aux->disconnectRelationship();
}
else
- vet_cols=relacao_aux->getRelationshipColumns();
+ //vet_cols=relacao_aux->getRelationshipColumnsNames();
+ vet_cols=relacao_aux->getGeneratedColumns();
//Obtém os índices das colunas da chave primária especial no relacionamento
vet_id_cols=relacao_aux->getSpecialPrimaryKeyCols();
@@ -294,7 +320,8 @@ void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList
qtd=vet_cols.size();
for(i=0; i < qtd; i++)
{
- coluna_rel_lst->addItem(vet_cols[i]);
+ coluna_rel_lst->addItem(vet_cols[i]->getName().toUtf8() +
+ " (" + QString::fromUtf8(*vet_cols[i]->getType()) + ")");
item=coluna_rel_lst->item(i);
item->setCheckState(Qt::Unchecked);
}
@@ -359,7 +386,7 @@ void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList
nome_tab_relnn_lbl->setVisible(relnn);
nome_tab_relnn_edt->setVisible(relnn);
- for(i=0; i < 3; i++)
+ for(i=0; i < 4; i++)
atributosrel_tbw->removeTab(1);
if(!relgen_dep)
@@ -368,9 +395,15 @@ void RelacionamentoWidget::definirAtributos(DatabaseModel *modelo, OperationList
atributosrel_tbw->addTab(tabs[i], rot_tabs[i]);
}
else if(relgen_dep && relacao->getObjectType()==OBJ_RELATIONSHIP)
- {
atributosrel_tbw->addTab(tabs[2], rot_tabs[2]);
- }
+
+ if(relacao->getObjectType()==OBJ_RELATIONSHIP ||
+ (relacao->getObjectType()==BASE_RELATIONSHIP &&
+ relacao->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK))
+ atributosrel_tbw->addTab(tabs[3], rot_tabs[3]);
+
+
+ listarObjetosAvancados();
}
void RelacionamentoWidget::listarObjetos(ObjectType tipo_obj)
@@ -416,6 +449,137 @@ void RelacionamentoWidget::listarObjetos(ObjectType tipo_obj)
}
}
+void RelacionamentoWidget::listarObjetosAvancados(void)
+{
+ BaseRelationship *rel_base=NULL;
+ Relationship *relacao=NULL;
+ Table *tab=NULL;
+ vector<Column *> cols;
+ vector<Constraint *> constrs;
+ unsigned qtd=0, i,i1;
+
+ try
+ {
+ //Obtém a referência ao relacionamento
+ rel_base=dynamic_cast<BaseRelationship *>(this->objeto);
+ relacao=dynamic_cast<Relationship *>(rel_base);
+
+ //Remove as linhas da tabela antes da exibição dos elementos
+ tab_objs_avancados->blockSignals(true);
+ tab_objs_avancados->removerLinhas();
+
+ if(relacao)
+ {
+ if(relacao->getRelationshipType()!=BaseRelationship::RELATIONSHIP_NN)
+ {
+ //Listando as colunas geradas pelo relacionamento
+ cols=relacao->getGeneratedColumns();
+ qtd=cols.size();
+
+ for(i=0; i < qtd; i++)
+ {
+ tab_objs_avancados->adicionarLinha();
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(cols[i]->getName()),i,0);
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(cols[i]->getTypeName()),i,1);
+ tab_objs_avancados->definirDadoLinha(QVariant::fromValue<void *>(cols[i]), i);
+ }
+
+ //Listando as restrições geradas pelo relacionamento
+ constrs=relacao->getGeneratedConstraints();
+ qtd=constrs.size();
+
+ for(i=0, i1=tab_objs_avancados->obterNumLinhas(); i < qtd; i++,i1++)
+ {
+ tab_objs_avancados->adicionarLinha();
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(constrs[i]->getName()),i1,0);
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(constrs[i]->getTypeName()),i1,1);
+ tab_objs_avancados->definirDadoLinha(QVariant::fromValue<void *>(constrs[i]), i1);
+ }
+ }
+ else
+ {
+ //Lista a tabela gerada pelo relacionamento n-n
+ tab=relacao->getGeneratedTable();
+ tab_objs_avancados->adicionarLinha();
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(tab->getName()),0,0);
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(tab->getTypeName()),0,1);
+ tab_objs_avancados->definirDadoLinha(QVariant::fromValue<void *>(tab), 0);
+ }
+ }
+ else if(rel_base->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)
+ {
+ //Listando as chaves estrangeiras da tabela receptora
+ dynamic_cast<Table *>(rel_base->getTable(BaseRelationship::SRC_TABLE))->getForeignKeys(constrs);
+ tab=dynamic_cast<Table *>(rel_base->getTable(BaseRelationship::DST_TABLE));
+ qtd=constrs.size();
+
+ for(i=0, i1=tab_objs_avancados->obterNumLinhas(); i < qtd; i++)
+ {
+ //Lista apenas as fks que referenciam a tabela de destino do relacionamento
+ if(constrs[i]->getReferencedTable()==tab)
+ {
+ tab_objs_avancados->adicionarLinha();
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(constrs[i]->getName()),i1,0);
+ tab_objs_avancados->definirTextoCelula(QString::fromUtf8(constrs[i]->getTypeName()),i1,1);
+ tab_objs_avancados->definirDadoLinha(QVariant::fromValue<void *>(constrs[i]), i1);
+ i1++;
+ }
+ }
+ }
+
+ tab_objs_avancados->limparSelecao();
+ tab_objs_avancados->blockSignals(false);
+
+ }
+ catch(Exception &e)
+ {
+ throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e);
+ }
+}
+
+void RelacionamentoWidget::exibirObjetoAvancado(int idx)
+{
+ BaseObject *objeto=reinterpret_cast<BaseObject *>(tab_objs_avancados->obterDadoLinha(idx).value<void *>());
+ bool prot=true;
+ Table *tab=NULL;
+ Constraint *constr=NULL;
+ Column *col=NULL;
+
+ switch(objeto->getObjectType())
+ {
+ case OBJ_COLUMN:
+ col=dynamic_cast<Column *>(objeto);
+ coluna_wgt->definirAtributos(this->modelo, col->getParentTable(), this->lista_op, col);
+ coluna_wgt->show();
+ break;
+
+ case OBJ_CONSTRAINT:
+ constr=dynamic_cast<Constraint *>(objeto);
+
+ if(!constr->isAddedByRelationship())
+ {
+ prot=constr->isProtected();
+ constr->setProtected(true);
+ }
+
+ restricao_wgt->definirAtributos(this->modelo, constr->getParentTable(), this->lista_op, constr);
+ restricao_wgt->show();
+ constr->setProtected(prot);
+ break;
+
+ default:
+ //Not working with dynamic_cast ???
+ tab=reinterpret_cast<Table *>(objeto);
+
+ tab->setProtected(true);
+ tabela_wgt->definirAtributos(this->modelo, this->lista_op, tab,
+ tab->getPosition().x(), tab->getPosition().y());
+ tabela_wgt->show();
+ tab->setProtected(false);
+ break;
+ }
+}
+
void RelacionamentoWidget::adicionarObjeto(void)
{
ObjectType tipo_obj=BASE_OBJECT;
View
12 libpgmodeler_ui/src/relacionamentowidget.h
@@ -41,12 +41,16 @@ class RelacionamentoWidget: public ObjetoBaseWidget, public Ui::RelacionamentoWi
//Tabela as quais armazenam os atributos e restrições do relacionamento
TabelaObjetosWidget *tab_atributos,
- *tab_restricoes;
+ *tab_restricoes,
+ *tab_objs_avancados;
/* Lista os objetos do relacionamento na tabela respectiva, de acordo
com o tipo do objeto passado */
void listarObjetos(ObjectType tipo_obj);
+ //Lista os objetos avançados
+ void listarObjetosAvancados(void);
+
//Exibe os dados de um objeto do relacionamento na lista específica de sua tabela
void exibirDadosObjeto(TableObject *objeto, int idx_lin);
@@ -62,13 +66,19 @@ class RelacionamentoWidget: public ObjetoBaseWidget, public Ui::RelacionamentoWi
//Adiciona um objeto tabela a qual aciona o método
void adicionarObjeto(void);
+
//Edita um objeto selecionado na tabela a qual aciona o método
void editarObjeto(int idx_lin);
+
//Remove um objeto selecionado na tabela a qual aciona o método
void removerObjeto(int idx_lin);
+
//Remove todos os objetos da tabela a qual aciona o método
void removerObjetos(void);
+ //Exibe o formulário referente ao objeto criado ou que representa o relationamento
+ void exibirObjetoAvancado(int idx);
+
public slots:
void aplicarConfiguracao(void);
void cancelarConfiguracao(void);
View
671 libpgmodeler_ui/ui/confgeralwidget.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>481</width>
- <height>288</height>
+ <width>492</width>
+ <height>311</height>
</rect>
</property>
<property name="minimumSize">
@@ -26,239 +26,63 @@
<property name="spacing">
<number>6</number>
</property>
- <item row="0" column="0" colspan="2">
- <widget class="QLabel" name="tam_grade_lbl">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>120</width>
- <height>0</height>
- </size>
- </property>
+ <item row="6" column="0">
+ <widget class="QLabel" name="print_op_lbl">
<property name="text">
- <string>Grid size:</string>
+ <string>Printing Options:</string>
</property>
</widget>
</item>
- <item row="0" column="2" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="QSpinBox" name="tam_grade_spb">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="minimum">
- <number>10</number>
- </property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>1</number>
- </property>
- <property name="value">
- <number>20</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_9">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>pixels</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QLabel" name="tam_lista_lbl">
+ <item row="3" column="0" colspan="2">
+ <widget class="QCheckBox" name="salvar_wgts_chk">
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>120</width>
+ <width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
- <string>Operation history:</string>
+ <string>Save widgets position</string>
</property>
</widget>
</item>
- <item row="1" column="2" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QSpinBox" name="tam_lista_spb">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="minimum">
- <number>500</number>
- </property>
- <property name="maximum">
- <number>1000</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_8">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>items</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="salvar_mod_chk">
+ <item row="10" column="1">
+ <widget class="QComboBox" name="unidade_cmb">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
- <size>
- <width>160</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Save model every:</string>
+ <property name="currentIndex">
+ <number>0</number>
</property>
- </widget>
- </item>
- <item row="2" column="2" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
- <widget class="QSpinBox" name="salvar_mod_spb">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>30</number>
- </property>
- </widget>
+ <property name="text">
+ <string>Milimeters</string>
+ </property>
</item>
<item>
- <widget class="QLabel" name="label_3">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>50</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>minute(s)</string>
- </property>
- </widget>
+ <property name="text">
+ <string>Pixels</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inches</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Centimeter</string>
+ </property>
</item>
- </layout>
- </item>
- <item row="3" column="0" colspan="2">
- <widget class="QCheckBox" name="salvar_wgts_chk">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="text">
- <string>Save widgets position</string>
- </property>
</widget>
</item>
<item row="4" column="0" colspan="2">
@@ -280,36 +104,7 @@
</property>
</widget>
</item>
- <item row="5" column="0" colspan="4">
- <widget class="QFrame" name="frame_2">
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>10</height>
- </size>
- </property>
- <property name="frameShape">
- <enum>QFrame::HLine</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="papel_lbl">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Paper:</string>
- </property>
- </widget>
- </item>
- <item row="6" column="1" colspan="3">
+ <item row="7" column="1" colspan="4">
<widget class="QComboBox" name="papel_cmb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -483,53 +278,49 @@
</item>
</widget>
</item>
- <item row="7" column="0">
- <widget class="QLabel" name="orientacao_lbl">
- <property name="sizePolicy">
+ <item row="5" column="0" colspan="5">
+ <widget class="QFrame" name="frame_2">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>10</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="papel_lbl">
+ <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
- <string>Orientation:</string>
+ <string>Paper:</string>
</property>
</widget>
</item>
- <item row="7" column="1" colspan="3">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QRadioButton" name="retrato_rb">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Portrait</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="paisagem_rb">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Landscape</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
+ <item row="9" column="0">
+ <widget class="QLabel" name="orientacao_lbl">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Orientation:</string>
+ </property>
+ </widget>
</item>
- <item row="8" column="0">
+ <item row="10" column="0">
<widget class="QLabel" name="margens_lbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
@@ -542,40 +333,106 @@
</property>
</widget>
</item>
- <item row="8" column="1">
- <widget class="QComboBox" name="unidade_cmb">
+ <item row="2" column="0" colspan="2">
+ <widget class="QCheckBox" name="salvar_mod_chk">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="currentIndex">
- <number>0</number>
+ <property name="minimumSize">
+ <size>
+ <width>160</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Autosave interval:</string>
</property>
- <item>
- <property name="text">
- <string>Milimeters</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Pixels</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Inches</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Centimeter</string>
- </property>
- </item>
</widget>
</item>
- <item row="8" column="2" rowspan="2" colspan="2">
+ <item row="0" column="0" colspan="2">
+ <widget class="QLabel" name="tam_grade_lbl">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Grid size:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QLabel" name="tam_lista_lbl">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Operation history:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="11" column="0" colspan="2">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>181</width>
+ <height>22</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="12" column="4">
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="6" column="1">
+ <widget class="QCheckBox" name="print_grid_chk">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Print grid</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="2" rowspan="2" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
@@ -695,31 +552,209 @@
</item>
</layout>
</item>
- <item row="9" column="0" colspan="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <item row="9" column="1">
+ <widget class="QRadioButton" name="paisagem_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>181</width>
- <height>22</height>
- </size>
+ <property name="text">
+ <string>Landscape</string>
</property>
- </spacer>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
- <item row="10" column="3">
- <spacer name="verticalSpacer_3">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
+ <item row="9" column="2" colspan="2">
+ <widget class="QRadioButton" name="retrato_rb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>30</height>
- </size>
+ <property name="text">
+ <string>Portrait</string>
</property>
- </spacer>
+ </widget>
+ </item>
+ <item row="6" column="2" colspan="3">
+ <widget class="QCheckBox" name="print_pg_num_chk">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Print page numbers</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QSpinBox" name="salvar_mod_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>30</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>minute(s)</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QSpinBox" name="tam_lista_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>500</number>
+ </property>
+ <property name="maximum">
+ <number>1000</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_8">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>items</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="2" colspan="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QSpinBox" name="tam_grade_spb">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="minimum">
+ <number>10</number>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="singleStep">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>20</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_9">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>pixels</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</widget>
View
11 libpgmodeler_ui/ui/relacionamentowidget.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>550</width>
- <height>344</height>
+ <width>865</width>
+ <height>370</height>
</rect>
</property>
<property name="sizePolicy">
@@ -782,7 +782,7 @@
<item row="0" column="0">
<widget class="QListWidget" name="coluna_rel_lst">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -797,6 +797,11 @@
</item>
</layout>
</widget>
+ <widget class="QWidget" name="tab_5">
+ <attribute name="title">
+ <string>Advanced</string>
+ </attribute>
+ </widget>
</widget>
</item>
</layout>
View
4 libutil/src/parsersattributes.h
@@ -336,7 +336,9 @@ static const QString
AUTO_SUFFIX="auto-sufix",
VARIATION="variation",
SPATIAL_TYPE="spatial-type",
- COLS_COMMENT="cols-comment";
+ COLS_COMMENT="cols-comment",
+ PRINT_GRID="print-grid",
+ PRINT_PG_NUM="print-pg-num";
}
#endif

0 comments on commit d716a3e

Please sign in to comment.
Something went wrong with that request. Please try again.