pqPythonLineNumberArea.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqPythonLineNumberArea_h
6 #define pqPythonLineNumberArea_h
7 
8 #include "pqPythonModule.h"
9 
10 #include <QWidget>
11 
12 class QTextEdit;
13 
27 {
28  Q_OBJECT
29 
30 public:
31  /* @brief Constructs a pqPythonLineNumberArea given a text
32  * @param parent the parent widget for the Qt ownership
33  * @param text the text to display the line from
34  */
35  explicit pqPythonLineNumberArea(QWidget* parent, const QTextEdit& text)
36  : QWidget(parent)
37  , TextEdit(text)
38  {
39  }
40 
44  QSize sizeHint() const override;
45 
46 protected:
54  void paintEvent(QPaintEvent* event) override;
55 
56 private:
60  const QTextEdit& TextEdit;
61 };
62 
63 #endif // pqPythonLineNumberArea_h
#define PQPYTHON_EXPORT
pqPythonLineNumberArea(QWidget *parent, const QTextEdit &text)
QWidget that displays line number for a QTextEdit.