Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_text_editor2.h
T
berrux-dev 855b0a6101 Remove modules not compiled by this branch's release build
Lts/Common: drop the 17 submodules excluded from the RELEASE_BUILD
branch of Lts/Common/CMakeLists.txt (CodeGen, LtsAppManager, LtsBotan,
LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor,
LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
LtsScriptTimeline, LtsSession, LtsTimeline, LtsTimelineClassic,
LtsVirtualKeyboard, LtsWidgets, TopicEditorBase). Only the 13
subdirectories actually built remain.

TrainingAreaBase: drop sources of targets excluded by
IF(NOT RELEASE_BUILD) / IF(BUILD_RTI) (svcTabClient, svcTabServer,
svcTrainingAreaBase exe, RecordReplayPlugin customization) and the 7
plugin directories not added in the release path (AdlerJson,
ApacheHlaJson, DebugJsonDir, HlaJson, Nmea, UAS, WlsTetra). Only
tabTelegrams, svcTabCommon and the TetraJson plugin are compiled.

Cross-checked: no kept compiled source includes headers from the
removed modules (GuiPluginInterface - the only LtsWidgets consumer -
is itself NOT RELEASE_BUILD-guarded).
2026-10-13 19:19:55 +02:00

141 lines
3.2 KiB
C++

/**
* @RDE_HEADER@
* Widget to create Text Editor
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <LtsWidgets/lts_widgets_export.h>
#include <QtWidgets/QMainWindow>
#include <QtCore/QMap>
#include <QtCore/QPointer>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QGridLayout>
#include <QtPrintSupport/QPrinter>
#include <QtPrintSupport/QPrintPreviewDialog>
QT_BEGIN_NAMESPACE
class QAction;
class QComboBox;
class QFontComboBox;
class QTextEdit;
class QTextCharFormat;
class QMenu;
class QPrinter;
QT_END_NAMESPACE
namespace LtsWidgets
{
class LTSWIDGETS_EXPORT LtsTextEditor2 : public QMainWindow
{
Q_OBJECT
public:
explicit LtsTextEditor2(QWidget *parent = nullptr);
~LtsTextEditor2();
static QString rsrcPath(){return (QStringLiteral(":/images/win"));}
QColor m_backgroundColor{Qt::white};
QColor m_foregroundColor{Qt::black};
QTextEdit *textEdit();
QColor backgroundColor() const;
void enableBackgroundColor(bool onOff);
void setInitialBackgroundColor(const QColor &bgColor);
bool load(const QString &f);
Q_SIGNALS:
void backgroundColorChanged(const QColor &bgColor);
public slots:
private slots:
void onFileNew();
void onFileOpen();
bool onFileSave();
bool onFileSaveAs();
void onFilePrint();
void onFilePrintPreview();
void onFilePrintPdf();
void onTextBold();
void onTextUnderline();
void onTextItalic();
void onTextFamily(const QString &f);
void onTextSize(const QString &p);
void onTextStyle(int styleIndex);
void onTextColor();
void onTextAlign(QAction *a);
void setChecked(bool checked);
void indent();
void unindent();
void slotBackgroundColorChanged(const QColor &bgColor);
void slotBackgroundColor();
void currentCharFormatChanged(const QTextCharFormat &format);
void cursorPositionChanged();
void clipboardDataChanged();
void about();
void printPreview(QPrinter *);
private:
void setupFileActions();
void setupEditActions();
void setupTextActions();
bool maybeSave();
void setCurrentFileName(const QString &fileName);
void modifyIndentation(int amount);
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
void fontChanged(const QFont &f);
void colorChanged(const QColor &c);
void alignmentChanged(Qt::Alignment a);
QAction *m_actionSave;
QAction *m_actionOpen;
QAction *m_actionQuit;
QAction *m_actionSaveAs;
QAction *m_actionNew;
QAction *m_actionPrint;
QAction *m_actionPreview;
QAction *m_actionExport;
QAction *m_actionTextBold;
QAction *m_actionTextUnderline;
QAction *m_actionTextItalic;
QAction *m_actionTextColor;
QAction *m_actionBackgroundColor;
QAction *m_actionAlignLeft;
QAction *m_actionAlignCenter;
QAction *m_actionAlignRight;
QAction *m_actionAlignJustify;
QAction *m_actionIndentLess;
QAction *m_actionIndentMore;
QAction *m_actionToggleCheckState;
QAction *m_actionUndo;
QAction *m_actionRedo;
#ifndef QT_NO_CLIPBOARD
QAction *m_actionCut;
QAction *m_actionCopy;
QAction *m_actionPaste;
#endif
QComboBox *m_comboStyle;
QAction *m_comboStyleAction;
QFontComboBox *m_comboFont;
QComboBox *m_comboSize;
QToolBar *m_tb;
QString m_fileName;
QTextEdit *m_textEdit;
};
} // namespace LtsWidgets