VPTissue Reference Manual
EnabledActions.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "EnabledActions.h"
21 
22 #include <QAction>
23 #include <QMenu>
24 
25 using namespace std;
26 
27 namespace SimShell {
28 namespace Gui {
29 
30 void EnabledActions::Add(QAction* a)
31 {
32  actions.push_back(a);
33 }
34 
35 void EnabledActions::Add(QMenu* m)
36 {
37  menus.push_back(m);
38 }
39 
40 void EnabledActions::Set(vector<QAction*> a)
41 {
42  actions = move(a);
43 }
44 
45 void EnabledActions::Enable()
46 {
47  for (auto a : actions) a->setEnabled(true);
48  for (auto m : menus) m->setEnabled(true);
49 }
50 
51 void EnabledActions::Disable()
52 {
53  for (auto a : actions) a->setEnabled(false);
54  for (auto m : menus) m->setEnabled(false);
55 }
56 
57 } // namespace Gui
58 } // namespace SimShell
STL namespace.
EnabledActions interface.
see the online Qt documentation
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32