19 #include "ui_titleblockpropertieswidget.h" 107 ui -> m_date_now_pb -> setDisabled(
true);
108 ui -> m_date_edit -> setDisabled(
true);
109 ui -> m_date_edit -> setDate(QDate::currentDate());
111 if (!
ui -> m_current_date_rb -> isHidden()) {
113 ui -> m_current_date_rb -> setChecked(
true);
116 ui -> m_no_date_rb -> setChecked(
true);
118 ui -> m_fixed_date_rb -> setChecked(
true);
125 ui -> m_fixed_date_rb ->setChecked(
true);
128 ui -> m_no_date_rb -> setChecked(
true);
130 ui -> m_fixed_date_rb -> setChecked(
true);
141 if (index == -1) index = 0;
143 ui -> m_tbt_cb -> setCurrentIndex(index);
154 prop.
title =
ui -> m_title_le -> text();
155 prop.
author =
ui -> m_author_le -> text();
157 prop.
plant =
ui -> m_plant -> text();
160 prop.
folio =
ui -> m_folio_le -> text();
161 prop.
display_at =
ui -> m_display_at_cb -> currentIndex() == 0 ? Qt::BottomEdge : Qt::RightEdge;
163 if (
ui->m_no_date_rb->isChecked()) {
167 else if (
ui -> m_fixed_date_rb -> isChecked()) {
169 prop.
date =
ui->m_date_edit->date();
171 else if (
ui->m_current_date_rb->isVisible() &&
ui->m_current_date_rb->isChecked()) {
173 prop.
date = QDate::currentDate();
195 prop.
title =
ui -> m_title_le -> text();
196 prop.
author =
ui -> m_author_le -> text();
198 prop.
plant =
ui -> m_plant -> text();
201 prop.
folio =
"%autonum";
202 prop.
display_at =
ui -> m_display_at_cb -> currentIndex() == 0 ? Qt::BottomEdge : Qt::RightEdge;
204 if (
ui->m_no_date_rb->isChecked()) {
208 else if (
ui -> m_fixed_date_rb -> isChecked()) {
210 prop.
date =
ui->m_date_edit->date();
212 else if (
ui->m_current_date_rb->isVisible() &&
ui->m_current_date_rb->isChecked()) {
214 prop.
date = QDate::currentDate();
235 if (c -> collection() == qc)
249 ui -> m_tbt_label -> setVisible(visible);
250 ui -> m_tbt_cb -> setVisible(visible);
251 ui -> m_tbt_pb -> setVisible(visible);
259 ui->m_tbt_gb->setDisabled(
ro);
267 int index =
ui -> m_tbt_cb -> currentIndex();
269 return (
ui -> m_tbt_cb -> itemData(index).toString());
291 ui -> m_tab2_vlayout -> addWidget(
m_dcw);
294 ui -> m_current_date_rb -> setVisible(current_date);
296 m_tbt_edit =
new QAction(
tr(
"Éditer ce modèle",
"menu entry"),
this);
297 m_tbt_duplicate =
new QAction(
tr(
"Dupliquer et éditer ce modèle",
"menu entry"),
this);
302 m_tbt_menu =
new QMenu(
tr(
"Title block templates actions"));
309 if (project!=
nullptr){
310 keys_2 = project -> folioAutoNum().keys();
311 foreach (QString str,
keys_2) {
ui -> auto_page_cb -> addItem(str); }
312 if (
ui->auto_page_cb->currentText()==
nullptr)
313 ui->auto_page_cb->addItem(
tr(
"Créer un Folio Numérotation Auto"));
316 ui->auto_page_cb->hide();
317 ui->m_edit_autofolionum_pb->hide();
332 for (
int i = 0; i<
ui->m_tbt_cb->count(); i++) {
333 if (
ui->m_tbt_cb->itemData(i).toString() == tbt_name)
354 ui -> m_tbt_cb ->clear();
380 foreach(QString tbt_name, tbt_c -> templates())
383 ui -> m_tbt_cb -> addItem(icon, tbt_name, tbt_name);
399 if (c -> collection() == qc)
402 if (!collection)
return;
408 QStringList fields = tpl -> listOfVariables();
411 for(
int i =0; i<fields.count(); i++)
412 templateContext.
addValue(fields.at(i),
"");
413 m_dcw -> setContext(templateContext);
422 ui -> m_date_edit -> setDate(QDate::currentDate());
431 if (
ui->auto_page_cb->currentText()!=
tr(
"Créer un Folio Numérotation Auto"))
QString locmach
Location(displayed by the default template)
From an embedded collection (a project for exemple)
QString plant
Plant (displayed by the default template)
Qt::Edge display_at
Edge to display the titleblock.
void openTitleBlockTemplate(const TitleBlockTemplateLocation &, bool=false)
QDate date
Date (displayed by the default template)
QetCollection
Enum used to specify the origin of a collection of thing (title block, element etc...)
bool addValue(const QString &, const QVariant &, bool show=true)
QString filename
Filename (displayed by the default template)
DiagramContext context
Container for the additional, user-defined fields.
virtual TitleBlockTemplateLocation location(const QString &=QString())=0
DateManagement useDate
Wheter to use the date attribute.
QString author
Author of the diagram/folio (displayed by the default template)
QString indexrev
Revision Index (displayed by the default template)
QET::QetCollection collection
Specify the location of the title block.
QString folio
Folio information (displayed by the default template)
QString title
Folio title (displayed by the default template)
static QETApp * instance()
QString template_name
Name of the template used to render the title block - an empty string means "the default template pro...