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


C++ Q3BoxLayout::setStretchFactor方法代码示例

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


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

示例1: QWidget

PolygonView::PolygonView(PinEditDoc * doc, QWidget * parent, const char * name, Qt::WFlags f) 
: QWidget(parent, name, f) {
  assert(doc != NULL);
  p_Doc = doc;
  p_Shape = NULL;
  p_Polygon = NULL;
  m_bSelectionChanged = true;
  p_Doc->registerUpdateable(this, "polygon");
  p_Doc->registerRebuildable(this, "polygon");
  // the polygon list view
  p_PolygonListView = new Q3ListView(this);
  connect(p_PolygonListView, SIGNAL(selectionChanged()), this, SLOT(slotChanged()));
  p_PolygonListView->setSelectionMode(Q3ListView::Extended);
  p_PolygonListView->addColumn(QString("polygons"));
  p_PolygonListView->setMinimumSize(200, 240);
  // the vertex list view
  p_VertexListView = new Q3ListView(this);
  connect(p_VertexListView, SIGNAL(selectionChanged()), this, SLOT(slotVertexChanged()));
  p_VertexListView->setSelectionMode(Q3ListView::Single);
  p_VertexListView->addColumn(QString("vertices for polygon"));
  p_VertexListView->setMinimumSize(200, 80);
  // tabs and widgets
  QTabWidget * tabWidget = new QTabWidget(this);
  //tabWidget->setFixedSize(200, 80);
  tabWidget->setMinimumSize(200, 80);
  // main layout
  Q3BoxLayout * vlayout = new Q3VBoxLayout(this);
  vlayout->addWidget(p_PolygonListView);
  vlayout->addWidget(p_VertexListView);
  vlayout->addWidget(tabWidget);
  vlayout->setStretchFactor(p_PolygonListView, 3);
  vlayout->setStretchFactor(p_PolygonListView, 2);
  vlayout->setStretchFactor(tabWidget, 0);
  // the vertex order widget
  {
    QWidget * widget = new QWidget(this);
    tabWidget->addTab(widget, "order");
		
    p_ButtonUp = new QPushButton("up", widget);
    connect(p_ButtonUp, SIGNAL(clicked()), this, SLOT(slotVertexUp()));
    p_ButtonDown = new QPushButton("down", widget);
    connect(p_ButtonDown, SIGNAL(clicked()), this, SLOT(slotVertexDown()));
		
    Q3BoxLayout * layout = new Q3HBoxLayout(widget);
    layout->addWidget(p_ButtonUp);
    layout->addWidget(p_ButtonDown);
  }
  // the position widget
  {
    QWidget * widget = new QWidget(this);
    tabWidget->addTab(widget, "position");
		
    p_EditX = new QLineEdit(widget);
    p_EditY = new QLineEdit(widget);
    p_EditZ = new QLineEdit(widget);
    connect(p_EditX, SIGNAL(returnPressed()), this, SLOT(slotApplyVertex()));
    connect(p_EditY, SIGNAL(returnPressed()), this, SLOT(slotApplyVertex()));
    connect(p_EditZ, SIGNAL(returnPressed()), this, SLOT(slotApplyVertex()));
		
    p_ApplyVertexButton = new QPushButton("apply", widget);
    connect(p_ApplyVertexButton, SIGNAL(clicked()), this, SLOT(slotApplyVertex()));

    Q3BoxLayout * vlayoutc = new Q3VBoxLayout(widget);
    Q3BoxLayout * hlayout = new Q3HBoxLayout(vlayoutc);
    hlayout->addWidget(p_EditX);
    hlayout->addWidget(p_EditY);
    hlayout->addWidget(p_EditZ);
    vlayoutc->addWidget(p_ApplyVertexButton);
  }
  // the color widget
  {
    QWidget * widget = new QWidget(this);
    tabWidget->addTab(widget, "color");

    p_EditR = new QLineEdit(widget);
    p_EditG = new QLineEdit(widget);
    p_EditB = new QLineEdit(widget);
    p_EditA = new QLineEdit(widget);
		
    connect(p_EditR, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
    connect(p_EditG, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
    connect(p_EditB, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
    connect(p_EditA, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));

    p_ApplyColorButton = new QPushButton("apply", widget);
    connect(p_ApplyColorButton, SIGNAL(clicked()), this, SLOT(slotApplyColor()));

    Q3BoxLayout * vlayoutc = new Q3VBoxLayout(widget);
    Q3BoxLayout * hlayoutb = new Q3HBoxLayout(vlayoutc);
    hlayoutb->addWidget(p_EditR);
    hlayoutb->addWidget(p_EditG);
    hlayoutb->addWidget(p_EditB);
    hlayoutb->addWidget(p_EditA);
    vlayoutc->addWidget(p_ApplyColorButton);
  }
  // properties widget
  {
    QWidget * widget = new QWidget(this);
    tabWidget->addTab(widget, "prop");

//.........这里部分代码省略.........
开发者ID:sergiomb2,项目名称:pinball-pinedit,代码行数:101,代码来源:polygonview.cpp


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