enum { NumComandButton = 13 }; /* on header */
/* valid action */
QList<QAction *> actionlist = Layer->MainActions();
Q_ASSERT ( actionlist.size() == NumComandButton );
for (int i = 0; i < NumComandButton; ++i) {
tbutton[i]->SetAction(actionlist[i]);
tbutton[i]->setEnabled(true);
}
enum { NumComandButton = 13 }; /* on header */
/* valid action */
QList<QAction *> actionlist = Layer->MainActions();
Q_ASSERT ( actionlist.size() == NumComandButton );
for (int i = 0; i < NumComandButton; ++i) {
tbutton[i]->SetAction(actionlist[i]);
tbutton[i]->setEnabled(true);
}
To copy to clipboard, switch view to plain text mode
{
bold_base_font = qApp->font();
flags_yes = Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
flags_no = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
bold_base_font.setBold ( true );
Hitem1->setData(bold_base_font,Qt::FontRole);
Hitem2->setData(bold_base_font,Qt::FontRole);
model->setHorizontalHeaderItem(0,Hitem1);
model->setHorizontalHeaderItem(1,Hitem2);
model->invisibleRootItem()->appendRow(ReadOnlyValue("epoche",tr("ID:")));
model->invisibleRootItem()->appendRow(TagValue("cat",tr("Category:")));
model->invisibleRootItem()->appendRow(TagName("tit_",tr("Title:"),5));
model->invisibleRootItem()->appendRow(TagName("desc_",tr("Description:"),15));
model->invisibleRootItem()->appendRow(TagName("note_",tr("Note:")));
model->invisibleRootItem()->appendRow(TagName("autor_",tr("Autor:")));
model->invisibleRootItem()->appendRow(TagValue("active",tr("Priority:")));
model->invisibleRootItem()->appendRow(TagValue("start",tr("Start time:")));
model->invisibleRootItem()->appendRow(TagValue("stop",tr("Stop time:")));
model->invisibleRootItem()->appendRow(TagValue("worksource",tr("Source work:")));
model->invisibleRootItem()->appendRow(TagValue("bgcolor",tr("Background color:")));
return model;
}
/* each line row */
QList<QStandardItem
*> PageXmlHandler
::TagValue( const QString shortname ,
const QString HumanName
){
noedit->setFlags(flags_no);
noedit->setData(bold_base_font,Qt::FontRole);
noedit->setData(grundierung,Qt::BackgroundColorRole);
QList<QStandardItem *> diritto;
Hitem2->setFlags(flags_yes);
Hitem2->setToolTip ( shortname );
Hitem2->setData(shortname,TAGID);
Hitem2->setData(2,T_FORMAT);
Hitem2->setData(Current->Root_Tag(shortname),OLDVALUE);
diritto.append(noedit);
diritto.append(Hitem2);
return diritto;
}
QStandardItemModel *PageXmlHandler::ModelBase()
{
bold_base_font = qApp->font();
flags_yes = Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
flags_no = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
bold_base_font.setBold ( true );
model = new QStandardItemModel();
QStandardItem *Hitem1 = new QStandardItem(tr("Name"));
QStandardItem *Hitem2 = new QStandardItem(tr("Value"));
Hitem1->setData(bold_base_font,Qt::FontRole);
Hitem2->setData(bold_base_font,Qt::FontRole);
model->setHorizontalHeaderItem(0,Hitem1);
model->setHorizontalHeaderItem(1,Hitem2);
model->invisibleRootItem()->appendRow(ReadOnlyValue("epoche",tr("ID:")));
model->invisibleRootItem()->appendRow(TagValue("cat",tr("Category:")));
model->invisibleRootItem()->appendRow(TagName("tit_",tr("Title:"),5));
model->invisibleRootItem()->appendRow(TagName("desc_",tr("Description:"),15));
model->invisibleRootItem()->appendRow(TagName("note_",tr("Note:")));
model->invisibleRootItem()->appendRow(TagName("autor_",tr("Autor:")));
model->invisibleRootItem()->appendRow(TagValue("active",tr("Priority:")));
model->invisibleRootItem()->appendRow(TagValue("start",tr("Start time:")));
model->invisibleRootItem()->appendRow(TagValue("stop",tr("Stop time:")));
model->invisibleRootItem()->appendRow(TagValue("worksource",tr("Source work:")));
model->invisibleRootItem()->appendRow(TagValue("bgcolor",tr("Background color:")));
return model;
}
/* each line row */
QList<QStandardItem *> PageXmlHandler::TagValue( const QString shortname , const QString HumanName )
{
QStandardItem *noedit = new QStandardItem(HumanName);
noedit->setFlags(flags_no);
noedit->setData(bold_base_font,Qt::FontRole);
noedit->setData(grundierung,Qt::BackgroundColorRole);
QList<QStandardItem *> diritto;
QStandardItem *Hitem2 = new QStandardItem(Current->Root_Tag(shortname).toString());
Hitem2->setFlags(flags_yes);
Hitem2->setToolTip ( shortname );
Hitem2->setData(shortname,TAGID);
Hitem2->setData(2,T_FORMAT);
Hitem2->setData(Current->Root_Tag(shortname),OLDVALUE);
diritto.append(noedit);
diritto.append(Hitem2);
return diritto;
}
To copy to clipboard, switch view to plain text mode
Bookmarks