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


C++ QPopupMenu::setItemParameter方法代码示例

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


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

示例1: QPopupMenu

SpawnPointListMenu::SpawnPointListMenu(SpawnPointList* spawnPointList,
				       QWidget* parent, const char* name)
  : QPopupMenu(parent, name),
    m_spawnPointList(spawnPointList),
    m_currentItem(NULL)
{
  m_id_rename = insertItem("&Rename Spawn Point...",
			   this, SLOT(rename_item(int)));
  m_id_delete = insertItem("&Delete Spawn Point...",
			   this, SLOT(delete_item(int)));
  insertItem("&Clear Spawn Points...",
	     m_spawnPointList, SLOT(clearItems(void)));

  QPopupMenu* listColMenu = new QPopupMenu;
  insertItem("Show &Column", listColMenu);
  listColMenu->setCheckable(true);

  int x = tSpawnPointCoord1;
  m_id_cols[x] = listColMenu->insertItem("Coord &1");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("Coord &2");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("Coord &3");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Remaining");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Name");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Last");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Spawned");
  listColMenu->setItemParameter(m_id_cols[x], x);
  x++;
  m_id_cols[x] = listColMenu->insertItem("&Count");
  listColMenu->setItemParameter(m_id_cols[x], x);
  
  connect (listColMenu, SIGNAL(activated(int)), 
	   this, SLOT(toggle_col(int)));
  
  insertSeparator(-1);
  insertItem("&Font...", this, SLOT(set_font(int)));
  insertItem("&Caption...", this, SLOT(set_caption(int)));

  insertSeparator(-1);
  x = insertItem("Keep Sorted", this, SLOT(toggle_keepSorted(int)));
  setItemChecked(x, m_spawnPointList->keepSorted());

  connect(this, SIGNAL(aboutToShow()),
	  this, SLOT(init_menu()));
}
开发者ID:carriercomm,项目名称:showeq,代码行数:56,代码来源:spawnpointlist.cpp

示例2: insertItem

SpawnListMenu::SpawnListMenu(SEQListView* spawnlist,
                             SEQWindow* spawnlistWindow,
                             FilterMgr* filterMgr,
                             CategoryMgr* categoryMgr,
                             QWidget* parent, const char* name)
    : m_spawnlist(spawnlist),
      m_spawnlistWindow(spawnlistWindow),
      m_filterMgr(filterMgr),
      m_categoryMgr(categoryMgr)
{
    // Show Columns
    QPopupMenu* spawnListColMenu = new QPopupMenu;
    insertItem( "Show &Column", spawnListColMenu);
    spawnListColMenu->setCheckable(true);
    m_id_spawnList_Cols[tSpawnColName] =
        spawnListColMenu->insertItem("&Name");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColName],
                                       tSpawnColName);
    m_id_spawnList_Cols[tSpawnColLevel] = spawnListColMenu->insertItem("&Level");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColLevel],
                                       tSpawnColLevel);
    m_id_spawnList_Cols[tSpawnColHP] = spawnListColMenu->insertItem("&HP");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColHP],
                                       tSpawnColHP);
    m_id_spawnList_Cols[tSpawnColMaxHP] = spawnListColMenu->insertItem("&Max HP");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColMaxHP],
                                       tSpawnColMaxHP);
    m_id_spawnList_Cols[tSpawnColXPos] = spawnListColMenu->insertItem("Coord &1");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColXPos],
                                       tSpawnColXPos);
    m_id_spawnList_Cols[tSpawnColYPos] = spawnListColMenu->insertItem("Coord &2");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColYPos],
                                       tSpawnColYPos);
    m_id_spawnList_Cols[tSpawnColZPos] = spawnListColMenu->insertItem("Coord &3");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColZPos],
                                       tSpawnColZPos);
    m_id_spawnList_Cols[tSpawnColID] = spawnListColMenu->insertItem("I&D");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColID],
                                       tSpawnColID);
    m_id_spawnList_Cols[tSpawnColDist] = spawnListColMenu->insertItem("&Dist");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColDist],
                                       tSpawnColDist);
    m_id_spawnList_Cols[tSpawnColRace] = spawnListColMenu->insertItem("&Race");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColRace],
                                       tSpawnColRace);
    m_id_spawnList_Cols[tSpawnColClass] = spawnListColMenu->insertItem("&Class");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColClass],
                                       tSpawnColClass);
    m_id_spawnList_Cols[tSpawnColInfo] = spawnListColMenu->insertItem("&Info");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColInfo],
                                       tSpawnColInfo);
    m_id_spawnList_Cols[tSpawnColSpawnTime] = spawnListColMenu->insertItem("Spawn &Time");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColSpawnTime],
                                       tSpawnColSpawnTime);
    m_id_spawnList_Cols[tSpawnColDeity] = spawnListColMenu->insertItem("&Deity");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColDeity],
                                       tSpawnColDeity);
    m_id_spawnList_Cols[tSpawnColBodyType] = spawnListColMenu->insertItem("&Body Type");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColBodyType],
                                       tSpawnColBodyType);
    m_id_spawnList_Cols[tSpawnColGuildID] = spawnListColMenu->insertItem("Guild Tag");
    spawnListColMenu->setItemParameter(m_id_spawnList_Cols[tSpawnColGuildID],
                                       tSpawnColGuildID);

    connect (spawnListColMenu, SIGNAL(activated(int)),
             this, SLOT(toggle_spawnListCol(int)));

    int x;
    QPopupMenu* filterMenu = new QPopupMenu;
    m_id_filterMenu = insertItem("Add &Filter", filterMenu);
    setItemEnabled(m_id_filterMenu, false);
    x = filterMenu->insertItem("&Hunt...");
    filterMenu->setItemParameter(x, HUNT_FILTER);
    x = filterMenu->insertItem("&Caution...");
    filterMenu->setItemParameter(x, CAUTION_FILTER);
    x = filterMenu->insertItem("&Danger...");
    filterMenu->setItemParameter(x, DANGER_FILTER);
    x = filterMenu->insertItem("&Locate...");
    filterMenu->setItemParameter(x, LOCATE_FILTER);
    x = filterMenu->insertItem("&Alert...");
    filterMenu->setItemParameter(x, ALERT_FILTER);
    x = filterMenu->insertItem("&Filtered...");
    filterMenu->setItemParameter(x, FILTERED_FILTER);
    x = filterMenu->insertItem("&Tracer...");
    filterMenu->setItemParameter(x, TRACER_FILTER);
    connect (filterMenu, SIGNAL(activated(int)),
             this, SLOT(add_filter(int)));

    QPopupMenu* zoneFilterMenu = new QPopupMenu;
    m_id_zoneFilterMenu = insertItem("Add &Zone Filter", zoneFilterMenu);
    setItemEnabled(m_id_zoneFilterMenu, false);
    x = zoneFilterMenu->insertItem("&Hunt...");
    zoneFilterMenu->setItemParameter(x, HUNT_FILTER);
    x = zoneFilterMenu->insertItem("&Caution...");
    zoneFilterMenu->setItemParameter(x, CAUTION_FILTER);
    x = zoneFilterMenu->insertItem("&Danger...");
    zoneFilterMenu->setItemParameter(x, DANGER_FILTER);
    x = zoneFilterMenu->insertItem("&Locate...");
    zoneFilterMenu->setItemParameter(x, LOCATE_FILTER);
    x = zoneFilterMenu->insertItem("&Alert...");
//.........这里部分代码省略.........
开发者ID:xbackupx,项目名称:showeqx,代码行数:101,代码来源:spawnlistcommon.cpp

示例3: Client

 Client(const string &name, QPopupMenu &m):Name(name) {
   ChildM = new QPopupMenu;
   m.setItemParameter(m.insertItem(Name, ChildM), 1);
 }
开发者ID:BackupTheBerlios,项目名称:qjacktuner,代码行数:4,代码来源:jack.cpp

示例4: addPort

 void addPort(const char * name)
 {
   Port *P;
   Ports.push_back(P = new Port(name));
   ChildM->setItemParameter(ChildM->insertItem(P->name()), 0);
 }
开发者ID:BackupTheBerlios,项目名称:qjacktuner,代码行数:6,代码来源:jack.cpp


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