void TrayComponent::HandleDockAction (QDockWidget *dw, bool visible) { QAction *act = dw->toggleViewAction (); if (!visible) RemoveAction (act); else AddActions ({ act }, ActionPos::Beginning); }
void CSkeletonActionExpDlg::OnBnClickedActionRemove() { POSITION pos = m_ctrlActionList.GetFirstSelectedItemPosition(); int index = m_ctrlActionList.GetNextSelectedItem(pos); if(index >= 0 && index < (int)m_ActionList.size()) { RemoveAction(index); } }
//----------------------------------------------------------------------------- //! All items removed and refreshed when the menu is first shown //----------------------------------------------------------------------------- void tAutopilotSelectedDeviceMenu::MenuOpened() { //Remove all devices (leaving the fixed items at the top) while( !m_SelectDeviceActGroup.isEmpty() ) { tAction* pAction = m_SelectDeviceActGroup.first(); RemoveAction( pAction ); m_SelectDeviceActGroup.removeOne( pAction ); } SelectItem( 0 ); QTimer::singleShot( 0, this, SLOT( UpdateListOfDevices() ) ); m_pTimer->start(); }
void AddAction(std::uint32_t multiplier, ImpulsedAction action, bool repeat) override { std::lock_guard<std::recursive_mutex> lock(m_mutex); RemoveAction(action); Record r{ multiplier, action }; m_actions.push_back(r); }