• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ XTreeWidgetItem::setTextColor方法代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: sFillList

void dspSummarizedBOM::sFillList()
{
  _bomitem->clear();

  ParameterList params;
  if (!setParams(params))
    return;

  QString sql( "SELECT * FROM summarizedBOM(<? value(\"item_id\") ?>,"
			   "                     <? value(\"revision_id\") ?>,"
			   "                     <? value(\"expiredDays\") ?>,"
			   "                     <? value(\"futureDays\") ?>);" );

  MetaSQLQuery mql(sql);
  q = mql.toQuery(params);
  XTreeWidgetItem *last = 0;
  while (q.next())
  {
    last = new XTreeWidgetItem(_bomitem, last, -1, q.value("bomdata_item_number"),
			       q.value("bomdata_itemdescription"), q.value("bomdata_uom_name"),
			       q.value("bomdata_qtyper") );

    if (q.value("bomdata_expired").toBool())
      last->setTextColor("red");
    else if (q.value("bomdata_future").toBool())
      last->setTextColor("blue");
  }
  if (q.lastError().type() != QSqlError::None)
  {
    systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }
}
开发者ID:,项目名称:,代码行数:33,代码来源:


示例2: sHandleResort

void dspRunningAvailability::sHandleResort()
{
  for (int i = 0; i < _availability->topLevelItemCount(); i++)
  {
    XTreeWidgetItem *item = _availability->topLevelItem(i);
    if (item->data(RUNNINGAVAIL_COL, Qt::DisplayRole).toDouble() < 0)
      item->setTextColor(RUNNINGAVAIL_COL, namedColor("error"));
    else if (item->data(RUNNINGAVAIL_COL, Qt::DisplayRole).toDouble() < _reorderLevel->toDouble())
      item->setTextColor(RUNNINGAVAIL_COL, namedColor("warning"));
    else
      item->setTextColor(RUNNINGAVAIL_COL, namedColor(""));
  }
}
开发者ID:,项目名称:,代码行数:13,代码来源:


示例3: sHandleResort

void dspRunningAvailability::sHandleResort()
{
  for (int i = 0; i < list()->topLevelItemCount(); i++)
  {
    XTreeWidgetItem *item = list()->topLevelItem(i);
    if (item->data(list()->column("runningavail"), Qt::DisplayRole).toDouble() < 0)
      item->setTextColor(list()->column("runningavail"), namedColor("error"));
    else if (item->data(list()->column("runningavail"), Qt::DisplayRole).toDouble() < _reorderLevel->toDouble())
      item->setTextColor(list()->column("runningavail"), namedColor("warning"));
    else
      item->setTextColor(list()->column("runningavail"), namedColor(""));
  }
}
开发者ID:elipup,项目名称:desktop,代码行数:13,代码来源:dspRunningAvailability.cpp


示例4: sFillList

void dspCountSlipsByWarehouse::sFillList()
{
  if (DEBUG)
    qDebug("dspCountSlipsByWarehouse::sFillList() about to populate _cntslip");

  display::sFillList();

  if (_numericSlips->isChecked() && list()->topLevelItemCount() > 1)
  {
    if (DEBUG)
      qDebug("dspCountSlipsByWarehouse::sFillList() looking for slip # gaps "
             "in %d items", list()->topLevelItemCount());
    XTreeWidgetItem *last =list()->topLevelItem(0);
    int slipNumber = last->rawValue("slipnumber").toInt();
    for (int i = 1; i < list()->topLevelItemCount(); i++)
    {
      XTreeWidgetItem *curr = list()->topLevelItem(i);
      if (DEBUG)
        qDebug("row %d has slipNumber %d and current %d",
               i, slipNumber, curr->rawValue("slipnumber").toInt());
      if (slipNumber == (curr->rawValue("slipnumber").toInt() - 1) || slipNumber == -1)
        slipNumber = curr->rawValue("slipnumber").toInt();
      else if (slipNumber >= 0)
      {
        if (slipNumber == curr->rawValue("slipnumber").toInt() - 2)
          curr = new XTreeWidgetItem( list(), last, -1,
                                    QVariant("----"), "----", "----", "----",
                                    tr("Missing Slip #%1").arg(slipNumber + 1),
                                    "----", "----", "----" );
        else
          curr = new XTreeWidgetItem( list(), last, -1,
                                    QVariant("----"), "----", "----", "----",
                                    tr("Missing Slips #%1 to #%2").arg(slipNumber + 1).arg(curr->rawValue("slipnumber").toInt() - 1),
                                    "----", "----", "----" );

        curr->setTextColor(namedColor("error"));
        slipNumber = -1;
        //i++; // 'cause we just added an item!
      }
      last = curr;
    }
  }
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:43,代码来源:dspCountSlipsByWarehouse.cpp


示例5: sFillList

void fixSerial::sFillList()
{
  _serial->clear();

  QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) );

  QString sql = "SELECT nspname ||'.' ||relname AS tablename, nspname, relname, attname, "
		"	TRIM(quote_literal('\"''') FROM"
		"	  SUBSTRING(pg_catalog.pg_get_expr(d.adbin, d.adrelid)"
		"	  FROM '[' || quote_literal('\"''') || "
		"               '].*[' || quote_literal('\"''') || ' ]')) AS seq"
		"  FROM pg_catalog.pg_attribute a, pg_catalog.pg_class,"
		"       pg_catalog.pg_attrdef d, pg_catalog.pg_namespace   "
		"  WHERE a.attnum > 0"
                "    AND pg_namespace.oid = pg_class.relnamespace"
		"    AND NOT a.attisdropped"
		"    AND a.attnotnull"
		"    AND a.attrelid = pg_class.oid"
		"    AND d.adrelid = a.attrelid"
		"    AND d.adnum = a.attnum"
		"    AND pg_catalog.pg_get_expr(d.adbin, d.adrelid) ~* 'nextval'"
		"    AND a.atthasdef "
		"ORDER BY relname;" ;

  XSqlQuery relq;
  relq.prepare(sql);

  QString maxStr = "SELECT MAX(<? literal(\"attname\" ?>) AS maxval "
		   "FROM <? literal(\"tablename\") ?>;" ;
  XSqlQuery maxq;

  QString seqStr = "SELECT last_value AS currval FROM <? literal(\"seq\") ?>;" ;
  XSqlQuery seqq;

  XTreeWidgetItem *last = 0;
  int rows	= 0;
  int maxval	= 0;
  int currval	= 0;
  int errors	= 0;

  relq.exec();
  while (relq.next())
  {
    ParameterList params;
    params.append("attname",	relq.value("attname").toString());
    params.append("tablename",	relq.value("tablename").toString());
    params.append("seq",	relq.value("seq").toString());

    MetaSQLQuery maxMql = MetaSQLQuery(maxStr);
    maxq = maxMql.toQuery(params);
    if (maxq.first())
      maxval = maxq.value("maxval").toInt();
    else if (maxq.lastError().type() != QSqlError::NoError)
    {
      systemError(this, maxq.lastError().databaseText(), __FILE__, __LINE__);
      continue;
    }

    MetaSQLQuery seqMql = MetaSQLQuery(seqStr);
    seqq = seqMql.toQuery(params);
    if (seqq.first())
      currval = seqq.value("currval").toInt();
    else if (seqq.lastError().type() != QSqlError::NoError)
    {
      systemError(this, seqq.lastError().databaseText(), __FILE__, __LINE__);
      continue;
    }

    rows++;

    if (maxval > currval)
      errors++;

    if ((_showProblems->isChecked() && maxval > currval) ||
	! _showProblems->isChecked())
    {
      last = new XTreeWidgetItem(_serial, last, rows, maxval > currval ? 1 : 0,
				 relq.value("nspname"),
                                 relq.value("relname"),
				 relq.value("attname"),
				 relq.value("seq"),
				 maxval,
				 currval);

      if (maxval > currval)
	last->setTextColor("red");
    }
  }

  QApplication::restoreOverrideCursor();
  if (relq.lastError().type() != QSqlError::NoError)
  {
    systemError(this, relq.lastError().databaseText(), __FILE__, __LINE__);
    return;
  }

  if (errors > 0)
    _statusLit->setText(QObject::tr("Found %1 tables with mismatched serial values.")
			.arg(errors));
  else
//.........这里部分代码省略.........
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:101,代码来源:fixSerial.cpp


示例6: sModuleSelected

void user::sModuleSelected(const QString &pModule)
{
    XTreeWidgetItem *granted = NULL;
    XTreeWidgetItem *available = NULL;

    _availableGroup->clear();
    _grantedGroup->clear();
    XSqlQuery groups;
    groups.prepare("SELECT grp_id, grp_name, grp_descrip, usrgrp_id"
                   "  FROM grp LEFT OUTER JOIN usrgrp"
                   "    ON (usrgrp_grp_id=grp_id AND usrgrp_username=:username);");
    groups.bindValue(":username", _cUsername);
    groups.exec();
    while(groups.next())
    {
        if (groups.value("usrgrp_id").toInt() == 0)
            available = new XTreeWidgetItem(_availableGroup, available, groups.value("grp_id").toInt(), groups.value("grp_name"), groups.value("grp_descrip"));
        else
            granted = new XTreeWidgetItem(_grantedGroup, granted, groups.value("grp_id").toInt(), groups.value("grp_name"), groups.value("grp_descrip"));
    }
    if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Groups"),
                             groups, __FILE__, __LINE__))
        return;

    _available->clear();
    _granted->clear();

    XSqlQuery privs;
    privs.prepare( "SELECT priv_id, priv_name, priv_descrip "
                   "FROM priv "
                   "WHERE (priv_module=:priv_module) "
                   "ORDER BY priv_name;" );
    privs.bindValue(":priv_module", pModule);
    privs.exec();
    if (privs.first())
    {
        granted = NULL;
        available = NULL;

//  Insert each priv into either the available or granted list
        XSqlQuery usrpriv;
        usrpriv.prepare( "SELECT priv_id "
                         "FROM priv, usrpriv "
                         "WHERE ( (usrpriv_priv_id=priv_id)"
                         " AND (usrpriv_username=:username)"
                         " AND (priv_module=:priv_module) );" );
        usrpriv.bindValue(":username", _cUsername);
        usrpriv.bindValue(":priv_module", _module->currentText());
        usrpriv.exec();

        XSqlQuery grppriv;
        grppriv.prepare("SELECT priv_id"
                        "  FROM priv, grppriv, usrgrp"
                        " WHERE((usrgrp_grp_id=grppriv_grp_id)"
                        "   AND (grppriv_priv_id=priv_id)"
                        "   AND (usrgrp_username=:username)"
                        "   AND (priv_module=:priv_module));");
        grppriv.bindValue(":username", _cUsername);
        grppriv.bindValue(":priv_module", _module->currentText());
        grppriv.exec();

        do
        {
            if (usrpriv.findFirst("priv_id", privs.value("priv_id").toInt()) == -1 && grppriv.findFirst("priv_id", privs.value("priv_id").toInt()) == -1)
                available = new XTreeWidgetItem(_available, available, privs.value("priv_id").toInt(), privs.value("priv_name"), privs.value("priv_descrip"));
            else
            {
                granted = new XTreeWidgetItem(_granted, granted, privs.value("priv_id").toInt(), privs.value("priv_name"), privs.value("priv_descrip"));
                if(usrpriv.findFirst("priv_id", privs.value("priv_id").toInt()) == -1)
                    granted->setTextColor(Qt::gray);
            }
        }
        while (privs.next());
    }
}
开发者ID:chengzhou,项目名称:qt-client,代码行数:75,代码来源:user.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ XTreeWidgetItem::text方法代码示例发布时间:2022-05-31
下一篇:
C++ XTreeWidgetItem::setText方法代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap