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


C++ category函数代码示例

本文整理汇总了C++中category函数的典型用法代码示例。如果您正苦于以下问题:C++ category函数的具体用法?C++ category怎么用?C++ category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: categoryCount

/*!
    \internal
*/
int QDesignerWidgetBoxInterface::findOrInsertCategory(const QString &categoryName)
{
    int count = categoryCount();
    for (int index=0; index<count; ++index) {
        Category c = category(index);
        if (c.name() == categoryName)
            return index;
    }

    addCategory(Category(categoryName));
    return count;
}
开发者ID:Smarre,项目名称:qtjambi,代码行数:15,代码来源:abstractwidgetbox.cpp

示例2: category

//
//    Save
//    ====
//
//    Save the information for this object to the AuditDataFile
//
bool CLocaleScanner::SaveData	(CAuditDataFile* pAuditDataFile)
{
	CLogFile log;
	log.Write("CLocaleScanner::SaveData Start" ,true);

	CString strValue;

	// Add the Category for memory
	CAuditDataFileCategory category(HARDWARE_CLASS);

	// Each audited item gets added an a CAuditDataFileItem to the category
	CAuditDataFileItem l1(V_LOCALE_CODEPAGE ,m_iCodePage);
	CAuditDataFileItem l2(V_LOCALE_CALENDARTYPE ,m_strCalendarType);
	CAuditDataFileItem l3(V_LOCALE_COUNTRY ,m_strCountry);
	CAuditDataFileItem l4(V_LOCALE_COUNTRYCODE ,m_iCountryCode);
	CAuditDataFileItem l5(V_LOCALE_CURRENCY ,m_strCurrency);
	CAuditDataFileItem l6(V_LOCALE_DATEFORMAT ,m_strDateFormat);
	CAuditDataFileItem l7(V_LOCALE_LANGUAGE ,m_strLanguage);
	CAuditDataFileItem l8(V_LOCALE_LOCALLANGUAGE ,m_strLocaleLocalLanguage);
	CAuditDataFileItem l9(V_LOCALE_OEM_CODEPAGE ,m_iOEMCodePage);
	CAuditDataFileItem l10(V_LOCALE_TIMEFORMAT ,m_strTimeFormat);
	CAuditDataFileItem l11(V_LOCALE_TIMEFORMATSPECIFIER ,m_strTimeFormatSpecifier);
	CAuditDataFileItem l12(V_LOCALE_TIMEZONE ,m_strLocaleTimeZone);

	// Add the items to the category
	category.AddItem(l1);
	category.AddItem(l2);
	category.AddItem(l3);
	category.AddItem(l4);
	category.AddItem(l5);
	category.AddItem(l6);
	category.AddItem(l7);
	category.AddItem(l8);
	category.AddItem(l9);
	category.AddItem(l10);
	category.AddItem(l11);
	category.AddItem(l12);

	// ...and add the category to the AuditDataFile
	pAuditDataFile->AddAuditDataFileItem(category);

	// we always need to get the default browser details so do here
	CAuditDataFileCategory browserCategory("Internet|Browsers|Default Browser", FALSE, TRUE);
	CAuditDataFileItem b1("Path", GetRegValue("HKEY_CLASSES_ROOT\\http\\shell\\open\\command", ""));
	browserCategory.AddItem(b1);

	pAuditDataFile->AddInternetItem(browserCategory);


	log.Write("CLocaleScanner::SaveData End" ,true);
	return true;
}
开发者ID:sambasivarao,项目名称:AW-master,代码行数:58,代码来源:LocaleScanner.cpp

示例3: zeus

void MainController::newMedia(QString name)
{
    if(!medias().contains(qMakePair(m_mw->currentCategory(),name)))
    {
        MediaSPointer zeus(new Media);
        zeus->setName(name);
        zeus->setCategory(AbstractController::category(m_mw->currentCategory()).data());
        category(m_mw->currentCategory())->addAssociations(zeus);
        addMedia(zeus);
        setCurrentTable(m_mw->currentCategory());
        m_mw->setCurrentMedia(name);
    }
}
开发者ID:Chewnonobelix,项目名称:ProduitMedia,代码行数:13,代码来源:maincontroller.cpp

示例4: category

void TTSStyleActions::generateActions(QVector<int> & styles, const int current)
{
    category()->setText(QCoreApplication::tr("Style"));
    actions_.clear();

    QVector<int>::const_iterator begin = styles.begin();
    QVector<int>::const_iterator end   = styles.end();
    for(QVector<int>::const_iterator iter = begin; iter != end; ++iter)
    {
        // The text
        QString text;
        QString icon_name(":/images/style_item.png");
        switch ( *iter )
        {
        case SPEAK_STYLE_CLEAR:
            text = QCoreApplication::tr("Clear");
            icon_name = ":/images/tts_clear.png";
            break;
        case SPEAK_STYLE_NORMAL:
            text = QCoreApplication::tr("Normal");
            icon_name = ":/images/tts_normal.png";
            break;
        case SPEAK_STYLE_PLAIN:
            text = QCoreApplication::tr("Plain");
            icon_name = ":/images/tts_plain.png";
            break;
        case SPEAK_STYLE_VIVID:
            text = QCoreApplication::tr("Vivid");
            icon_name = ":/images/tts_vivid.png";
            break;
        default:
            text = QCoreApplication::tr("Invalid Speed");
            break;
        }

        // Add to category automatically.
        shared_ptr<QAction> act(new QAction(text, exclusiveGroup()));

        // Change font and make it as checkable.
        act->setCheckable(true);
        act->setData(*iter);
        act->setIcon(QIcon(QPixmap(icon_name)));

        if ( *iter == current )
        {
            act->setChecked(true);
        }

        actions_.push_back(act);
    }
}
开发者ID:HeryLong,项目名称:booxsdk,代码行数:51,代码来源:tts_actions.cpp

示例5: tokenizer

/// Function to return all of the categories that contain this algorithm
const std::vector<std::string> AlgorithmProxy::categories() const {
  Poco::StringTokenizer tokenizer(category(), categorySeparator(),
                                  Poco::StringTokenizer::TOK_TRIM |
                                      Poco::StringTokenizer::TOK_IGNORE_EMPTY);

  std::vector<std::string> res(tokenizer.begin(), tokenizer.end());

  const DeprecatedAlgorithm *depo =
      dynamic_cast<const DeprecatedAlgorithm *>(this);
  if (depo != nullptr) {
    res.emplace_back("Deprecated");
  }
  return res;
}
开发者ID:Mantid-Test-Account,项目名称:mantid,代码行数:15,代码来源:AlgorithmProxy.cpp

示例6: iswspace_l

int
iswspace_l (wint_t c, struct __locale_t *locale)
{
#ifdef _MB_CAPABLE
  c = _jp2uc_l (c, locale);
  enum category cat = category (c);
  // exclude "<noBreak>"?
  return cat == CAT_Zs
      || cat == CAT_Zl || cat == CAT_Zp // Line/Paragraph Separator
      || (c >= 0x9 && c <= 0xD);
#else
  return c < 0x100 ? isspace (c) : 0;
#endif /* _MB_CAPABLE */
}
开发者ID:Alexpux,项目名称:Cygwin,代码行数:14,代码来源:iswspace_l.c

示例7: tokenizer

/// Function to return all of the categories that contain this function
const std::vector<std::string> IFunction::categories() const
{
  std::vector < std::string > res;
  Poco::StringTokenizer tokenizer(category(), categorySeparator(),
      Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY);
  Poco::StringTokenizer::Iterator h = tokenizer.begin();

  for (; h != tokenizer.end(); ++h)
  {
    res.push_back(*h);
  }

  return res;
}
开发者ID:jkrueger1,项目名称:mantid,代码行数:15,代码来源:IFunction.cpp

示例8: render_contact_method

static void
render_contact_method(G_GNUC_UNUSED GtkCellLayout *cell_layout,
                     GtkCellRenderer *cell,
                     GtkTreeModel *model,
                     GtkTreeIter *iter,
                     G_GNUC_UNUSED gpointer data)
{
    GValue value = G_VALUE_INIT;
    gtk_tree_model_get_value(model, iter, 0, &value);
    auto cm = (ContactMethod *)g_value_get_pointer(&value);

    gchar *number = nullptr;
    if (cm && cm->category()) {
        // try to get the number category, eg: "home"
        number = g_strdup_printf("(%s) %s", cm->category()->name().toUtf8().constData(),
                                            cm->uri().toUtf8().constData());
    } else if (cm) {
        number = g_strdup_printf("%s", cm->uri().toUtf8().constData());
    }

    g_object_set(G_OBJECT(cell), "text", number, NULL);
    g_free(number);
}
开发者ID:savoirfairelinux,项目名称:ring-client-gnome,代码行数:23,代码来源:chatview.cpp

示例9: TRACE_FUN

         void CIniImpl::parse()
         {
            TRACE_FUN( Routine, "CIniImpl::parse" );

            CLexScaner scaner( &stream() );
            CCategoryParserDriver driver( file(),
                                          scaner,
                                          category(),
                                          synchronization(),
                                          errorRepository() );

            parser theParser( driver );
            theParser.parse();
         }
开发者ID:L2-Max,项目名称:l2ChipTuner,代码行数:14,代码来源:l2TextIniDrv.cpp

示例10: MessageReceived

		void
		MessageReceived(BMessage* msg)
		{
			switch(msg->what)
			{
				case SAVE_TASK:
				{
					BString category("ALL");
					int32 selection=categories->CurrentSelection();
					if(selection>=0)
					{
						Category* cat=dynamic_cast<Category*>(categories->ItemAt(selection));
						category=cat->GetName();
					}
					bool rc=manager->AddTask(title->Text(),description->Text(),category);
					if(!rc)
					{
						BAlert* error=new BAlert("SAVING ERROR",
							"Oops, we can't save that in database",
							"OK",NULL,NULL,B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
							 B_STOP_ALERT);
						error->Go();
					}
					//SEND RELOAD MESSAGE
					int32 count=be_app->CountWindows();
					for(int32 i=0;i<count;i++)
					{
						be_app->WindowAt(i)->PostMessage(new BMessage(RELOAD));
					}
				}
				case CANCEL:
				{
					Quit();
				}
				case CREATE_CATEGORY:
				{
					CreateCategory* create=new CreateCategory(manager);
					create->Show();
					PostMessage(new BMessage(RELOAD));
				}
				case RELOAD_CATEGORIES:
				{
					categories->MakeEmpty();
					manager->LoadCategories(categories);
				}
				default:
					BWindow::MessageReceived(msg);
			}
		}
开发者ID:AdrianArroyoCalle,项目名称:haiku-todo,代码行数:49,代码来源:AddTask.hpp

示例11: value

 JNIEXPORT jint JNICALL Java_org_geuz_onelab_Gmsh_setStringOption
 (JNIEnv *env, jobject obj, jstring c, jstring n, jstring v)
 {
   const char* tmp;
   tmp = env->GetStringUTFChars(v, NULL);
   const std::string value(tmp, strlen(tmp));
   env->ReleaseStringUTFChars(v, tmp);
   tmp = env->GetStringUTFChars(n, NULL);
   const std::string name(tmp, strlen(tmp));
   env->ReleaseStringUTFChars(n, tmp);
   tmp = env->GetStringUTFChars(c, NULL);
   std::string category(tmp, strlen(tmp));
   env->ReleaseStringUTFChars(c, tmp);
   GmshSetOption(category, name, value, 0);
 }
开发者ID:feelpp,项目名称:debian-gmsh,代码行数:15,代码来源:androidGModel.cpp

示例12: category

/// Generate all supported font family here.
void FontFamilyActions::generateActions(const QString &font_family,
                                        bool scan_others)
{
    category()->setFont(actionFont());
    category()->setText(QCoreApplication::tr("Font Family"));
    actions_.clear();

    QFontDatabase fdb;
    if (scan_others)
    {
        // Scan both internal flash and sd card.
        loadExternalFonts(&fonts_);
    }

    QStringList list;
    list =  fdb.families();

    foreach (QString family, list)
    {
        // Add to category automatically.
        shared_ptr<QAction> act(new QAction(family, exclusiveGroup()));

        // Change font and set it as checkable.
        act->setFont(QFont(family));
        act->setCheckable(true);
        act->setData(family);
        act->setIcon(QIcon(QPixmap(":/images/font_family_item.png")));

        if (family == font_family)
        {
            act->setChecked(true);
            font_family_ = font_family;
        }

        actions_.push_back(act);
    }
开发者ID:HeryLong,项目名称:booxsdk,代码行数:37,代码来源:font_family_actions.cpp

示例13: equal

bool internal_node::equal(const node& other) const
{
    if (other.is_leaf() || category() != other.category())
        return false;

    const auto& internal = other.as<internal_node>();

    if (num_children() != internal.num_children())
        return false;

    bool ret = true;
    for (size_t i = 0; i < num_children(); ++i)
        ret &= children_[i]->equal(*internal.children_[i]);
    return ret;
}
开发者ID:MGKhKhD,项目名称:meta,代码行数:15,代码来源:internal_node.cpp

示例14: day

void SatellitesMSCItem::setDescription()
{
    QString description =
      QObject::tr( "Object name: %1 <br />"
                   "Category: %2 <br />"
                   "Pericentre: %3 km<br />"
                   "Apocentre: %4 km<br />"
                   "Inclination: %5 Degree<br />"
                   "Revolutions per day (24h): %6" )
        .arg( name(), category(), QString::number( m_perc, 'f', 2 ),
                                  QString::number( m_apoc, 'f', 2 ),
                                  QString::number( m_inc, 'f', 2 ),
                                  QString::number( m_n0, 'f', 2 ) );
     placemark()->setDescription( description );
}
开发者ID:ashish173,项目名称:marble,代码行数:15,代码来源:SatellitesMSCItem.cpp

示例15: category

IseServerInspector::CommandItems PredefinedInspector::getItems() const
{
    typedef IseServerInspector::CommandItem CommandItem;
    typedef IseServerInspector::CommandItems CommandItems;

    string category("proc");
    CommandItems items;

    items.push_back(CommandItem(category, "basic_info", PredefinedInspector::getBasicInfo, "show the basic info."));
    items.push_back(CommandItem(category, "status", PredefinedInspector::getProcStatus, "print /proc/self/status."));
    items.push_back(CommandItem(category, "opened_file_count", PredefinedInspector::getOpenedFileCount, "count /proc/self/fd."));
    items.push_back(CommandItem(category, "thread_count", PredefinedInspector::getThreadCount, "count /proc/self/task."));

    return items;
}
开发者ID:Elvins,项目名称:ise,代码行数:15,代码来源:ise_inspector.cpp


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