ccPickOneElementDlg.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. //##########################################################################
  3. //# #
  4. //# CLOUDCOMPARE #
  5. //# #
  6. //# This program is free software; you can redistribute it and/or modify #
  7. //# it under the terms of the GNU General Public License as published by #
  8. //# the Free Software Foundation; version 2 or later of the License. #
  9. //# #
  10. //# This program is distributed in the hope that it will be useful, #
  11. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  12. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  13. //# GNU General Public License for more details. #
  14. //# #
  15. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  16. //# #
  17. //##########################################################################
  18. #include "CCAppCommon.h"
  19. //Qt
  20. #include <QDialog>
  21. class Ui_PickOneElementDialog;
  22. //! Minimal dialog to pick one element in a list (combox box)
  23. class CCAPPCOMMON_LIB_API ccPickOneElementDlg : public QDialog
  24. {
  25. Q_OBJECT
  26. public:
  27. //! Default constructor
  28. ccPickOneElementDlg(const QString &label,
  29. const QString &windowTitle = QString(),
  30. QWidget* parent = nullptr);
  31. //! Destructor
  32. ~ccPickOneElementDlg() override;
  33. //! Add an element to the combo box
  34. void addElement(const QString &elementName);
  35. //! Sets the combo box default index
  36. void setDefaultIndex(int index);
  37. //! Returns the combo box current index (after completion)
  38. int getSelectedIndex();
  39. private:
  40. //! Associated UI
  41. Ui_PickOneElementDialog* m_ui;
  42. };