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


C++ Q3Header::setLabel方法代码示例

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


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

示例1: setHeader

void PreviewTable::setHeader()
{
	Q3Header *head = horizontalHeader();
	for (int i=0; i<numCols(); i++){
		QString s = col_label[i];
		int lines = columnWidth(i)/head->fontMetrics().averageCharWidth();
	#ifdef Q_OS_MAC
		head->setLabel(i, s.remove("\n"));
	#else
		head->setLabel(i, s.remove("\n") + "\n" + QString(lines, '_') + "\n" + comments[i]);
	#endif
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:13,代码来源:ImportASCIIDialog.cpp

示例2: setHeader

void PreviewTable::setHeader()
{
	Q3Header *head = horizontalHeader();
	for (int i=0; i<numCols(); i++){
		QString s = col_label[i];
        int lines = columnWidth(i)/head->fontMetrics().boundingRect("_").width();
        head->setLabel(i, s.remove("\n") + "\n" + QString(lines, '_') + "\n" + comments[i]);
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:9,代码来源:ImportASCIIDialog.cpp

示例3: QDialog

/*
 *  Constructs a ProcessVarGui which is a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
ProcessVarGui::ProcessVarGui(QWidget* parent)
    : QDialog(parent),
      _ui(new Ui::ProcessVarGui) {
    _ui->setupUi(this);
    Q3Header *header;

    header = _ui->rxTable->horizontalHeader( );
    for( int i=0; i<2; i++ ) {
        header->setLabel( 0, "State" );
        header->setLabel( 1, "Count" );
        header->setLabel( 2, "D0" );
        header->setLabel( 3, "D1" );
        header->setLabel( 4, "D2" );
        header->setLabel( 5, "D3" );
        header->setLabel( 6, "D4" );
        header->setLabel( 7, "D5" );
        header->setLabel( 8, "D6" );
        header->setLabel( 9, "D7" );

        header = _ui->txTable->horizontalHeader( );
    }

    header = _ui->rxTable->verticalHeader( );
    for( int i=0; i<2; i++ ) {
        header->setLabel( 0, "PDO1" );
        header->setLabel( 1, "PDO2" );
        header->setLabel( 2, "PDO3" );
        header->setLabel( 3, "PDO4" );

        header = _ui->txTable->verticalHeader( );
    }

    for( int i=0; i<_ui->rxTable->numCols( ); i++ ) {
        _ui->rxTable->adjustColumn( i );
    }
    for( int i=0; i<_ui->txTable->numCols( ); i++ ) {
        _ui->txTable->adjustColumn( i );
    }

    // signals and slots connections
    connect( _ui->canopenPVarViewIdentifier, SIGNAL( valueChanged(int) ), this, SLOT( canopenIdChanged( ) ) );
    connect( _ui->PushButton1, SIGNAL( clicked() ), this, SLOT( canopenIdChanged( ) ) );

    // fill in data of canopen-Device 0
    fillInData( 0 );
}
开发者ID:sbobade,项目名称:canfestivalgui,代码行数:53,代码来源:processvargui.cpp

示例4: Init

int CarListVisual::Init(const std::map<QString, QString> & mapParams)
{
	if (TableVisualizer::Init(mapParams))
		return 1;

	QDraggingTable * pTable = ((QTableVisualizer *)m_pWidget)->m_pTable;

	pTable->setNumCols(7);

	Q3Header * pHHeader = pTable->horizontalHeader();
	pHHeader->setMovingEnabled(false);
	pHHeader->setLabel(0, "");
	pTable->setColumnWidth(0, 32);
	pHHeader->setLabel(1, "Vehicle");
	pTable->setColumnWidth(1, 120);
	pHHeader->setLabel(2, "Type");
	pTable->setColumnWidth(2, 150);
	pHHeader->setLabel(3, "Longitude");
	pTable->setColumnWidth(3, 120);
	pHHeader->setLabel(4, "Latitude");
	pTable->setColumnWidth(4, 120);
	pHHeader->setLabel(5, "Speed");
	pTable->setColumnWidth(5, 70);
	pHHeader->setLabel(6, "Heading");
	pTable->setColumnWidth(6, 90);
	pTable->verticalHeader()->hide();
	pTable->setColumnMovingEnabled(false);
	pTable->setFocusStyle(Q3Table::FollowStyle);
	pTable->setLeftMargin(0);
	pTable->setReadOnly(true);
	pTable->setRowMovingEnabled(false);
	pTable->setSelectionMode(Q3Table::SingleRow);
	pTable->setShowGrid(true);
	pTable->setSorting(false);
	pTable->SetDragObjectCreator(CarListVisualDragObjectCreator, this);
	pTable->setDragEnabled(true);
	m_pRightClickMenu = new Q3PopupMenu(pTable);
	m_pRightClickMenu->insertItem("Send Message...", 0);

	UpdateTable();

	return 0;
}
开发者ID:vigneshananth,项目名称:Groovenet-Qt4,代码行数:43,代码来源:CarListVisual.cpp

示例5: 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


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