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


C++ Q3HBoxLayout::setSpacing方法代码示例

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


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

示例1: QWidget

TesterReport::TesterReport (QWidget *p) : QWidget (p)
{
  Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
  vbox->setMargin(5);
  vbox->setSpacing(5);

  tradeTable = new Q3Table(0, 9, this);
  tradeTable->setSelectionMode(Q3Table::Single);
  tradeTable->setSorting(FALSE);
  Q3Header *header = tradeTable->horizontalHeader();
  header->setLabel(0, tr("Type"), 40);
  header->setLabel(1, tr("Entry"), 80);
  header->setLabel(2, tr("Entry Price"), 70);
  header->setLabel(3, tr("Exit"), 80);
  header->setLabel(4, tr("Exit Price"), 70);
  header->setLabel(5, tr("Signal"), -1);
  header->setLabel(6, tr("Profit"), -1);
  header->setLabel(7, tr("Balance"), -1);
  header->setLabel(8, tr("Vol"), -1);
  vbox->addWidget(tradeTable);

  int loop;
  for (loop = 0; loop < 9; loop++)
    tradeTable->setColumnReadOnly(loop, TRUE);

  // test summary
  Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox);
  hbox->setSpacing(5);

  Q3VGroupBox *gbox = new Q3VGroupBox(tr("Test Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  QLabel *label = new QLabel(tr("Account Balance "), gbox);
  summaryBalance = new QLabel(" ", gbox);

  label = new QLabel(tr("Net Profit "), gbox);
  summaryNetProfit = new QLabel(" ", gbox);

  label = new QLabel(tr("Net Profit % "), gbox);
  summaryNetPercentage = new QLabel(" ", gbox);

  label = new QLabel(tr("Initial Investment "), gbox);
  summaryInvestment = new QLabel(" ", gbox);

  label = new QLabel(tr("Commissions "), gbox);
  summaryCommission = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest Drawdown "), gbox);
  summaryDrawdown = new QLabel(" ", gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryShortTrades = new QLabel(" ", gbox);

  // win summary
  gbox = new Q3VGroupBox(tr("Win Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryWinTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Profit "), gbox);
  summaryTotalWinTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Average "), gbox);
  summaryAverageWin = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest "), gbox);
  summaryLargestWin = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryWinLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryWinShortTrades = new QLabel(" ", gbox);

  // lose summary
  gbox = new Q3VGroupBox(tr("Lose Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryLoseTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Loss "), gbox);
  summaryTotalLoseTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Average "), gbox);
  summaryAverageLose = new QLabel(" ", gbox);

//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:TesterReport.cpp

示例2: bd

TesterTestPage::TesterTestPage (QWidget *p) : QWidget (p)
{
  fieldList.append(tr("Open"));
  fieldList.append(tr("Close"));
  fieldList.append(tr("Mid Point"));

  Q3HBoxLayout *hbox = new Q3HBoxLayout(this);
  hbox->setMargin(5);
  hbox->setSpacing(10);

  // left side grid

  Q3GridLayout *grid = new Q3GridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // trades area

  tradeLong = new QCheckBox(tr("Long"), this);
  grid->addWidget(tradeLong, 0, 0);

  tradeShort = new QCheckBox(tr("Short"), this);
  grid->addWidget(tradeShort, 1, 0);

  QLabel *label = new QLabel(tr("Trade Delay"), this);
  grid->addWidget(label, 2, 0);

  tradeDelay = new QSpinBox(1, 999999, 1, this);
  tradeDelay->setValue(1);
  grid->addWidget(tradeDelay, 2, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // account area

  label = new QLabel(tr("Account Balance"), this);
  grid->addWidget(label, 4, 0);

  account = new QSpinBox(0, 999999, 1, this);
  account->setValue(10000);
  grid->addWidget(account, 4, 1);

  label = new QLabel(tr("Futures Margin"), this);
  grid->addWidget(label, 5, 0);

  margin = new QSpinBox(0, 999999, 1, this);
  grid->addWidget(margin, 5, 1);

  label = new QLabel(tr("Volume %"), this);
  grid->addWidget(label, 6, 0);

  volumePercent = new QSpinBox(0, 100, 1, this);
  grid->addWidget(volumePercent, 6, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // commission area

  commissionType = new QCheckBox(tr("Use Commission %"), this);
  grid->addWidget(commissionType, 8, 0);

  label = new QLabel(tr("Entry"), this);
  grid->addWidget(label, 9, 0);

  QDoubleValidator *dv = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  entryCom = new QLineEdit(QString::number(10), this);
  entryCom->setValidator(dv);
  grid->addWidget(entryCom, 9, 1);

  label = new QLabel(tr("Exit"), this);
  grid->addWidget(label, 10, 0);

  QDoubleValidator *dv2 = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  exitCom = new QLineEdit(QString::number(10), this);
  exitCom->setValidator(dv2);
  grid->addWidget(exitCom, 10, 1);

  grid->setRowStretch(grid->numRows() + 1, 1);

  // vline sperarator

  Q3Frame *line = new Q3Frame(this);
  line->setFrameStyle(Q3Frame::VLine | Q3Frame::Plain);
  hbox->addWidget(line);

  // right side grid

  grid = new Q3GridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // test area

  label = new QLabel(tr("Symbol"), this);
  grid->addWidget(label, 0, 0);

  Config config;
  QString s, s2;
  config.getData(Config::DataPath, s);
  symbolButton = new SymbolButton(this, s, s2);
//.........这里部分代码省略.........
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:101,代码来源:TesterTestPage.cpp


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