CoreTrace Qt IDE 1.0
The CoreTrace Text editor
 
Loading...
Searching...
No Matches
MainWindow Class Reference

#include <main_window.hpp>

Inheritance diagram for MainWindow:

Public Slots

void toggleCliPanel ()
 Toggles the visibility of the CLI panel.
 
void saveCurrentFile ()
 Saves the current file being edited.
 
void importFile ()
 Opens a folder and sets it as the project root.
 
void toggleAutosave ()
 Toggles the autosave feature.
 
void findNext ()
 Opens a search dialog and highlights all occurrences of the search term.
 
void hideSecurityNotification ()
 Hides the security notification with fade-out animation.
 

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 Constructs the MainWindow object.
 
 ~MainWindow ()
 Destructor for MainWindow.
 
void show ()
 Displays the main window.
 
void updateAuditResults (const QList< AuditResult > &results)
 Updates the audit results in the UI.
 
void setProjectRoot (const QString &path)
 Sets the root path for the project.
 
void addToolButton (const QString &text, const QString &toolTip, const QIcon &icon, const char *slot, QObject *receiver)
 Adds a tool button to the toolbar.
 
void addToolSeparator ()
 Adds a separator to the toolbar.
 
void addWidget (QWidget *widget, Qt::Alignment alignment=Qt::Alignment())
 Adds a widget to the main layout.
 
FileTreeViewgetFileTreeView () const
 
QTextEdit * getTextEditor () const
 
void highlightSecurityIssue (const AuditResult &result)
 Highlights a security issue in the text editor with enhanced visual effects.
 
void clearSecurityHighlights ()
 Clears all security issue highlights from the text editor.
 
void showSecurityNotification (const AuditResult &result)
 Shows a prominent security notification for the given result.
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 Event filter to handle keyboard shortcuts and focus events.
 

Private Member Functions

void setupUi ()
 Sets up the UI for the main window.
 
void setupMenuBar ()
 Sets up the menu bar and its actions.
 
void setupToolBar ()
 Sets up the toolbar and its actions.
 
void setupStatusBar ()
 Sets up the status bar.
 
void setupCentralWidget ()
 Sets up the central widget and its layout.
 
void createSecurityNotificationWidget ()
 Creates and sets up the security notification widget.
 
void animateHighlight (const QTextCursor &cursor, const QString &severity)
 Creates an animated highlight effect for the specified cursor position.
 

Private Attributes

QSplitter * mainSplitter
 
QToolBar * mainToolBar
 
QWidget * centralWidget
 
QVBoxLayout * mainLayout
 
FileTreeViewfileTree
 
QTextEdit * textEditor
 
QFileSystemModel * fileSystemModel
 
CliOptionsPanelcliPanel
 
OutputDisplayoutputDisplay
 
QAction * toggleCliPanelAction
 
QAction * saveAction
 
QAction * importAction
 
QAction * autosaveAction
 
bool autosaveEnabled
 
QString currentFilePath
 
QList< UIComponent * > uiComponents
 
CppHighlightersyntaxHighlighter
 
QFrame * securityNotificationFrame
 
QLabel * securityNotificationIcon
 
QLabel * securityNotificationText
 
QTimer * notificationTimer
 
QPropertyAnimation * notificationAnimation
 
QGraphicsOpacityEffect * notificationOpacity
 
QList< QTextEdit::ExtraSelection > currentHighlights
 
QTimer * blinkTimer
 
bool blinkState
 

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QWidget *  parent = nullptr)
explicit

Constructs the MainWindow object.

Parameters
parentThe parent widget.

◆ ~MainWindow()

MainWindow::~MainWindow ( )

Destructor for MainWindow.

Member Function Documentation

◆ addToolButton()

void MainWindow::addToolButton ( const QString &  text,
const QString &  toolTip,
const QIcon &  icon,
const char *  slot,
QObject *  receiver 
)

Adds a tool button to the toolbar.

Parameters
textThe button text.
toolTipThe tooltip text.
iconThe button icon.
slotThe slot to connect the button to.
receiverThe object receiving the signal.

◆ addToolSeparator()

void MainWindow::addToolSeparator ( )

Adds a separator to the toolbar.

◆ addWidget()

void MainWindow::addWidget ( QWidget *  widget,
Qt::Alignment  alignment = Qt::Alignment() 
)

Adds a widget to the main layout.

Parameters
widgetThe widget to add.
alignmentThe alignment of the widget.

◆ animateHighlight()

void MainWindow::animateHighlight ( const QTextCursor &  cursor,
const QString &  severity 
)
private

Creates an animated highlight effect for the specified cursor position.

Parameters
cursorThe text cursor indicating the position to animate.
severityThe severity level for color selection.

◆ clearSecurityHighlights()

void MainWindow::clearSecurityHighlights ( )

Clears all security issue highlights from the text editor.

◆ createSecurityNotificationWidget()

void MainWindow::createSecurityNotificationWidget ( )
private

Creates and sets up the security notification widget.

◆ eventFilter()

bool MainWindow::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Event filter to handle keyboard shortcuts and focus events.

Parameters
objThe object receiving the event.
eventThe event to be processed.
Returns
True if the event was handled, otherwise false.

◆ findNext

void MainWindow::findNext ( )
slot

Opens a search dialog and highlights all occurrences of the search term.

◆ getFileTreeView()

FileTreeView * MainWindow::getFileTreeView ( ) const
inline

◆ getTextEditor()

QTextEdit * MainWindow::getTextEditor ( ) const
inline

◆ hideSecurityNotification

void MainWindow::hideSecurityNotification ( )
slot

Hides the security notification with fade-out animation.

◆ highlightSecurityIssue()

void MainWindow::highlightSecurityIssue ( const AuditResult result)

Highlights a security issue in the text editor with enhanced visual effects.

Parameters
resultThe audit result containing location information.

◆ importFile

void MainWindow::importFile ( )
slot

Opens a folder and sets it as the project root.

◆ saveCurrentFile

void MainWindow::saveCurrentFile ( )
slot

Saves the current file being edited.

◆ setProjectRoot()

void MainWindow::setProjectRoot ( const QString &  path)

Sets the root path for the project.

Parameters
pathThe root path to set.

◆ setupCentralWidget()

void MainWindow::setupCentralWidget ( )
private

Sets up the central widget and its layout.

◆ setupMenuBar()

void MainWindow::setupMenuBar ( )
private

Sets up the menu bar and its actions.

◆ setupStatusBar()

void MainWindow::setupStatusBar ( )
private

Sets up the status bar.

◆ setupToolBar()

void MainWindow::setupToolBar ( )
private

Sets up the toolbar and its actions.

◆ setupUi()

void MainWindow::setupUi ( )
private

Sets up the UI for the main window.

◆ show()

void MainWindow::show ( )

Displays the main window.

◆ showSecurityNotification()

void MainWindow::showSecurityNotification ( const AuditResult result)

Shows a prominent security notification for the given result.

Parameters
resultThe audit result to display.

◆ toggleAutosave

void MainWindow::toggleAutosave ( )
slot

Toggles the autosave feature.

◆ toggleCliPanel

void MainWindow::toggleCliPanel ( )
slot

Toggles the visibility of the CLI panel.

◆ updateAuditResults()

void MainWindow::updateAuditResults ( const QList< AuditResult > &  results)

Updates the audit results in the UI.

Parameters
resultsThe list of audit results to display.

Member Data Documentation

◆ autosaveAction

QAction* MainWindow::autosaveAction
private

◆ autosaveEnabled

bool MainWindow::autosaveEnabled
private

◆ blinkState

bool MainWindow::blinkState
private

◆ blinkTimer

QTimer* MainWindow::blinkTimer
private

◆ centralWidget

QWidget* MainWindow::centralWidget
private

◆ cliPanel

CliOptionsPanel* MainWindow::cliPanel
private

◆ currentFilePath

QString MainWindow::currentFilePath
private

◆ currentHighlights

QList<QTextEdit::ExtraSelection> MainWindow::currentHighlights
private

◆ fileSystemModel

QFileSystemModel* MainWindow::fileSystemModel
private

◆ fileTree

FileTreeView* MainWindow::fileTree
private

◆ importAction

QAction* MainWindow::importAction
private

◆ mainLayout

QVBoxLayout* MainWindow::mainLayout
private

◆ mainSplitter

QSplitter* MainWindow::mainSplitter
private

◆ mainToolBar

QToolBar* MainWindow::mainToolBar
private

◆ notificationAnimation

QPropertyAnimation* MainWindow::notificationAnimation
private

◆ notificationOpacity

QGraphicsOpacityEffect* MainWindow::notificationOpacity
private

◆ notificationTimer

QTimer* MainWindow::notificationTimer
private

◆ outputDisplay

OutputDisplay* MainWindow::outputDisplay
private

◆ saveAction

QAction* MainWindow::saveAction
private

◆ securityNotificationFrame

QFrame* MainWindow::securityNotificationFrame
private

◆ securityNotificationIcon

QLabel* MainWindow::securityNotificationIcon
private

◆ securityNotificationText

QLabel* MainWindow::securityNotificationText
private

◆ syntaxHighlighter

CppHighlighter* MainWindow::syntaxHighlighter
private

◆ textEditor

QTextEdit* MainWindow::textEditor
private

◆ toggleCliPanelAction

QAction* MainWindow::toggleCliPanelAction
private

◆ uiComponents

QList<UIComponent*> MainWindow::uiComponents
private

The documentation for this class was generated from the following files: