ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
Loading...
Searching...
No Matches
LineNumberArea.h
1/*$!{
2* Aurora Clang AST Viewer (ACAV)
3*
4* Copyright (c) 2026 Min Liu
5* Copyright (c) 2026 Michael David Adams
6*
7* SPDX-License-Identifier: GPL-2.0-or-later
8*
9* This program is free software; you can redistribute it and/or modify
10* it under the terms of the GNU General Public License as published by
11* the Free Software Foundation; either version 2 of the License, or
12* (at your option) any later version.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
19* You should have received a copy of the GNU General Public License along
20* with this program; if not, see <https://www.gnu.org/licenses/>.
21}$!*/
22
23#pragma once
24
25#include <QWidget>
26
27namespace acav {
28
29class SourceCodeView; // Forward declaration
30
37class LineNumberArea : public QWidget {
38 Q_OBJECT
39
40public:
43 explicit LineNumberArea(SourceCodeView *editor);
44
47 QSize sizeHint() const override;
48
49protected:
52 void paintEvent(QPaintEvent *event) override;
53
54private:
55 SourceCodeView *codeEditor_; // Non-owning pointer to parent editor
56};
57
58} // namespace acav
void paintEvent(QPaintEvent *event) override
Paints line numbers for visible text blocks.
LineNumberArea(SourceCodeView *editor)
Construct line number area for given editor.
QSize sizeHint() const override
Returns size hint based on current line number width.
Source code viewer with line numbers and lightweight syntax highlighting.