Loading...
Searching...
No Matches
textEditorWidget.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_WIDGETS_TEXTEDITORWIDGET_H
#define BALL_VIEW_WIDGETS_TEXTEDITORWIDGET_H
#ifndef BALL_VIEW_KERNEL_COMMON_H
# include <BALL/VIEW/KERNEL/common.h>
#endif
#ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
# include <BALL/VIEW/WIDGETS/dockWidget.h>
#endif
#include <QPlainTextEdit>
#include <QObject>
class QPaintEvent;
class QResizeEvent;
class QSize;
class QWidget;
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT TextEditorWidget
: public QPlainTextEdit
{
Q_OBJECT
public:
TextEditorWidget(QWidget *parent = 0);
void lineNumbersPaintEvent(QPaintEvent *event);
int lineNumbersWidth();
protected:
class LineNumbers
: public QWidget
{
public:
LineNumbers(TextEditorWidget *editor);
QSize sizeHint() const;
protected:
void paintEvent(QPaintEvent *event);
private:
TextEditorWidget *editor_;
};
void resizeEvent(QResizeEvent *event);
private Q_SLOTS:
void updateLineNumbersWidth(int newBlockCount);
void highlightCurrentLine();
void updateLineNumbers(const QRect &, int);
private:
QWidget *line_numbers_;
};
}
}
#endif // BALL_VIEW_WIDGETS_TEXTEDITORWIDGET_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
common.h
BALL::VIEW::TextEditorWidget::LineNumbers::paintEvent
void paintEvent(QPaintEvent *event)
BALL::VIEW::TextEditorWidget::LineNumbers::sizeHint
QSize sizeHint() const
BALL::VIEW::TextEditorWidget::LineNumbers::LineNumbers
LineNumbers(TextEditorWidget *editor)
BALL::VIEW::TextEditorWidget::TextEditorWidget
TextEditorWidget(QWidget *parent=0)
BALL::VIEW::TextEditorWidget::resizeEvent
void resizeEvent(QResizeEvent *event)
BALL::VIEW::TextEditorWidget::lineNumbersWidth
int lineNumbersWidth()
BALL::VIEW::TextEditorWidget::lineNumbersPaintEvent
void lineNumbersPaintEvent(QPaintEvent *event)
QPlainTextEdit
QWidget
dockWidget.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13