ctkColorDialog.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkColorDialog_h
  15. #define __ctkColorDialog_h
  16. // Qt includes
  17. #include <QColorDialog>
  18. // CTK includes
  19. #include "ctkWidgetsExport.h"
  20. class ctkColorDialogPrivate;
  21. /// Customizable QColorDialog.
  22. /// Extra widgets can be added to the left of the dialog into a QStackedWidget
  23. class CTK_WIDGETS_EXPORT ctkColorDialog : public QColorDialog
  24. {
  25. Q_OBJECT
  26. public:
  27. /// Constructor
  28. /// By default, behaves like a QColorDialog
  29. /// \sa QColorDialog()
  30. explicit ctkColorDialog(QWidget* parent = 0);
  31. explicit ctkColorDialog(const QColor& initial, QWidget* parent = 0);
  32. virtual ~ctkColorDialog();
  33. /// Add an extra widget under the file format combobox. If a label is
  34. /// given, it will appear in the first column.
  35. /// The widget is reparented to ctkColorDialog
  36. void addTab(QWidget* widget, const QString& label);
  37. /// Return the extra widget if any
  38. QWidget* widget(int index)const;
  39. /// Internally used
  40. //bool eventFilter(QObject *obj, QEvent *event);
  41. protected:
  42. QScopedPointer<ctkColorDialogPrivate> d_ptr;
  43. private:
  44. Q_DECLARE_PRIVATE(ctkColorDialog);
  45. Q_DISABLE_COPY(ctkColorDialog);
  46. };
  47. #endif