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


C++ KPopupMenu::removeItemAt方法代码示例

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


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

示例1: KLAidWidgetBase

/**
 * @short Initialize
 * @author Rene Schmidt <[email protected]>
 * @version 0.1
 */
KLAidWidget::KLAidWidget(QWidget* parent, const char* name, WFlags fl)
        : KLAidWidgetBase(parent,name,fl)
{
  this->setCaption(i18n("K Learning Aid %1").arg(VER));

  cfgOkay = FALSE;
  
  oldRepVal = 1;
  
  // Center window
  QDesktopWidget *d = QApplication::desktop();
  int dW = d->width();      int dH = d->height();
  int wW = this->width();   int wH = this->height();
  this->setGeometry((dW-wW)/2, (dH-wH)/2, wW, wH);
  
  // Create tray icon
  tray = new KSystemTray(this, "TimerTray");
  tray->setPixmap(SmallIcon("ktimer"));
  tray->show();

  QToolTip::add(tray, i18n("K Learning Aid %1").arg(VER));
  
  // Create logic backend
  aut = new KLAid(this);
  aut->desktopWidth = d->width();
  aut->setCentralWidget(tray);
  
  QObject::connect(aut, SIGNAL(loopExpired()), this, SLOT(reportExpired()));
  QObject::connect(aut, SIGNAL(popNow( QString&, QString&, uint&)),
                    this, SLOT(showPopUp(QString&, QString&, uint&)));

  // Add some tray menu items
  KPopupMenu * TrayMenu = tray->contextMenu(); 

  enPopAction = new KToggleAction(  i18n("&Enable PopUps"),
                                    0, 
                                    this, 
                                    SLOT(toggleTimer()), 
                                    parentWidget(), 
                                    TOGGLE_ITEM);

  KAction * AboutAction = new KAction(  i18n("&About"), 
                                        0, 
                                        this, 
                                        SLOT(about()), 
                                        parentWidget(), 
                                        ABOUT_ITEM);
      
  TrayMenu->removeItemAt(0);
  TrayMenu->insertTitle(SmallIcon("ktimer"), QString("KLAid"), 0, 0);
  
  enPopAction->plug(TrayMenu, 1);
  enPopAction->setEnabled(FALSE);
  
  AboutAction->plug(TrayMenu, 2);

  connect(popUpInterval, SIGNAL(valueChanged(const QString&)), this, SLOT(sanitizeMinStay()));
  connect(urlLine, SIGNAL(urlSelected(const QString&)), this, SLOT(enableOKButton()));
  connect(minStay, SIGNAL(valueChanged(const QString&)), this, SLOT(sanitizeMinStay()));
  connect(pIntvalUnit, SIGNAL(activated(const QString&)), this, SLOT(sanitizeMinStay()));
  connect(overlapPops, SIGNAL(stateChanged(int)), this, SLOT(sanitizeMinStay()));
  connect(rndSeqBox, SIGNAL(stateChanged(int)), this, SLOT(turnOffUniq()));
  connect(repModeBox, SIGNAL(activated(const QString&)), this, SLOT(changeRepMode()));
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));
  connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
//  connect(defaultsButton, SIGNAL(clicked()), this, SLOT(resetConfig()));

  // Set default fonts for popups
  fntCaption = new QFont();
  fntCaption->setBold(TRUE);
  kFontRequester1->setFont(*fntCaption);
  fntBody = new QFont();
  kFontRequester2->setFont(*fntBody);

  // Set default fonts for popups
  tmpFgColor = new QColor(this->foregroundColor());
  tmpBgColor = new QColor(this->backgroundColor());

  fgCol->setColor(this->foregroundColor());
  bgCol->setColor(this->backgroundColor());

  this->_readConfig();
  this->show();
}
开发者ID:rene-s,项目名称:KdeLearningAid,代码行数:89,代码来源:klaidwidget.cpp


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