ctkFittedTextBrowser.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. All rights reserved.
  5. Distributed under a BSD License. See LICENSE.txt file.
  6. This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even
  7. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the above copyright notice for more information.
  9. =========================================================================*/
  10. #ifndef __ctkFittedTextBrowser_h
  11. #define __ctkFittedTextBrowser_h
  12. // Qt includes
  13. #include <QTextBrowser>
  14. // CTK includes
  15. #include "CTKWidgetsExport.h"
  16. class CTK_WIDGETS_EXPORT ctkFittedTextBrowser : public QTextBrowser
  17. {
  18. Q_OBJECT
  19. public:
  20. ctkFittedTextBrowser(QWidget* parent = 0);
  21. virtual ~ctkFittedTextBrowser();
  22. virtual QSize sizeHint() const;
  23. virtual QSize minimumSizeHint() const;
  24. virtual int heightForWidth(int width) const;
  25. protected slots:
  26. void heightForWidthMayHaveChanged();
  27. protected:
  28. virtual void resizeEvent(QResizeEvent* e);
  29. };
  30. #endif