Пример #1
0
bool LabeledSection::eventFilter(QObject* pObject, QEvent* pEvent)
{
   bool bReturn = QWidget::eventFilter(pObject, pEvent);
   if ((pObject != NULL) && (pEvent != NULL))
   {
      if (pObject == mpSectionWidget)
      {
         QEvent::Type eventType = pEvent->type();
         if ((eventType == QEvent::Show) || (eventType == QEvent::ShowToParent) ||
            (eventType == QEvent::Hide) || (eventType == QEvent::HideToParent))
         {
            updateIndicator();
         }
      }
   }

   return bReturn;
}
Пример #2
0
void LabeledSection::setSectionWidget(QWidget *pNewSectionWidget)
{
   QGridLayout* pLayout = dynamic_cast<QGridLayout*>(layout());
   VERIFYNRV(pLayout != NULL);

   if (mpSectionWidget != NULL)
   {
      mpSectionWidget->setParent(NULL);
      mpSectionWidget->removeEventFilter(this);
      pLayout->removeWidget(mpSectionWidget);
   }

   mpSectionWidget = pNewSectionWidget;
   if (mpSectionWidget != NULL)
   {
      mpSectionWidget->setParent(this);
      mpSectionWidget->installEventFilter(this);
      pLayout->addWidget(mpSectionWidget, 1, 1, 1, 2);
   }

   updateIndicator();
}
Пример #3
0
void LayoutConfig::displayNameChanged(const QString &newDisplayName)
{
    QListViewItem *selLayout = widget->listLayoutsDst->selectedItem();
    if(selLayout == NULL)
        return;

    const LayoutUnit layoutUnitKey = getLayoutUnitKey(selLayout);
    LayoutUnit &layoutUnit = *m_kxkbConfig.m_layouts.find(layoutUnitKey);

    QString oldName = selLayout->text(LAYOUT_COLUMN_DISPLAY_NAME);

    if(oldName.isEmpty())
        oldName = KxkbConfig::getDefaultDisplayName(layoutUnit);

    if(oldName != newDisplayName)
    {
        kdDebug() << "setting label for " << layoutUnit.toPair() << " : " << newDisplayName << endl;
        selLayout->setText(LAYOUT_COLUMN_DISPLAY_NAME, newDisplayName);
        updateIndicator(selLayout);
        emit changed();
    }
}
Пример #4
0
void dt_sequencer::updateIndicator(){
	updateIndicator(bCounter_clockwise);
}