当前位置: 首页>>代码示例>>C++>>正文


C++ QSizePolicy::setHorData方法代码示例

本文整理汇总了C++中QSizePolicy::setHorData方法的典型用法代码示例。如果您正苦于以下问题:C++ QSizePolicy::setHorData方法的具体用法?C++ QSizePolicy::setHorData怎么用?C++ QSizePolicy::setHorData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSizePolicy的用法示例。


在下文中一共展示了QSizePolicy::setHorData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _createItem

void KeyOptionView::_createItem() {
	myWidget = new QWidget(myTab);
	QGridLayout *layout = new QGridLayout(myWidget, 2, 2, 0, 10);
	myKeyButton = new KeyButton(*this);
	layout->addMultiCellWidget(myKeyButton, 0, 0, 0, 1);
	myLabel = new QLabel(myWidget);
	myLabel->setTextFormat(QObject::PlainText);
	QFont f = qApp->font();
	f.setPointSize(14);
	myLabel->setFont(f);
#if 0
    QSizePolicy pol = myLabel->sizePolicy();
    pol.setHorData(QSizePolicy::Fixed);
    myLabel->setSizePolicy(pol);
    myLabel->setLineWidth(40);
#endif
	layout->addWidget(myLabel, 1, 0);
	myComboBox = new ZComboBox(myWidget, "ZComboBox", true);
#if 0
    pol = myComboBox->sizePolicy();
    pol.setHorData(QSizePolicy::Fixed);
    myComboBox->setSizePolicy(pol);
#endif
	const std::vector<std::string> &actions = ((ZLKeyOptionEntry*)myOption)->actionNames();
	int index = 0;
	for (std::vector<std::string>::const_iterator it = actions.begin(); it != actions.end(); ++it, ++index) {
	    myComboBox->insertItem(it->c_str(), index);
	}
	connect(myComboBox, SIGNAL(activated(int)), this, SLOT(onValueChange(int)));
	layout->addWidget(myComboBox, 1, 1);
	myTab->addItem(myWidget, myRow, myFromColumn, myToColumn, AlignLeft);
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:32,代码来源:QOptionView.cpp

示例2: keyPressEvent

void KeyButton::keyPressEvent(QKeyEvent *keyEvent) {
	std::string keyText = QKeyUtil::keyName(keyEvent);
	if (keyEvent->key() == Key_Return) {
	    grabKeyboard();
	    return;
	}
	if (keyEvent->key() == Key_Up ||
	    keyEvent->key() == Key_Down) {
	    clearFocus();
	    releaseKeyboard();
	    return;
	}

	if (!keyText.empty()) {
		myKeyView.myCurrentKey = keyText;
		myKeyView.myLabel->setText("Action For " + QString::fromUtf8(keyText.c_str()));
		myKeyView.myLabel->show();
#if 0
    QSizePolicy pol = myKeyView.myLabel->sizePolicy();
    pol.setHorData(QSizePolicy::Fixed);
    myKeyView.myLabel->setSizePolicy(pol);
    myKeyView.myLabel->setLineWidth(80);
    pol = myKeyView.myComboBox->sizePolicy();
    pol.setHorData(QSizePolicy::Fixed);
    myKeyView.myComboBox->setSizePolicy(pol);
#endif
		myKeyView.myComboBox->setCurrentItem(((ZLKeyOptionEntry*)myKeyView.myOption)->actionIndex(keyText));
		myKeyView.myComboBox->show();
	}
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:30,代码来源:QOptionView.cpp

示例3: sizePolicy

/*!
  \return MinimumExpanding/Fixed for a horizontal orientation;
          Fixed/MinimumExpanding for a vertical orientation.
*/
QSizePolicy QwtSlider::sizePolicy() const
{
    QSizePolicy sp;
    if ( orientation() == Qt::Horizontal )
    {
        sp.setHorData( QSizePolicy::MinimumExpanding );
        sp.setVerData( QSizePolicy::Fixed );
    }
    else
    {
        sp.setHorData( QSizePolicy::Fixed );
        sp.setVerData( QSizePolicy::MinimumExpanding );
    }
    return sp;
}
开发者ID:jiajw0426,项目名称:easyscada,代码行数:19,代码来源:qwt_slider.cpp

示例4: ZScrollView

ZLDialogContent &QOptionsDialog::createTab(const std::string &name) {
//    QScrollView *sv = new QScrollView(myTabWidget, "QScrollView", 0);
    ZScrollView *sv = new ZScrollView(myTabWidget, NULL, 0/*, (ZSkinService::WidgetClsID)4*/);
	sv->setResizePolicy(QScrollView::AutoOneFit );
	sv->setFrameStyle( QFrame::NoFrame );
#if 0
	QSizePolicy pol = sv->sizePolicy();
	pol.setHorData(QSizePolicy::Fixed);
	sv->setSizePolicy(pol);
	QRect rect = sv->contentsRect();
	rect.setWidth(240);
	sv->setFrameRect(rect);
	sv->setLineWidth(240);
#endif
	sv->setVScrollBarMode(QScrollView::AlwaysOff);
	sv->setHScrollBarMode(QScrollView::AlwaysOff);

	QOptionsDialogTab *tab = new QOptionsDialogTab(sv->viewport());
	sv->addChild(tab, 0, 0);
	myTabWidget->insertTab(sv, name.c_str());
	menu->insertItem(QString(name.c_str()), NULL, NULL, true, tabno, tabno);
	myTabs.append(tab);
	myTabNames.push_back(name);
	tabno++;
	return *tab;
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:26,代码来源:QOptionsDialog.cpp

示例5: sizePolicy

//! \return MinimumExpanding/MinimumExpanding
QSizePolicy QwtPlot::sizePolicy() const
{
    QSizePolicy sp;
    sp.setHorData( QSizePolicy::MinimumExpanding );
    sp.setVerData( QSizePolicy::MinimumExpanding );
    return sp;
}
开发者ID:ahinoamp,项目名称:Research,代码行数:8,代码来源:qwt_plot.cpp

示例6: 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");
}
开发者ID:harmegnies,项目名称:douml,代码行数:53,代码来源:ParameterSetDialog.cpp

示例7: init_l_tab

void ComponentDialog::init_l_tab(Q3VBox *& page, Q3ComboBox *& stereotypefilter,
                                 void (ComponentDialog::* filteractivated)(const QString & st),
                                 const char * slt,
                                 const char * add_slt, const char * remove_slt,
                                 Q3ListBox *& lb_available, Q3ListBox *& lb,
                                 const Q3ValueList<BrowserClass *> & cls,
                                 const char * lbl)
{
    bool visit = !hasOkButton();
    Q3HBox * hbox;
    Q3VBox * vbox;
    QPushButton * button;

    page = new Q3VBox(this);

    if (!visit) {
        hbox = new Q3HBox(page);
        hbox->setMargin(5);
        new QLabel(TR("Stereotype filtering  "), hbox);
        stereotypefilter = new Q3ComboBox(TRUE, hbox);
        stereotypefilter->setAutoCompletion(completion());
        stereotypefilter->insertItem("");
        stereotypefilter->insertStringList(BrowserClass::default_stereotypes());
        stereotypefilter->insertStringList(ProfiledStereotypes::defaults(UmlComponent));
        stereotypefilter->setCurrentItem(0);
        QSizePolicy sp = stereotypefilter->sizePolicy();
        sp.setHorData(QSizePolicy::Expanding);
        stereotypefilter->setSizePolicy(sp);
        connect(stereotypefilter, SIGNAL(activated(const QString &)),
                this, slt);

        hbox = new Q3HBox(page);
        vbox = new Q3VBox(hbox);
        vbox->setMargin(5);
        (new QLabel(TR("Available classes"), vbox))->setAlignment(Qt::AlignCenter);
        lb_available = new Q3ListBox(vbox);
        lb_available->setSelectionMode(Q3ListBox::Multi);

        vbox = new Q3VBox(hbox);
        vbox->setMargin(5);
        (new QLabel("", vbox))->setScaledContents(TRUE);
        button = new QPushButton(vbox);
        button->setPixmap(*rightPixmap);
        connect(button, SIGNAL(clicked()), this, add_slt);
        (new QLabel("", vbox))->setScaledContents(TRUE);
        button = new QPushButton(vbox);
        button->setPixmap(*leftPixmap);
        connect(button, SIGNAL(clicked()), this, remove_slt);
        (new QLabel("", vbox))->setScaledContents(TRUE);
        vbox = new Q3VBox(hbox);
    }
开发者ID:jeremysalwen,项目名称:douml,代码行数:51,代码来源:ComponentDialog.cpp

示例8: initPlot

/*!
  \brief Initializes a QwtPlot instance
  \param title Title text
 */
void QwtPlot::initPlot(const QString &title)
{
    d_layout = new QwtPlotLayout;

    d_curves = new QwtCurveDict;
    d_markers = new QwtMarkerDict;

    d_autoReplot = FALSE;

    d_lblTitle = new QLabel(title, this);
    d_lblTitle->setFont(QFont(fontInfo().family(), 14, QFont::Bold));
    d_lblTitle->setAlignment(Qt::AlignCenter|Qt::WordBreak|Qt::ExpandTabs);

    d_legend = new QwtLegend(this);
    d_autoLegend = FALSE;

    d_scale[yLeft] = new QwtScale(QwtScale::Left, this, "yLeft");
    d_scale[yRight] = new QwtScale(QwtScale::Right, this, "yRight");
    d_scale[xTop] = new QwtScale(QwtScale::Top, this, "xTop");
    d_scale[xBottom] = new QwtScale(QwtScale::Bottom, this, "xBottom");

    initAxes();

    d_grid = new QwtPlotGrid(this);
    d_grid->setPen(QPen(Qt::black, 0, Qt::DotLine));
    d_grid->enableXMin(FALSE);
    d_grid->enableYMin(FALSE);
    d_grid->setAxis(xBottom, yLeft);

    d_canvas = new QwtPlotCanvas(this);
    d_canvas->setFrameStyle(QFrame::Panel|QFrame::Sunken);
    d_canvas->setLineWidth(2);
    d_canvas->setMidLineWidth(0);

#ifndef QWT_NO_COMPAT
    connect(d_canvas, SIGNAL(mousePressed(const QMouseEvent &)),
        this, SIGNAL(plotMousePressed(const QMouseEvent &)));
    connect(d_canvas, SIGNAL(mouseMoved(const QMouseEvent &)),
        this, SIGNAL(plotMouseMoved(const QMouseEvent &)));
    connect(d_canvas, SIGNAL(mouseReleased(const QMouseEvent &)),
        this, SIGNAL(plotMouseReleased(const QMouseEvent &)));
#endif

    updateTabOrder();

    QSizePolicy sp;
    sp.setHorData( QSizePolicy::MinimumExpanding );
    sp.setVerData( QSizePolicy::MinimumExpanding );
    setSizePolicy(sp);
}
开发者ID:jiajw0426,项目名称:easyscada,代码行数:54,代码来源:qwt_plot.cpp

示例9: QWidget

QOptionsDialogTab::QOptionsDialogTab(QWidget *parent) : QWidget(parent) {
	int space = 10;
	switch (ZLDeviceInfo::screenSize()) {
		case ZLDeviceInfo::SIZE_640x480:
			space = 10;
			break;
		default:
			space = 3;
			break;
	}
	myLayout = new QGridLayout(this, -1, 12, space, space);
	myRowCounter = 0;

#if 0
	QSizePolicy pol = this->sizePolicy();
	pol.setHorData(QSizePolicy::Fixed);
	this->setSizePolicy(pol);
	QRect rect = QRect(0, 0, 240, 320);
	myLayout->setGeometry(rect);
	myLayout->setColStretch(12, 12);
#endif
}
开发者ID:xufooo,项目名称:fbreader-e2-test,代码行数:22,代码来源:QOptionsDialog.cpp

示例10: d

Dialog::Dialog(UmlArtifact * art, const QCString & path_exe, QCString & pro, QCString & target, QCString & tmplt, QCString & config, QCString & defines, QCString & includepath, QCString & dependpath, QCString & objectsdir, QCString & footer)
  : QDialog(0, 0, TRUE), _art(art), _pro(pro), _target(target), _tmplt(tmplt),
    _config(config), _defines(defines), _includepath(includepath), _dependpath(dependpath),
    _objectsdir(objectsdir), _footer(footer) {
  QDir d(path_exe);
  QVBoxLayout * vbox = new QVBoxLayout(this);
  QGrid * grid = new QGrid(2, this);
  QHBox * htab;
  int index;
  
  vbox->addWidget(grid);
  vbox->setMargin(5);
  
  new QLabel(".pro file : ", grid);
  htab = new QHBox(grid);
  edpro = new QLineEdit(htab);
  edpro->setText(d.absFilePath(pro));

  new QLabel(" ", htab);
  browsepro = new SmallPushButton("browse", htab);
  connect(browsepro, SIGNAL(clicked ()), this, SLOT(browse_pro()));
  
  new QLabel("target : ", grid);
  htab = new QHBox(grid);
  edtarget = new QLineEdit(htab);
  edtarget->setText(d.absFilePath(target));
  new QLabel(" ", htab);
  browsetarget = new SmallPushButton("browse", htab);
  connect(browsetarget, SIGNAL(clicked ()), this, SLOT(browse_target()));

  new QLabel("template : ", grid);
  cbtemplate = new QComboBox(TRUE, grid);
  
  static const char * templates[] = { "app", "lib", "subdirs" };
  bool find = FALSE;

  for (index = 0; index != sizeof(templates)/sizeof(*templates); index += 1) {
    cbtemplate->insertItem(templates[index]);
    if (tmplt == templates[index]) {
      cbtemplate->setCurrentItem(index);
      find = TRUE;
    }
  }
  if (! find) {
    cbtemplate->insertItem((QString) tmplt);
    cbtemplate->setCurrentItem(index);
  }

  new QLabel("config : ", grid);
  htab = new QHBox(grid);
  cbconf[0] = new QComboBox(FALSE, htab);
  cbconf[0]->insertItem("debug");
  cbconf[0]->insertItem("release");
  
  QStringList lcnf =
    QStringList::split(" ", (const char *) config);
  QStringList::Iterator it = lcnf.begin();
  
  cbconf[0]->setCurrentItem((*it++ == "debug") ? 0 : 1);

  cbconf[1] = new QComboBox(FALSE, htab);
  cbconf[1]->insertItem("warn_on");
  cbconf[1]->insertItem("warn_off");
  cbconf[1]->setCurrentItem((*it++ == "warn_on") ? 0 : 1);
  
  QSizePolicy sp = cbconf[0]->sizePolicy();
    
  sp.setHorData(QSizePolicy::Fixed);
  cbconf[0]->setSizePolicy(sp);
  cbconf[1]->setSizePolicy(sp);
  
  new QLabel(" qt ", htab);
  it++;	// qt
  
  const char * configs[] = {
    "", "opengl", "thread", "x11", "windows",
    "console", "dll", "staticlib", 0
  };

  for (index = 2;
       index != sizeof(cbconf)/sizeof(*cbconf) - 1;
       index += 1) {
    cbconf[index] = new QComboBox(TRUE, htab);
    if (it != lcnf.end())
      cbconf[index]->insertItem(*it++);
    cbconf[index]->insertStrList(configs);
    cbconf[index]->setCurrentItem(0);
  }
  cbconf[index] = new QComboBox(TRUE, htab);
  if (it != lcnf.end()) {
    QString s = *it++;
    
    while (it != lcnf.end())
      s += " " + *it++;
    cbconf[index]->insertItem(s);
  }
  cbconf[index]->insertStrList(configs);
  cbconf[index]->setCurrentItem(0);


//.........这里部分代码省略.........
开发者ID:gregsmirnov,项目名称:bouml,代码行数:101,代码来源:Dialog.cpp

示例11: bs

FragmentDialog::FragmentDialog(const QStringList & defaults, QString & s,
                               QString & fo, BrowserNode *& d)
    : QDialog(0, "Fragment dialog", TRUE), name(s), form(fo), refer(d)
{
    setCaption(TR("Fragment dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBoxLayout * hbox;
    QLabel * lbl1;
    QLabel * lbl2;
    SmallPushButton * refer_bt;
    BrowserNode * bn;

    vbox->setMargin(5);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    hbox->addWidget(lbl1 = new QLabel(TR("name : "), this));
    name_cb = new Q3ComboBox(TRUE, this);
    name_cb->insertItem(name);
    name_cb->setCurrentItem(0);
    name_cb->insertStringList(defaults);
    name_cb->setAutoCompletion(completion());
    hbox->addWidget(name_cb);

    QSizePolicy sp = name_cb->sizePolicy();

    sp.setHorData(QSizePolicy::Expanding);
    name_cb->setSizePolicy(sp);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    hbox->addWidget(refer_bt = new SmallPushButton(TR("refer to : "), this));
    connect(refer_bt, SIGNAL(clicked()), this, SLOT(menu_refer()));
    diag_cb = new Q3ComboBox(FALSE, this);
    BrowserDiagram::instances(nodes, TRUE);
    diag_cb->insertItem("");

    for (bn = nodes.first(); bn != 0; bn = nodes.next())
        diag_cb->insertItem(*(bn->pixmap(0)), bn->full_name(TRUE));

    diag_cb->setCurrentItem((refer == 0)
                            ? 0
                            : nodes.findRef(refer) + 1);
    diag_cb->setSizePolicy(sp);
    hbox->addWidget(diag_cb);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    hbox->addWidget(lbl2 = new QLabel(TR("arguments \n/ value : "), this));
    hbox->addWidget(ed_form = new LineEdit(this));
    ed_form->setText(form);

    same_width(lbl1, lbl2, refer_bt);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    QPushButton * accept = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
    QSize bs(cancel->sizeHint());

    accept->setDefault(TRUE);
    accept->setFixedSize(bs);
    cancel->setFixedSize(bs);

    hbox->addWidget(accept);
    hbox->addWidget(cancel);

    connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
开发者ID:harmegnies,项目名称:douml,代码行数:71,代码来源:FragmentDialog.cpp

示例12: QLabel

BasicDialog::BasicDialog(BasicData * nd, QString s,
			 const QStringList & default_stereotypes,
			 QSize & sz, bool unnamed)
    : Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(nd), previous_size(sz) {
  nd->get_browser_node()->edit_start();
  
  if (nd->get_browser_node()->is_writable()) {
    setOkButton(TR("OK"));
    setCancelButton(TR("Cancel"));
  }
  else {
    setOkButton(QString::null);
    setCancelButton(TR("Close"));
  }

  setCaption(TR(s + " dialog"));
  
  bool visit = !hasOkButton();
  
  // general tab
  
  BrowserNode * bn = data->get_browser_node();
  Q3Grid * grid = new Q3Grid(2, this);
  grid->setMargin(5);
  grid->setSpacing(5);

  if (unnamed)
    edname = 0;
  else {
    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(default_stereotypes);
    edstereotype->insertStringList(ProfiledStereotypes::defaults(bn->get_type()));
    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);
}
开发者ID:SciBoy,项目名称:douml,代码行数:73,代码来源:BasicDialog.cpp

示例13: QLabel


//.........这里部分代码省略.........
  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());
    }
    edstereotype->setCurrentItem(0);
    
    QSizePolicy sp = edstereotype->sizePolicy();
    
    sp.setHorData(QSizePolicy::Expanding);
    edstereotype->setSizePolicy(sp);
    
    new QLabel(TR("    multiplicity :  "), htab);
    multiplicity = new Q3ComboBox(!visit, htab);
    multiplicity->setSizePolicy(sp);
    previous_multiplicity = a->get_multiplicity();
    multiplicity->insertItem(previous_multiplicity);
    if (!visit) {
      multiplicity->insertItem("1");
      multiplicity->insertItem("0..1");
      multiplicity->insertItem("*");
      multiplicity->insertItem("1..*");
    }
    
    connect(new SmallPushButton(TR("type :"), grid), SIGNAL(clicked()),
	    this, SLOT(menu_type()));    
    edtype = new Q3ComboBox(!visit, grid);
    edtype->insertItem(a->get_type().get_full_type());
    BrowserClass::instances(nodes);
    nodes.full_names(list);        
    if (!visit) {
      QStringList l = GenerationSettings::basic_types();
      
      cld->addFormals(l);
      edtype->insertStringList(l);
      offset = edtype->count();
      edtype->insertStringList(list);
      edtype->setAutoCompletion(completion());
      view = a->browser_node->container(UmlClass);
    }
    edtype->setCurrentItem(0);
    edtype->setSizePolicy(sp);
开发者ID:kralf,项目名称:bouml,代码行数:67,代码来源:AttributeDialog.cpp

示例14: QLabel

PseudoStateDialog::PseudoStateDialog(PseudoStateData * ps)
    : Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), pst(ps)
{
    BrowserPseudoState * bn = (BrowserPseudoState *) pst->browser_node;
    BrowserState * refst;

    switch (bn->get_type()) {
    case EntryPointPS:
    case ExitPointPS:
        if (((BrowserNode *) bn->parent())->get_type() == UmlState) {
            refst = ((StateData *)((BrowserNode *) bn->parent())->get_data())->get_reference();
            break;
        }

        // no break
    default:
        refst = 0;
    }

    bn->edit_start();

    if (bn->is_writable()) {
        setOkButton(TR("OK"));
        setCancelButton(TR("Cancel"));
    }
    else {
        setOkButton(QString());
        setCancelButton(TR("Close"));
    }

    QString s = stringify(bn->get_type());
    int index = s.find("_");

    if (index != -1)
        s.replace(index, 1, " ");

    setCaption(TR(s + " dialog"));

    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(pst->get_stereotype()));

    if (! visit) {
        edstereotype->insertStringList(BrowserPseudoState::default_stereotypes());
        edstereotype->insertStringList(ProfiledStereotypes::defaults(bn->get_type()));
        edstereotype->setAutoCompletion(completion());
    }

    edstereotype->setCurrentItem(0);
    QSizePolicy sp = edstereotype->sizePolicy();
    sp.setHorData(QSizePolicy::Expanding);
    edstereotype->setSizePolicy(sp);

    if (refst != 0) {
        connect(new SmallPushButton(TR("reference :"), grid), SIGNAL(clicked()),
                this, SLOT(menu_reference()));
        edreference = new Q3ComboBox(FALSE, grid);
        edreference->setSizePolicy(sp);

        BrowserNode * ref = ((pst->get_reference() == 0) ||
                             !bn->can_reference(pst->get_reference()))
                            ? 0 : pst->get_reference();

        if (visit) {
            if (ref == 0)
                edreference->insertItem("");
            else
                edreference->insertItem(ref->full_name(TRUE));
        }
        else {
            edreference->insertItem("");
            edreference->setAutoCompletion(completion());

            Q3ListViewItem * child;
            UmlCode k = bn->get_type();

            for (child = refst->firstChild();
                 child != 0;
                 child = child->nextSibling()) {
                if (!((BrowserNode *) child)->deletedp()) {
                    UmlCode kk = ((BrowserNode *) child)->get_type();

                    if (kk == k)
                        pseudostates.append((BrowserNode *) child);
                    else if (kk == UmlRegion) {
                        for (Q3ListViewItem * schild = child->firstChild();
                             schild != 0;
                             schild = schild->nextSibling()) {
//.........这里部分代码省略.........
开发者ID:jeremysalwen,项目名称:douml,代码行数:101,代码来源:PseudoStateDialog.cpp

示例15: QLabel

PinDialog::PinDialog(PinData * pi)
    : Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), pin(pi) {
  pi->browser_node->edit_start();
  
  if (pi->browser_node->is_writable()) {
    setOkButton(TR("OK"));
    setCancelButton(TR("Cancel"));
  }
  else {
    setOkButton(QString::null);
    setCancelButton(TR("Close"));
  }

  visit = !hasOkButton();
  setCaption(TR("Pin 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("name :"), grid);
  edname = new LineEdit(pi->name(), grid);
  edname->setReadOnly(visit);

  QFont font = edname->font();
  if (! hasCodec())
    font.setFamily("Courier");
  font.setFixedPitch(TRUE);
  
  new QLabel(TR("stereotype : "), grid);
  edstereotype = new Q3ComboBox(!visit, grid);
  edstereotype->insertItem(toUnicode(pi->stereotype));
  if (! visit) {
    edstereotype->insertStringList(BrowserPin::default_stereotypes());
    edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlActivityPin));
    edstereotype->setAutoCompletion(completion());
  }
  edstereotype->setCurrentItem(0);
  
  QSizePolicy sp = edstereotype->sizePolicy();
  
  sp.setHorData(QSizePolicy::Expanding);
  edstereotype->setSizePolicy(sp);
    
  connect(new SmallPushButton(TR("type :"), grid), SIGNAL(clicked()),
	  this, SLOT(menu_type()));
  
  edtype = new Q3ComboBox(!visit, grid);
  edtype->insertItem(pi->get_type().get_full_type());
  if (!visit) {
    BrowserClass::instances(nodes);
    nodes.full_names(list);
    
    edtype->insertStringList(GenerationSettings::basic_types());
    offset = edtype->count();
    edtype->insertStringList(list);
    edtype->setAutoCompletion(completion());
    view = pi->browser_node->container(UmlClass);
  }
  edtype->setCurrentItem(0);
  edtype->setSizePolicy(sp);
  
  new QLabel(TR("direction :"), grid);
  htab = new Q3HBox(grid);
  eddir = new Q3ComboBox(FALSE, htab);
  
  UmlParamDirection dir = pi->get_dir();
  
  eddir->insertItem(stringify(dir));
  if (! visit) {
    // note : inout not allowed
    if (dir != UmlIn)
      eddir->insertItem(stringify(UmlIn));
    if (dir != UmlOut)
      eddir->insertItem(stringify(UmlOut));
    if (dir != UmlReturn)
      eddir->insertItem(stringify(UmlReturn));
  }
  
  new QLabel(TR("   multiplicity : "), htab);
  edmultiplicity = new Q3ComboBox(!visit, htab);
  edmultiplicity->setSizePolicy(sp);
  edmultiplicity->insertItem(pi->get_multiplicity());
  if (!visit) {
    edmultiplicity->insertItem("1");
    edmultiplicity->insertItem("0..1");
    edmultiplicity->insertItem("*");
    edmultiplicity->insertItem("1..*");
  }
  
  new QLabel(TR("   ordering : "), htab);
  edordering = new Q3ComboBox(FALSE, htab);
  
//.........这里部分代码省略.........
开发者ID:SciBoy,项目名称:douml,代码行数:101,代码来源:PinDialog.cpp


注:本文中的QSizePolicy::setHorData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。