本文整理汇总了C++中Q3Grid::setMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3Grid::setMargin方法的具体用法?C++ Q3Grid::setMargin怎么用?C++ Q3Grid::setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3Grid
的用法示例。
在下文中一共展示了Q3Grid::setMargin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_tab
void ActivityDialog::init_tab(CondDialog & d, InfoData & cd,
const char * lbl, bool enabled)
{
Q3Grid * grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("Pre\ncondition : "), grid);
d.edpre = new MultiLineEdit(grid);
d.edpre->setText(cd.first);
if (visit)
d.edpre->setReadOnly(TRUE);
new QLabel(TR("Post\ncondition : "), grid);
d.edpost = new MultiLineEdit(grid);
d.edpost->setText(cd.second);
if (visit)
d.edpost->setReadOnly(TRUE);
addTab(grid, lbl);
if (! enabled)
removePage(grid);
}
示例2: init_tab
void PinDialog::init_tab(QWidget *& tab, MultiLineEdit *& ed, const char * v,
const char * lbl, const char * sl, bool enabled) {
bool visit = !hasOkButton();
Q3Grid * grid = new Q3Grid(2, this);
tab = grid;
grid->setMargin(5);
grid->setSpacing(5);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("selection : "), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()), this, sl);
ed = new MultiLineEdit(grid);
QFont font = ed->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
ed->setFont(font);
ed->setText(v);
if (visit)
ed->setReadOnly(TRUE);
addTab(grid, lbl);
if (! enabled)
removePage(grid);
}
示例3: init_uml_tab
void ParameterSetDialog::init_uml_tab()
{
bool visit = !hasOkButton();
BrowserParameterSet * bn =
(BrowserParameterSet *) data->get_browser_node();
Q3VBox * vbox;
Q3Grid * grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(TRUE, grid);
edstereotype->insertItem(toUnicode(data->get_stereotype()));
if (! visit) {
edstereotype->insertStringList(BrowserParameterSet::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlParameterSet));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
vbox = new Q3VBox(grid);
new QLabel(TR("description :"), vbox);
if (! visit) {
connect(new SmallPushButton(TR("Editor"), vbox), SIGNAL(clicked()),
this, SLOT(edit_description()));
}
comment = new MultiLineEdit(grid);
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
QFont font = comment->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
comment->setFont(font);
addTab(grid, "Uml");
}
示例4: data
ComponentDialog::ComponentDialog(SimpleData * nd)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(nd)
{
nd->get_browser_node()->edit_start();
if (nd->get_browser_node()->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("component dialog"));
BrowserComponent * bn = (BrowserComponent *) nd->get_browser_node();
init_uml_tab();
rqs = bn->get_required_classes();
init_l_tab(rq_page, rq_stereotypefilter, &ComponentDialog::rq_stereotypeFilterActivated,
SLOT(rq_stereotypeFilterActivated(const QString &)),
SLOT(require_cls()), SLOT(unrequire_cls()),
lb_rq_available, lb_rq, rqs, TR("Required classes"));
prs = bn->get_provided_classes();
init_l_tab(pr_page, pr_stereotypefilter, &ComponentDialog::pr_stereotypeFilterActivated,
SLOT(pr_stereotypeFilterActivated(const QString &)),
SLOT(provide_cls()), SLOT(unprovide_cls()),
lb_pr_available, lb_pr, prs, TR("Provided classes"));
rzs = bn->get_realizing_classes();
init_l_tab(rz_page, rz_stereotypefilter, &ComponentDialog::rz_stereotypeFilterActivated,
SLOT(rz_stereotypeFilterActivated(const QString &)),
SLOT(realize_cls()), SLOT(unrealize_cls()),
lb_rz_available, lb_rz, rzs, TR("Realizing classes"));
// USER : list key - value
Q3Grid * grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
kvtable = new KeyValuesTable((BrowserComponent *) data->get_browser_node(),
grid, !hasOkButton());
addTab(grid, TR("Properties"));
//
connect(this, SIGNAL(currentChanged(QWidget *)),
this, SLOT(change_tabs(QWidget *)));
open_dialog(this);
}
示例5: data
ParameterSetDialog::ParameterSetDialog(ParameterSetData * nd)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(nd)
{
nd->browser_node->edit_start();
if (nd->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("ParameterSet dialog"));
init_uml_tab();
init_pins_tab();
// USER : list key - value
Q3Grid * grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
kvtable = new KeyValuesTable((BrowserParameterSet *) data->get_browser_node(),
grid, !hasOkButton());
addTab(grid, TR("Properties"));
//
connect(this, SIGNAL(currentChanged(QWidget *)),
this, SLOT(change_tabs(QWidget *)));
open_dialog(this);
}
示例6: QLabel
StateDialog::StateDialog(StateData * d)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), state(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("State dialog"));
visit = !hasOkButton();
BrowserNode * bn = state->browser_node;
Q3Grid * grid;
//
// general tab
//
grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(state->get_stereotype()));
if (!visit) {
edstereotype->insertStringList(BrowserState::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlState));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
connect(new SmallPushButton(TR("specification :"), grid), SIGNAL(clicked()),
this, SLOT(menu_specification()));
edspecification = new Q3ComboBox(FALSE, grid);
edspecification->setSizePolicy(sp);
if (visit) {
if (state->get_specification() == 0)
edspecification->insertItem("");
else
edspecification->insertItem(state->get_specification()->full_name(TRUE));
}
else {
edspecification->insertItem("");
edspecification->setAutoCompletion(completion());
BrowserOperation::instances(opers);
opers.full_names(speclist);
edspecification->insertStringList(speclist);
edspecification->setCurrentItem((state->get_specification() == 0)
? 0
: opers.findRef(state->get_specification()) + 1);
}
switch (((BrowserNode *) bn->parent())->get_type()) {
case UmlState:
case UmlRegion:
if ((state->get_reference() != 0) || (bn->firstChild() == 0)) {
connect(new SmallPushButton(TR("reference :"), grid), SIGNAL(clicked()),
this, SLOT(menu_reference()));
edreference = new Q3ComboBox(FALSE, grid);
edreference->setSizePolicy(sp);
if (visit) {
if (state->get_reference() == 0)
edreference->insertItem("");
else
edreference->insertItem(state->get_reference()->full_name(TRUE));
}
else {
edreference->insertItem("");
edreference->setAutoCompletion(completion());
if (((BrowserState *) bn)->can_reference()) {
BrowserState::instances(states, TRUE);
BrowserNode * st = states.first();
while (st != 0) {
if (!((BrowserState *) bn)->can_reference((BrowserState *) st) ||
((BrowserState *) st)->is_ref()) {
states.remove();
st = states.current();
}
//.........这里部分代码省略.........
示例7: QLabel
ActivityPartitionDialog::ActivityPartitionDialog(ActivityPartitionData * d)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("Activity Partition dialog"));
bool visit = !hasOkButton();
// general tab
BrowserNode * bn = data->get_browser_node();
Q3Grid * grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(data->get_stereotype()));
if (! visit) {
edstereotype->insertStringList(BrowserActivityPartition::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlActivityPartition));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
connect(new SmallPushButton(TR("represents :"), grid), SIGNAL(clicked()),
this, SLOT(menu_represents()));
edrepresents = new Q3ComboBox(FALSE, grid);
if ((data->represents != 0) && !data->represents->deletedp()) {
represented = data->represents;
edrepresents->insertItem(*(data->represents->pixmap(0)),
data->represents->full_name(TRUE));
}
else {
represented = 0;
edrepresents->insertItem("");
}
if (! visit)
edrepresents->insertItem("");
edrepresents->setCurrentItem(0);
edrepresents->setSizePolicy(sp);
Q3HBox * htab;
new QLabel(grid);
htab = new Q3HBox(grid);
new QLabel(" ", htab);
dimension_cb = new QCheckBox(TR("is dimension"), htab);
if (data->is_dimension)
dimension_cb->setChecked(TRUE);
dimension_cb->setDisabled(visit);
new QLabel("", htab);
external_cb = new QCheckBox(TR("is external"), htab);
if (data->is_external)
external_cb->setChecked(TRUE);
external_cb->setDisabled(visit);
new QLabel("", htab);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("description :"), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
comment = new MultiLineEdit(grid);
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
QFont font = comment->font();
if (! hasCodec())
font.setFamily("Courier");
//.........这里部分代码省略.........
示例8: QLabel
ActivityDialog::ActivityDialog(ActivityData * d)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), activity(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("Activity dialog"));
visit = !hasOkButton();
BrowserNode * bn = activity->browser_node;
Q3Grid * grid;
//
// general tab
//
grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(activity->get_stereotype()));
if (!visit) {
edstereotype->insertStringList(BrowserActivity::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlActivity));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
connect(new SmallPushButton(TR("specification :"), grid), SIGNAL(clicked()),
this, SLOT(menu_specification()));
edspecification = new Q3ComboBox(FALSE, grid);
edspecification->setSizePolicy(sp);
if (visit) {
if (activity->get_specification() == 0)
edspecification->insertItem("");
else
edspecification->insertItem(activity->get_specification()->full_name(TRUE));
}
else {
edspecification->insertItem("");
edspecification->setAutoCompletion(completion());
BrowserOperation::instances(opers);
opers.full_names(list);
edspecification->insertStringList(list);
edspecification->setCurrentItem((activity->get_specification() == 0)
? 0
: opers.findRef(activity->get_specification()) + 1);
}
new QLabel(grid);
Q3ButtonGroup * bg =
new Q3ButtonGroup(3, Qt::Horizontal, QString(), grid);
readonly_cb = new QCheckBox(TR("read only"), bg);
if (activity->read_only)
readonly_cb->setChecked(TRUE);
readonly_cb->setDisabled(visit);
singlexec_cb = new QCheckBox(TR("single execution"), bg);
if (activity->single_execution)
singlexec_cb->setChecked(TRUE);
singlexec_cb->setDisabled(visit);
active_cb = new QCheckBox(TR("active"), bg);
if (activity->is_active)
active_cb->setChecked(TRUE);
active_cb->setDisabled(visit);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("description :"), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
//.........这里部分代码省略.........
示例9: QLabel
UseCaseDialog::UseCaseDialog(UseCaseData * u)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), uc(u)
{
BrowserNode * bn = u->browser_node;
bn->edit_start();
if (bn->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("Use Case dialog"));
bool visit = !hasOkButton();
// general tab
Q3Grid * grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(uc->get_stereotype()));
if (! visit) {
edstereotype->insertStringList(BrowserUseCase::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlUseCase));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
new QLabel(TR("extension \npoints : "), grid);
extension_points = new MultiLineEdit(grid);
extension_points->setReadOnly(visit);
extension_points->setText(uc->get_extension_points());
QFont font = extension_points->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
extension_points->setFont(font);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("description :"), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
comment = new MultiLineEdit(grid);
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
comment->setFont(font);
addTab(grid, "Uml");
// USER : list key - value
grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
kvtable = new KeyValuesTable(bn, grid, visit);
addTab(grid, TR("Properties"));
open_dialog(this);
}
示例10: QLabel
AttributeDialog::AttributeDialog(AttributeData * a, bool new_st_attr)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose),
new_in_st(new_st_attr), att(a) {
a->browser_node->edit_start();
if (a->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString::null);
setCancelButton(TR("Close"));
}
visit = !hasOkButton();
ClassData * cld = (ClassData *)
((BrowserNode *) a->browser_node->parent())->get_data();
QString stereotype = cld->get_stereotype();
QString lang_st;
in_enum = (stereotype == "enum");
lang_st = GenerationSettings::cpp_class_stereotype(stereotype);
cpp_in_enum = in_enum || (lang_st == "enum");
cpp_ignored = !cpp_in_enum && ((lang_st == "typedef") || (lang_st == "ignored"));
lang_st = GenerationSettings::java_class_stereotype(stereotype);
java_in_enum = in_enum || (lang_st == "enum");
java_in_enum_pattern = !java_in_enum && (lang_st == "enum_pattern");
java_ignored = (lang_st == "ignored");
lang_st = GenerationSettings::php_class_stereotype(stereotype);
php_in_enum = in_enum || (lang_st == "enum");
php_ignored = !php_in_enum && (lang_st == "ignored");
lang_st = GenerationSettings::python_class_stereotype(stereotype);
python_in_enum = in_enum || (lang_st == "enum");
python_ignored = !python_in_enum && (lang_st == "ignored");
lang_st = GenerationSettings::idl_class_stereotype(stereotype);
idl_in_enum = in_enum || (lang_st == "enum");
idl_in_typedef = !idl_in_enum && (lang_st == "typedef");
idl_in_struct = !idl_in_enum && ((lang_st == "struct") || (lang_st == "exception"));
idl_in_union = !idl_in_enum && (lang_st == "union");
setCaption((in_enum || java_in_enum_pattern) ? TR("Enum item dialog") : TR("Attribute dialog"));
Q3Grid * grid;
Q3HBox * htab;
QString s;
// general tab
grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("class : "), grid);
new QLabel(((BrowserNode *) a->get_browser_node()->parent())->full_name(TRUE),
grid);
new QLabel(TR("name :"), grid);
edname = new LineEdit(a->name(), grid);
edname->setReadOnly(visit);
QFont font = edname->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
if (!java_in_enum_pattern) {
new QLabel(TR("stereotype :"), grid);
htab = new Q3HBox(grid);
edstereotype = new Q3ComboBox(!visit, htab);
edstereotype->insertItem(toUnicode(a->get_stereotype()));
if (!visit) {
edstereotype->insertStringList(BrowserAttribute::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlAttribute));
if (java_in_enum) {
int n = edstereotype->count();
for (attribute_st_rank = 0; attribute_st_rank != n; attribute_st_rank += 1)
if (edstereotype->text(attribute_st_rank) == "attribute")
break;
if (attribute_st_rank == n) {
edstereotype->insertItem("attribute");
n += 1;
}
for (empty_st_rank = 0; empty_st_rank != n; empty_st_rank += 1)
if (edstereotype->text(empty_st_rank).isEmpty())
break;
if (empty_st_rank == n)
edstereotype->insertItem("");
}
edstereotype->setAutoCompletion(completion());
}
//.........这里部分代码省略.........
示例11: QLabel
FlowDialog::FlowDialog(FlowData * d)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), flow(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("Flow dialog"));
visit = !hasOkButton();
BrowserNode * bn = flow->browser_node;
Q3Grid * grid;
//
// general tab
//
grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(flow->get_stereotype()));
if (!visit) {
edstereotype->insertStringList(BrowserFlow::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlFlow));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("description :"), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
comment = new MultiLineEdit(grid);
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
addTab(grid, "Uml");
// UML / OCL
init_tab(uml, flow->uml, "Ocl", SLOT(edit_uml_guard()),
SLOT(edit_uml_selection()), SLOT(edit_uml_transformation()),
TRUE);
// CPP
init_tab(cpp, flow->cpp, "C++", SLOT(edit_cpp_guard()),
SLOT(edit_cpp_selection()), SLOT(edit_cpp_transformation()),
GenerationSettings::cpp_get_default_defs());
// Java
init_tab(java, flow->java, "Java", SLOT(edit_java_guard()),
SLOT(edit_java_selection()), SLOT(edit_java_transformation()),
GenerationSettings::java_get_default_defs());
// USER : list key - value
grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
kvtable = new KeyValuesTable(bn, grid, visit);
addTab(grid, TR("Properties"));
//
connect(this, SIGNAL(currentChanged(QWidget *)),
this, SLOT(change_tabs(QWidget *)));
open_dialog(this);
}
示例12: init_tab
void FlowDialog::init_tab(FlDialog & d, FlowDef & st, const char * lbl,
const char * sl_guard, const char * sl_selection,
const char * sl_transformation, bool enabled)
{
Q3Grid * grid = new Q3Grid(2, this);
Q3VBox * vtab;
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(TR("weight : "), grid);
d.edweight = new LineEdit(grid);
QFont font = d.edweight->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
d.edweight->setFont(font);
d.edweight->setText(st.weight);
if (visit)
d.edweight->setReadOnly(TRUE);
vtab = new Q3VBox(grid);
new QLabel(TR("guard : "), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()), this, sl_guard);
d.edguard = new MultiLineEdit(grid);
d.edguard->setFont(font);
d.edguard->setText(st.guard);
if (visit)
d.edguard->setReadOnly(TRUE);
vtab = new Q3VBox(grid);
new QLabel(TR("selection : "), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()), this, sl_selection);
d.edselection = new MultiLineEdit(grid);
d.edselection->setFont(font);
d.edselection->setText(st.sel_trans.first);
if (visit)
d.edselection->setReadOnly(TRUE);
vtab = new Q3VBox(grid);
new QLabel(TR("transformation : "), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()), this, sl_transformation);
d.edtransformation = new MultiLineEdit(grid);
d.edtransformation->setFont(font);
d.edtransformation->setText(st.sel_trans.second);
if (visit)
d.edtransformation->setReadOnly(TRUE);
addTab(grid, lbl);
if (! enabled)
removePage(grid);
}
示例13: QLabel
SimpleRelationDialog::SimpleRelationDialog(SimpleRelationData * r)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), rel(r)
{
r->browser_node->edit_start();
if (r->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
bool visit = !hasOkButton();
// general tab
BrowserNode * bn = rel->get_browser_node();
Q3Grid * grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
switch (rel->get_type()) {
case UmlInherit:
setCaption(TR("Generalisation dialog"));
break;
case UmlDependOn:
setCaption(TR("Dependency dialog"));
break;
default:
setCaption(TR("unknown relation dialog"));
break;
}
new QLabel(TR("from : "), grid);
new QLabel(rel->get_start_node()->full_name(TRUE), grid);
new QLabel(TR("to : "), grid);
new QLabel(rel->get_end_node()->full_name(TRUE), grid);
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(rel->get_stereotype()));
if (! visit) {
edstereotype->insertStringList(rel->get_start_node()
->default_stereotypes(rel->get_type(),
rel->get_end_node()));
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlRelations));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("description :"), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
comment = new MultiLineEdit(grid);
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
QFont font = comment->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
comment->setFont(font);
addTab(grid, "Uml");
// USER : list key - value
grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
kvtable = new KeyValuesTable(bn, grid, visit);
addTab(grid, TR("Properties"));
open_dialog(this);
}
示例14: QLabel
EnvDialog::EnvDialog(bool conv, bool noid)
: QDialog(0, "Environment dialog", TRUE), conversion(conv)
{
setCaption(TR("Environment dialog"));
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
Q3HBox * htab;
Q3Grid * grid = new Q3Grid(2, this);
QPushButton * button;
QString s;
vbox->addWidget(grid);
grid->setMargin(5);
grid->setSpacing(5);
new QLabel(grid);
new QLabel(TR("MANDATORY, choose a value between 2 and 127 not used by an other person working at the same time on a project with you.\n"
"To be safe, if possible choose a value not used by an other person even not working on a given project with you"),
grid);
new QLabel(TR("Own identifier "), grid);
htab = new Q3HBox(grid);
if (conv)
s = getenv("BOUML_ID"); // yes !
else if (! noid)
s.setNum(user_id());
ed_id = new QLineEdit(s, htab);
if (BrowserView::get_project() != 0) {
ed_id->setEnabled(FALSE);
new QLabel(TR(" The identifier can't be modified while a project is load"), htab);
}
//
new QLabel(grid);
new QLabel(TR("\nOptional, to indicate where are the HTML pages of the reference manual. Used by the help (called by the F1 key) to show the\n"
"chapter corresponding to the kind of the element selected in the browser"),
grid);
new QLabel(TR("Manual path"), grid);
htab = new Q3HBox(grid);
ed_doc = new QLineEdit(htab);
if (!conv)
ed_doc->setText(manual_dir());
new QLabel(" ", htab);
button = new QPushButton(TR("Browse"), htab);
connect(button, SIGNAL(clicked()), this, SLOT(doc_browse()));
//
new QLabel(grid);
new QLabel(TR("\nOptional, to indicate a web navigator program. If it is not defined the reference manual will be shown with an internal simple viewer"),
grid);
new QLabel(TR("Navigator"), grid);
htab = new Q3HBox(grid);
ed_navigator = new QLineEdit(htab);
if (!conv)
ed_navigator->setText(navigator_path());
new QLabel(" ", htab);
button = new QPushButton(TR("Browse"), htab);
connect(button, SIGNAL(clicked()), this, SLOT(navigator_browse()));
//
new QLabel(grid);
new QLabel(TR("\nOptional, to indicate a template project. This allows to create new projects getting all the template project settings"),
grid);
new QLabel("Template project", grid);
htab = new Q3HBox(grid);
if (conv)
s = getenv("BOUML_TEMPLATE"); // yes !
else
s = template_project();
ed_template = new QLineEdit(s, htab);
new QLabel(" ", htab);
button = new QPushButton(TR("Browse"), htab);
connect(button, SIGNAL(clicked()), this, SLOT(template_browse()));
//
new QLabel(grid);
//.........这里部分代码省略.........
示例15: QLabel
Dialog::Dialog() : QDialog(0, 0, TRUE)
{
Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
Q3VGroupBox * gbox;
Q3HButtonGroup * bg;
Q3HBox * htab;
vbox->setMargin(5);
gbox = new Q3VGroupBox("Filters" , this);
vbox->addWidget(gbox);
htab = new Q3HBox(gbox);
//htab->setMargin(5);
new QLabel("filter 1 : ", htab);
filter1_le = new LineEdit(htab);
new QLabel(" ", htab);
bg = new Q3HButtonGroup(htab);
bg->setRadioButtonExclusive(TRUE);
with1_rb = new QRadioButton("with", bg);
new QRadioButton("without", bg);
with1_rb->setChecked(TRUE);
//
htab = new Q3HBox(gbox);
//htab->setMargin(5);
new QLabel("", htab);
bg = new Q3HButtonGroup(htab);
bg->setRadioButtonExclusive(TRUE);
and12_rb = new QRadioButton("and", bg);
new QRadioButton("or", bg);
and12_rb->setChecked(TRUE);
new QLabel("", htab);
//
htab = new Q3HBox(gbox);
//htab->setMargin(5);
new QLabel("filter 2 : ", htab);
filter2_le = new LineEdit(htab);
new QLabel(" ", htab);
bg = new Q3HButtonGroup(htab);
bg->setRadioButtonExclusive(TRUE);
with2_rb = new QRadioButton("with", bg);
new QRadioButton("without", bg);
with2_rb->setChecked(TRUE);
//
htab = new Q3HBox(gbox);
//htab->setMargin(5);
new QLabel("", htab);
bg = new Q3HButtonGroup(htab);
bg->setRadioButtonExclusive(TRUE);
and23_rb = new QRadioButton("and", bg);
new QRadioButton("or", bg);
and23_rb->setChecked(TRUE);
new QLabel("", htab);
//
htab = new Q3HBox(gbox);
//htab->setMargin(5);
new QLabel("filter 3 : ", htab);
filter3_le = new LineEdit(htab);
new QLabel(" ", htab);
bg = new Q3HButtonGroup(htab);
bg->setRadioButtonExclusive(TRUE);
with3_rb = new QRadioButton("with", bg);
new QRadioButton("without", bg);
with3_rb->setChecked(TRUE);
//
//
gbox = new Q3VGroupBox("Stereotype" , this);
vbox->addWidget(gbox);
htab = new Q3HBox(gbox);
//htab->setMargin(5);
//.........这里部分代码省略.........