ctkCmdLineModuleExplorerTabList.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCMDLINEMODULEEXPLORERTABLIST_H
  16. #define CTKCMDLINEMODULEEXPLORERTABLIST_H
  17. class ctkCmdLineModuleFrontend;
  18. class ctkCmdLineModuleManager;
  19. #include <QObject>
  20. #include <QHash>
  21. class QTabWidget;
  22. class QModelIndex;
  23. /**
  24. * \class ctkCmdLineModuleExplorerTabList
  25. * \brief Example application tab list
  26. */
  27. class ctkCmdLineModuleExplorerTabList : public QObject
  28. {
  29. Q_OBJECT
  30. public:
  31. ctkCmdLineModuleExplorerTabList(QTabWidget* tabWidget);
  32. ~ctkCmdLineModuleExplorerTabList();
  33. ctkCmdLineModuleFrontend* activeTab() const;
  34. QList<ctkCmdLineModuleFrontend*> tabs() const;
  35. Q_SLOT void setActiveTab(ctkCmdLineModuleFrontend* frontend);
  36. Q_SLOT void addTab(ctkCmdLineModuleFrontend* frontend);
  37. Q_SIGNAL void tabActivated(ctkCmdLineModuleFrontend* module);
  38. Q_SIGNAL void tabClosed(ctkCmdLineModuleFrontend* module);
  39. private:
  40. Q_SLOT void tabIndexChanged(int index);
  41. Q_SLOT void tabCloseRequested(int index);
  42. private:
  43. QTabWidget* TabWidget;
  44. QList<ctkCmdLineModuleFrontend*> TabIndexToFrontend;
  45. };
  46. #endif // CTKCMDLINEMODULEEXPLORERTABLIST_H