musredit 1.0.0
Loading...
Searching...
No Matches
PTextEdit Class Reference

Main window class for the musredit application. More...

#include <PTextEdit.h>

Inheritance diagram for PTextEdit:
Collaboration diagram for PTextEdit:

Public Slots

void aboutToQuit ()
 Slot: Cleanup handler called before application quits.
 

Signals

void close ()
 Signal: Emitted when the main window is closing.
 

Public Member Functions

 PTextEdit (QWidget *parent=nullptr)
 Constructs the main musredit window.
 
int getEditW ()
 Gets the configured editor width.
 
int getEditH ()
 Gets the configured editor height.
 

Private Slots

void insertTitle ()
 Slot: Inserts a title block into the current editor.
 
void insertParameterBlock ()
 Slot: Inserts a FITPARAMETER block into the current editor.
 
void insertTheoryBlock ()
 Slot: Inserts a THEORY block into the current editor.
 
void insertTheoryFunction (QAction *a)
 Slot: Inserts a specific theory function into the current editor.
 
void insertFunctionBlock ()
 Slot: Inserts a FUNCTIONS block into the current editor.
 
void insertAsymRunBlock ()
 Slot: Inserts an asymmetry RUN block into the current editor.
 
void insertSingleHistRunBlock ()
 Slot: Inserts a single histogram RUN block into the current editor.
 
void insertNonMusrRunBlock ()
 Slot: Inserts a non-µSR RUN block into the current editor.
 
void insertCommandBlock ()
 Slot: Inserts a COMMANDS block into the current editor.
 
void insertFourierBlock ()
 Slot: Inserts a FOURIER block into the current editor.
 
void insertPlotBlock ()
 Slot: Inserts a PLOT block into the current editor.
 
void insertStatisticBlock ()
 Slot: Inserts a STATISTIC block into the current editor.
 
void fileNew ()
 Slot: Creates a new empty msr file in a new tab.
 
void fileOpen ()
 Slot: Opens a file dialog to load an msr file.
 
void fileOpenRecent ()
 Slot: Opens a recently used file.
 
void fileReload ()
 Slot: Reloads the current file from disk.
 
void fileOpenPrefs ()
 Slot: Opens the preferences file in a new tab.
 
void fileSave ()
 Slot: Saves the current file.
 
void fileSaveAs ()
 Slot: Saves the current file with a new name.
 
void fileSavePrefs ()
 Slot: Saves the preferences file.
 
void filePrint ()
 Slot: Prints the current file.
 
void fileClose (const bool check=true)
 Slot: Closes the current tab.
 
void fileCloseAll ()
 Slot: Closes all open tabs.
 
void fileCloseAllOthers ()
 Slot: Closes all tabs except the current one.
 
void fileExit ()
 Slot: Exits the application.
 
void editUndo ()
 Slot: Undo last edit operation.
 
void editRedo ()
 Slot: Redo previously undone edit operation.
 
void editSelectAll ()
 Slot: Select all text in current editor.
 
void editCut ()
 Slot: Cut selected text to clipboard.
 
void editCopy ()
 Slot: Copy selected text to clipboard.
 
void editPaste ()
 Slot: Paste text from clipboard at cursor position.
 
void editFind ()
 Slot: Opens find dialog.
 
void editFindNext ()
 Slot: Finds next occurrence of search text.
 
void editFindPrevious ()
 Slot: Finds previous occurrence of search text.
 
void editFindAndReplace ()
 Slot: Opens find and replace dialog.
 
void editComment ()
 Slot: Comments out selected lines.
 
void editUncomment ()
 Slot: Uncomments selected lines.
 
void textFamily (const QString &f)
 Slot: Changes font family for current editor.
 
void textSize (const QString &p)
 Slot: Changes font size for current editor.
 
void musrWiz ()
 Slot: Launches musrWiz (msr file creation wizard).
 
void musrCalcChisq ()
 Slot: Calculates chi-square for current msr file.
 
void musrFit ()
 Slot: Executes fit with current msr file.
 
void musrMsr2Data ()
 Slot: Opens msr2data conversion dialog.
 
void musrView ()
 Slot: Launches musrView for viewing fit results.
 
void musrView2Dat ()
 Slot: Launches musrView in 2-data file mode.
 
void musrT0 ()
 Slot: Opens musrT0 dialog for determining t0 timing parameter.
 
void musrFT ()
 Slot: Opens Fourier transform dialog.
 
void musrPrefs ()
 Slot: Opens preferences dialog.
 
void musrSwapMsrMlog ()
 Slot: Swaps between .msr and .mlog files.
 
void musrSetSteps ()
 Slot: Launches musrStep for setting fit step sizes.
 
void musrDump ()
 Slot: Dumps raw histogram data from run files.
 
void mupp ()
 Slot: Launches mupp (muon parameter plot).
 
void helpContents ()
 Slot: Opens online documentation.
 
void helpAboutQt ()
 Slot: Displays Qt About dialog.
 
void helpAbout ()
 Slot: Displays musredit About dialog.
 
void exitStatusMusrWiz (int exitCode, QProcess::ExitStatus exitStatus)
 Slot: Handles exit status of musrWiz process.
 
void exitStatusMusrSetSteps (int exitCode, QProcess::ExitStatus exitStatus)
 Slot: Handles exit status of musrSetSteps process.
 
void fontChanged (const QFont &f)
 Slot: Responds to font changes in editor.
 
void textChanged (const bool forced=false)
 Slot: Responds to text changes in editor.
 
void currentCursorPosition ()
 Slot: Updates status bar with current cursor position.
 
void replace ()
 Slot: Replaces current match and finds next occurrence.
 
void replaceAndClose ()
 Slot: Replaces current match and closes replace dialog.
 
void replaceAll ()
 Slot: Replaces all occurrences without prompting.
 
void applyFontSettings (int)
 Slot: Applies font settings when tab changes.
 
void fileChanged (const QString &fileName)
 Slot: Handles file system watcher notifications.
 
void setFileSystemWatcherActive ()
 Slot: Re-enables file system watcher after delay.
 
void jumpToBlock (int idx)
 Slot: Jumps cursor to selected msr file block.
 

Private Member Functions

void setupFileActions ()
 Initializes File menu and toolbar actions.
 
void setupEditActions ()
 Initializes Edit menu and toolbar actions.
 
void setupTextActions ()
 Initializes Text menu and toolbar actions.
 
void setupMusrActions ()
 Initializes Musr menu and toolbar actions.
 
void setupHelpActions ()
 Initializes Help menu actions.
 
void setupJumpToBlock ()
 Initializes the Jump to Block combo box.
 
void load (const QString &f, const int index=-1)
 Loads a file into the editor.
 
PSubTextEditcurrentEditor () const
 Gets the currently active editor widget.
 
void doConnections (PSubTextEdit *e)
 Establishes signal-slot connections for an editor.
 
void fileSystemWatcherActivation ()
 Manages file system watcher activation state.
 
bool getTheme ()
 Detects the current system theme.
 
void fillRecentFiles ()
 Populates the Recent Files menu.
 
QStringList getRunList (QString runListStr, bool &ok)
 Parses a run list string into individual run numbers.
 
bool fileAlreadyOpen (QFileInfo &finfo, int &idx)
 Checks if a file is already open in a tab.
 
void switchMenuIcons ()
 Switches menu icons between dark and plain variants.
 
void switchToolbarIcons ()
 Switches toolbar icons between dark and plain variants.
 

Private Attributes

bool fDarkMenuIcon {false}
 flag indicating if a dark or plain icon shall be used in the menu pull-downs
 
bool fDarkToolBarIcon {false}
 flag indicating if a dark or plain icon shall be used in the toolbar
 
std::unique_ptr< PAdminfAdmin
 pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc.
 
std::unique_ptr< QFileSystemWatcher > fFileSystemWatcher
 checks if msr-files are changing on the disk while being open in musredit.
 
bool fFileSystemWatcherActive
 flag to enable/disable the file system watcher
 
QTimer fFileSystemWatcherTimeout
 timer used to re-enable file system watcher. Needed to delay the re-enabling
 
QString fLastDirInUse {QString("")}
 string holding the path from where the last file was loaded.
 
QStringList fMusrFTPrevCmd
 
int fEditW {900}
 
int fEditH {800}
 
QStatusBar * fStatusBar {nullptr}
 
QMap< QString, QAction * > fActions
 
std::unique_ptr< QAction > fMusrT0Action
 
PMsr2DataParamfMsr2DataParam
 structure holding the necessary input information for msr2data
 
PFindReplaceDatafFindReplaceData
 structure holding the ncessary input for find/replace
 
std::unique_ptr< QComboBox > fComboFont
 combo box for the font selector
 
std::unique_ptr< QComboBox > fComboSize
 combo box for the font size
 
bool fFontChanging {false}
 flag needed to prevent some textChanged feature to occure when only the font changed
 
std::unique_ptr< QComboBox > fJumpToBlock
 combo box used to jump to the msr-file blocks
 
std::unique_ptr< QTabWidget > fTabWidget
 tab widget in which the text editor(s) are placed
 
QMap< PSubTextEdit *, QString > fFilenames
 mapper between tab widget object and filename
 
QMenu * fRecentFilesMenu
 recent file menu
 
QAction * fRecentFilesAction [MAX_RECENT_FILES]
 array of the recent file actions
 

Detailed Description

Main window class for the musredit application.

PTextEdit is the primary window class that orchestrates the entire musredit application. It provides a comprehensive environment for creating, editing, and managing msr (muon spin rotation/relaxation fit) files with integrated analysis capabilities.

Application Architecture:
The application follows a tab-based document interface where:
  • Each tab contains a PSubTextEdit widget for editing one msr file
  • Multiple files can be open simultaneously in separate tabs
  • Tabs can be reordered by dragging
  • Each tab maintains independent undo/redo state
  • File system watcher monitors external changes to open files
Menu Structure:
File Menu:
  • New, Open, Recent Files, Reload
  • Save, Save As, Save Prefs
  • Print
  • Close, Close All, Close All Others
  • Exit

Edit Menu:

  • Undo, Redo
  • Select All
  • Copy, Cut, Paste
  • Find, Find Next, Find Previous
  • Find and Replace
  • Comment, Uncomment

Text Menu:

  • Font family selection
  • Font size selection

Musr Menu:

  • musrWiz (wizard for msr file creation)
  • musrCalcChisq (calculate chi-square)
  • musrFit (run fit with current msr file)
  • msr2data (convert msr to data files)
  • musrView (view fit results)
  • musrView2Dat (view two data files)
  • musrT0 (determine t0 timing parameter)
  • musrFT (Fourier transform)
  • musrPrefs (preferences dialog)
  • musrSwapMsrMlog (swap between msr and mlog files)
  • musrSetSteps (set fit step sizes)
  • musrDump (dump run data)
  • mupp (muon parameter plot)
  • Block insertion dialogs for all msr file block types

Help Menu:

  • Contents (online documentation)
  • About Qt
  • About musredit
Integrated Analysis Features:
The editor provides direct integration with musrfit analysis tools:
  • musrFit: Execute fits directly from the editor
  • musrView: Launch data visualization immediately after fitting
  • msr2data: Batch convert msr files to data format
  • musrT0: Determine timing parameters interactively
  • musrFT: Perform Fourier transforms on µSR data
  • musrDump: Inspect raw histogram data
Block Insertion Dialogs:
Dialog-based assistants for creating structured msr file blocks:
  • Title block (optional description)
  • FITPARAMETER block (parameter definitions)
  • THEORY block (fit functions)
  • FUNCTIONS block (user-defined functions)
  • RUN blocks (asymmetry, single histogram, non-µSR)
  • COMMANDS block (MINUIT commands)
  • FOURIER block (frequency analysis)
  • PLOT block (visualization settings)
  • STATISTIC block (fit results)
File System Monitoring:
The class uses QFileSystemWatcher to detect external modifications:
  • Notifies user when an open file changes on disk
  • Offers to reload the modified file
  • Prevents data loss from conflicting edits
  • Temporarily disabled during save operations
Theme Support:
Automatic adaptation to system themes:
  • Detects light vs. dark themes
  • Selects appropriate icon sets for menu and toolbar
  • Theme preferences saved in musredit_startup.xml
  • Manual override available in preferences
Configuration Management:
The class relies on PAdmin for persistent configuration:
  • Default directories (save path, executable paths)
  • Font preferences (family, size)
  • Editor dimensions (width, height)
  • Recent file list (up to MAX_RECENT_FILES)
  • Theme icon preferences
  • Theory function definitions
  • Help URL locations
Find and Replace:
Comprehensive search functionality:
  • Find with regular expression support
  • Find Next/Previous for iterating matches
  • Replace with confirmation or batch mode
  • Options: case sensitive, whole words, backwards search
  • Scope: entire document or selected text only
Process Management:
The editor spawns external processes for analysis:
  • musrWiz: Interactive msr file creation wizard
  • musrFit: Fitting engine execution
  • musrView: Results visualization
  • musrT0: Timing parameter determination
  • Exit status monitoring with appropriate error handling
Recent Files:
Maintains a list of recently opened files:
  • Quick access via File → Recent Files menu
  • Automatically updated when files are opened
  • Persisted across application sessions
  • Maximum of MAX_RECENT_FILES entries
Tab Management:
Advanced tab functionality:
  • Create new tabs (Ctrl+N)
  • Close individual tabs (Ctrl+W)
  • Close all tabs
  • Close all tabs except current (Ctrl+Shift+W)
  • Reorder tabs by dragging
  • Switch tabs via keyboard or mouse
  • Tab titles show filename (modified indicator if unsaved)
Jump to Block:
Quick navigation within msr files:
  • Combo box in toolbar lists all msr file blocks
  • Select block to jump cursor to that location
  • Automatically updates as file content changes
  • Helps navigate large msr files efficiently
Note
This class serves as the main entry point for the musredit application.
The class manages the application lifecycle including initialization and cleanup of all resources.
All dialog-based operations are modal to ensure focused interaction.
See also
PSubTextEdit For the text editor widget in each tab
PAdmin For configuration and administration
musrfit For the fitting engine
musrview For data visualization

Definition at line 237 of file PTextEdit.h.

Constructor & Destructor Documentation

◆ PTextEdit()

PTextEdit::PTextEdit ( QWidget * parent = nullptr)

Constructs the main musredit window.

Constructs the main musredit application window.

Initializes the complete musredit application window including menus, toolbars, tab widget, configuration management, file system monitoring, and theme detection. If command-line arguments are provided, attempts to load those files; otherwise creates a new empty file.

Initialization sequence:

  1. Load configuration from musredit_startup.xml via PAdmin
  2. Detect system theme and select appropriate icon sets
  3. Configure default editor dimensions from preferences
  4. Initialize file system watcher for change detection
  5. Set up all menus and toolbars (File, Edit, Text, Musr, Help)
  6. Create tab widget for multi-document interface
  7. Apply font settings from preferences
  8. Set application icon based on theme
  9. Load files from command-line arguments or create new file
  10. Connect tab change signal to font settings application
  11. Initialize status bar

Theme Detection: The constructor attempts to detect the system theme automatically:

  • Recognizes light and dark themes
  • Selects appropriate icon sets (dark/plain variants)
  • Falls back to preferences if detection fails
  • Updates preferences with detected theme

File System Watcher: Monitors open files for external changes:

  • Detects modifications, deletions, renames
  • Prompts user to reload when changes detected
  • Prevents data loss from conflicting edits

Command-Line File Loading: If arguments are provided:

musredit file1.msr file2.msr file3.msr

Each file is loaded into a separate tab.

Parameters
parentPointer to parent widget. Typically nullptr for the main window. If provided, establishes parent-child relationship for proper memory management and event propagation.
Note
The constructor displays error messages via QMessageBox if critical initialization steps fail (e.g., file system watcher creation).
Font and size combo boxes are created and added to toolbar during text actions setup.
All menus and toolbars are configured with keyboard shortcuts and status tips for accessibility.
See also
PAdmin For configuration management
setupFileActions() Creates File menu and toolbar
setupEditActions() Creates Edit menu and toolbar
setupTextActions() Creates Text menu and toolbar
setupMusrActions() Creates Musr menu and toolbar
setupHelpActions() Creates Help menu
load() For file loading mechanism

Initializes the complete musredit environment with all menus, toolbars, file system monitoring, theme detection, and configuration management. This constructor performs extensive setup to create a fully-functional msr file editor with integrated analysis capabilities.

Parameters
parentPointer to parent widget (typically nullptr for main window).

Definition at line 156 of file PTextEdit.cpp.

Member Function Documentation

◆ aboutToQuit

void PTextEdit::aboutToQuit ( )
slot

Slot: Cleanup handler called before application quits.

Cleanup handler called before application termination.

Performs final cleanup of dynamically allocated resources before the application terminates. This slot is typically connected to QApplication::aboutToQuit() signal to ensure proper memory deallocation.

Resources freed:

  • fMsr2DataParam: msr2data configuration structure
  • fFindReplaceData: find/replace settings structure

Both pointers are safely checked for nullptr before deletion and set to nullptr after freeing to prevent double deletion.

Note
This slot should be called only once during application shutdown.
Qt's parent-child ownership handles cleanup of most GUI elements; this only handles explicitly allocated data structures.
See also
PMsr2DataParam For msr2data configuration structure
PFindReplaceData For find/replace settings structure

Frees dynamically allocated data structures that are not managed by Qt's parent-child ownership system. This slot is connected to QApplication::aboutToQuit() to ensure proper cleanup during shutdown.

Resources freed:

Both pointers are checked for nullptr before deletion and set to nullptr afterward to prevent double deletion.

Note
Qt's parent-child ownership automatically handles GUI widget cleanup.
This method should only be called once during application shutdown.

Definition at line 246 of file PTextEdit.cpp.

◆ applyFontSettings

void PTextEdit::applyFontSettings ( int )
privateslot

Slot: Applies font settings when tab changes.

Parameters
Unusedtab index parameter (uses currentEditor() instead).

When user switches tabs, updates font combo boxes to reflect the font settings of the newly active editor.

SLOT: updates the fonts if the textedit tab has changed.

Definition at line 3466 of file PTextEdit.cpp.

◆ close

void PTextEdit::close ( )
signal

Signal: Emitted when the main window is closing.

This signal notifies connected objects that the main window is about to close. Can be used to trigger cleanup operations in other components or to synchronize shutdown sequencing.

Note
Not to be confused with QWidget::close() method; this is a custom signal specific to PTextEdit.

◆ currentCursorPosition

void PTextEdit::currentCursorPosition ( )
privateslot

Slot: Updates status bar with current cursor position.

Displays current line and column number in status bar as "Line: X, Col: Y".

SLOT: called when the cursor position has changed. Updates the status bar with the current cursor position.

Definition at line 3403 of file PTextEdit.cpp.

◆ currentEditor()

PSubTextEdit * PTextEdit::currentEditor ( ) const
private

Gets the currently active editor widget.

Returns a pointer to the PSubTextEdit widget in the currently visible tab. Returns nullptr if no tabs are open.

Returns
PSubTextEdit* Pointer to current editor, or nullptr if none.
See also
PSubTextEdit for the editor widget class

returns the currently tab selected textedit object.

Definition at line 1176 of file PTextEdit.cpp.

◆ doConnections()

void PTextEdit::doConnections ( PSubTextEdit * e)
private

Establishes signal-slot connections for an editor.

Connects the given editor widget's signals to appropriate slots in the main window for font changes, text changes, cursor position updates, and other editor events.

Parameters
ePointer to the PSubTextEdit widget to connect. Must not be nullptr.
See also
fontChanged(), textChanged(), currentCursorPosition() for connected slots

Setup the necessray signal/slot connections for the textedit object.

Parameters
etextedit object

Definition at line 1196 of file PTextEdit.cpp.

◆ editComment

void PTextEdit::editComment ( )
privateslot

Slot: Comments out selected lines.

Adds '#' character at the beginning of each selected line.

Comment a selection, i.e. add a '#' character in front of each line of the selection. (Multiple selections not yet supported).

Definition at line 2021 of file PTextEdit.cpp.

◆ editCopy

void PTextEdit::editCopy ( )
privateslot

Slot: Copy selected text to clipboard.

Copy the selection of the current textedit tab.

Definition at line 1843 of file PTextEdit.cpp.

◆ editCut

void PTextEdit::editCut ( )
privateslot

Slot: Cut selected text to clipboard.

Cut the selection of the current textedit tab.

Definition at line 1832 of file PTextEdit.cpp.

◆ editFind

void PTextEdit::editFind ( )
privateslot

Slot: Opens find dialog.

Displays PFindDialog for searching text in current editor.

See also
editFindNext(), editFindPrevious() for iterative search

Starts a find dialog, and searches for a find string.

Definition at line 1865 of file PTextEdit.cpp.

◆ editFindAndReplace

void PTextEdit::editFindAndReplace ( )
privateslot

Slot: Opens find and replace dialog.

Displays PReplaceDialog for searching and replacing text.

See also
replace(), replaceAll() for replacement operations

Starts a find/replace dialog, and searches for a find string and replaces it depending of the replace options.

Definition at line 1957 of file PTextEdit.cpp.

◆ editFindNext

void PTextEdit::editFindNext ( )
privateslot

Slot: Finds next occurrence of search text.

Uses settings from last find operation to search forward.

Searches for a find string in the forward direction.

Definition at line 1925 of file PTextEdit.cpp.

◆ editFindPrevious

void PTextEdit::editFindPrevious ( )
privateslot

Slot: Finds previous occurrence of search text.

Uses settings from last find operation to search backward.

Searches for a find string in the backward direction.

Definition at line 1940 of file PTextEdit.cpp.

◆ editPaste

void PTextEdit::editPaste ( )
privateslot

Slot: Paste text from clipboard at cursor position.

Paste at the cursor position of the current textedit tab.

Definition at line 1854 of file PTextEdit.cpp.

◆ editRedo

void PTextEdit::editRedo ( )
privateslot

Slot: Redo previously undone edit operation.

Text redo of the current textedit tab

Definition at line 1810 of file PTextEdit.cpp.

◆ editSelectAll

void PTextEdit::editSelectAll ( )
privateslot

Slot: Select all text in current editor.

Select all text of the current textedit tab.

Definition at line 1821 of file PTextEdit.cpp.

◆ editUncomment

void PTextEdit::editUncomment ( )
privateslot

Slot: Uncomments selected lines.

Removes leading '#' character from each selected line.

Uncomment a selection, i.e. remove a '#' character in front of each line of the selection. (Multiple selections not yet supported).

Definition at line 2056 of file PTextEdit.cpp.

◆ editUndo

void PTextEdit::editUndo ( )
privateslot

Slot: Undo last edit operation.

Text undo of the current textedit tab.

Definition at line 1799 of file PTextEdit.cpp.

◆ exitStatusMusrSetSteps

void PTextEdit::exitStatusMusrSetSteps ( int exitCode,
QProcess::ExitStatus exitStatus )
privateslot

Slot: Handles exit status of musrSetSteps process.

PTextEdit::existStatusMusrSetSteps.

Parameters
exitCodeProcess exit code (0 = success, non-zero = error).
exitStatusExit status (normal exit or crash).

Called when musrSetSteps process terminates. Checks for errors and displays appropriate messages.

Parameters
exitCode
exitStatus

Definition at line 3324 of file PTextEdit.cpp.

◆ exitStatusMusrWiz

void PTextEdit::exitStatusMusrWiz ( int exitCode,
QProcess::ExitStatus exitStatus )
privateslot

Slot: Handles exit status of musrWiz process.

PTextEdit::exitStatusMusrWiz.

Parameters
exitCodeProcess exit code (0 = success, non-zero = error).
exitStatusExit status (normal exit or crash).

Called when musrWiz process terminates. Checks for errors and displays appropriate messages.

Parameters
exitCode
exitStatus

Definition at line 3260 of file PTextEdit.cpp.

◆ fileAlreadyOpen()

bool PTextEdit::fileAlreadyOpen ( QFileInfo & finfo,
int & idx )
private

Checks if a file is already open in a tab.

PTextEdit::fileAlreadyOpen.

Searches through all open tabs to determine if the given file is already loaded. If found, returns the tab index.

Parameters
finfoQFileInfo object for the file to check.
idxOutput parameter set to tab index if file is open, -1 otherwise.
Returns
bool true if file is already open, false otherwise.
See also
load() for file loading mechanism
Parameters
finfo
idx
Returns

Definition at line 3714 of file PTextEdit.cpp.

◆ fileChanged

void PTextEdit::fileChanged ( const QString & fileName)
privateslot

Slot: Handles file system watcher notifications.

Parameters
fileNamePath to the file that changed on disk.

Called when an open file is modified externally. Prompts user to reload the file to see changes or keep current version.

Called when an open file is changing outside the editor (SLOT).

Parameters
fileNamefile name of the changed file.

Definition at line 3478 of file PTextEdit.cpp.

◆ fileClose

void PTextEdit::fileClose ( const bool check = true)
privateslot

Slot: Closes the current tab.

Parameters
checkIf true, prompts to save if file has been modified. If false, closes without checking for changes.

Closes the active tab and removes associated editor widget. If last tab is closed, creates a new empty tab.

Will remove a textedit tab from musredit. Depending on check it will done with or without checking if the file has been saved before.

Parameters
checkif set to true, a warning dialog will popup if the file is not saved yet.

Definition at line 1661 of file PTextEdit.cpp.

◆ fileCloseAll

void PTextEdit::fileCloseAll ( )
privateslot

Slot: Closes all open tabs.

Iterates through all tabs, prompting to save modified files, then closes all tabs. Creates one new empty tab afterward.

Removes all textedit tabs from musredit. It checks if the files haven't been saved, and if so it will popup a warning dialog.

Definition at line 1692 of file PTextEdit.cpp.

◆ fileCloseAllOthers

void PTextEdit::fileCloseAllOthers ( )
privateslot

Slot: Closes all tabs except the current one.

Prompts to save modified files, then closes all tabs except the currently active tab.

Will close all textedit tabs but the selected one. It checks if the files haven't been saved, and if so it will popup a warning dialog.

Definition at line 1729 of file PTextEdit.cpp.

◆ fileExit

void PTextEdit::fileExit ( )
privateslot

Slot: Exits the application.

Closes all tabs (prompting to save changes), then quits the application. Emits close() signal before exiting.

Will quit musredit.

Definition at line 1776 of file PTextEdit.cpp.

◆ fileNew

void PTextEdit::fileNew ( )
privateslot

Slot: Creates a new empty msr file in a new tab.

Creates a new tab with an empty PSubTextEdit widget ready for editing. The new file is initially untitled until saved.

SLOT: called when File/New is selected. Will generate an empty tab-textedit field in musredit.

Definition at line 1320 of file PTextEdit.cpp.

◆ fileOpen

void PTextEdit::fileOpen ( )
privateslot

Slot: Opens a file dialog to load an msr file.

Displays QFileDialog for file selection, then loads the chosen file via load(). Filters for .msr and .mlog files by default.

See also
load() for the actual file loading mechanism

SLOT: called when File/Open is selected. Will open an msr-/mlog-file. It checks if the file is already open, and if so will just select the current tab. If you want to reload the file use the fileReload() slot.

Definition at line 1338 of file PTextEdit.cpp.

◆ fileOpenPrefs

void PTextEdit::fileOpenPrefs ( )
privateslot

Slot: Opens the preferences file in a new tab.

Loads musredit_startup.xml into the editor for direct editing of application preferences.

See also
fileSavePrefs() to save preferences changes

Will save the currently selected file.

Definition at line 1449 of file PTextEdit.cpp.

◆ fileOpenRecent

void PTextEdit::fileOpenRecent ( )
privateslot

Slot: Opens a recently used file.

Identifies which recent file action was triggered and loads that file. Updates the recent files list.

See also
fillRecentFiles() for recent files management

This slot will open the file from the recent file list. If already open, it will reload it.

Definition at line 1384 of file PTextEdit.cpp.

◆ filePrint

void PTextEdit::filePrint ( )
privateslot

Slot: Prints the current file.

Displays QPrintDialog and prints the current editor content to the selected printer or PDF file.

Will call a print dialog and print the msr-file.

Definition at line 1586 of file PTextEdit.cpp.

◆ fileReload

void PTextEdit::fileReload ( )
privateslot

Slot: Reloads the current file from disk.

Discards any unsaved changes and reloads the current file. Prompts user to confirm if file has been modified.

Will reload the currently selected msr-file.

Definition at line 1433 of file PTextEdit.cpp.

◆ fileSave

void PTextEdit::fileSave ( )
privateslot

Slot: Saves the current file.

Saves the current editor content to disk. If file is untitled, prompts for a filename via fileSaveAs(). Temporarily disables file system watcher during save to prevent change notifications.

See also
fileSaveAs() for save with filename prompt

Will save the currently selected file.

Definition at line 1498 of file PTextEdit.cpp.

◆ fileSaveAs

void PTextEdit::fileSaveAs ( )
privateslot

Slot: Saves the current file with a new name.

Displays QFileDialog to choose save location and filename, then saves current editor content. Updates tab title and recent files list.

Will open a file selector dialog to obtain a file name, and then save the file under the newly selected file name.

Definition at line 1529 of file PTextEdit.cpp.

◆ fileSavePrefs

void PTextEdit::fileSavePrefs ( )
privateslot

Slot: Saves the preferences file.

If preferences file (musredit_startup.xml) is currently being edited, saves it. Otherwise displays a message.

Will save the current preferences.

Definition at line 1552 of file PTextEdit.cpp.

◆ fileSystemWatcherActivation()

void PTextEdit::fileSystemWatcherActivation ( )
private

Manages file system watcher activation state.

Enables or disables the file system watcher based on fFileSystemWatcherActive flag. Called after file operations to prevent spurious change notifications during saves.

See also
fileChanged() for handling file change notifications

Delayed reactivation of file system watcher, needed when saving files. At the moment the delay is set to 2000 ms.

Definition at line 3519 of file PTextEdit.cpp.

◆ fillRecentFiles()

void PTextEdit::fillRecentFiles ( )
private

Populates the Recent Files menu.

Reads recent file list from PAdmin configuration and creates menu actions for each recent file. Updates action visibility and text to show available recent files.

See also
fileOpenRecent() for opening selected recent files

fill the recent file list in the menu.

Definition at line 3615 of file PTextEdit.cpp.

◆ fontChanged

void PTextEdit::fontChanged ( const QFont & f)
privateslot

Slot: Responds to font changes in editor.

Parameters
fNew font that was applied to the editor.

Updates font combo boxes in toolbar to reflect current font.

SLOT: called when the font shall be changed.

Parameters
ffont object

Definition at line 3349 of file PTextEdit.cpp.

◆ getEditH()

int PTextEdit::getEditH ( )
inline

Gets the configured editor height.

Returns the default editor window height as configured in the musredit preferences. This value is loaded from musredit_startup.xml during initialization and represents the preferred window height in pixels.

Returns
int Editor height in pixels (default typically 800).
See also
getEditW() For editor width
PAdmin::getEditHeight() Source of the height value

Definition at line 330 of file PTextEdit.h.

◆ getEditW()

int PTextEdit::getEditW ( )
inline

Gets the configured editor width.

Returns the default editor window width as configured in the musredit preferences. This value is loaded from musredit_startup.xml during initialization and represents the preferred window width in pixels.

Returns
int Editor width in pixels (default typically 900).
See also
getEditH() For editor height
PAdmin::getEditWidth() Source of the width value

Definition at line 316 of file PTextEdit.h.

◆ getRunList()

QStringList PTextEdit::getRunList ( QString runListStr,
bool & ok )
private

Parses a run list string into individual run numbers.

Converts comma-separated or space-separated run numbers into a QStringList. Handles various input formats and validates that all entries are valid run numbers.

Parameters
runListStrString containing run numbers (e.g., "1234, 1235, 1236").
okOutput parameter set to true if parsing succeeded, false otherwise.
Returns
QStringList List of individual run number strings. Empty if parsing failed.

run list is split (space separated), expanded (start-end -> start, start+1, ..., end) or (start:end:step -> start, start+step, ..., end) to a list.

Parameters
runListStrlist to be split and expanded
oktrue if everything is fine; false if an error has been encountered
Returns
fully expanded run list

Definition at line 3633 of file PTextEdit.cpp.

◆ getTheme()

bool PTextEdit::getTheme ( )
private

Detects the current system theme.

PTextEdit::getTheme.

Attempts to detect whether the system is using a light or dark theme by examining palette colors. Sets fDarkMenuIcon and fDarkToolBarIcon flags accordingly for appropriate icon selection.

Returns
bool true if theme detection succeeded, false if detection failed (in which case defaults from preferences are used).
Note
Detection method may vary by platform and desktop environment.

Definition at line 3561 of file PTextEdit.cpp.

◆ helpAbout

void PTextEdit::helpAbout ( )
privateslot

Slot: Displays musredit About dialog.

Shows PMusrEditAbout dialog with version and copyright info.

See also
PMusrEditAbout for about dialog implementation

Starts the help about info box.

Definition at line 3238 of file PTextEdit.cpp.

◆ helpAboutQt

void PTextEdit::helpAboutQt ( )
privateslot

Slot: Displays Qt About dialog.

Shows QMessageBox::aboutQt() with Qt version information.

Starts the help about Qt info box.

Definition at line 3248 of file PTextEdit.cpp.

◆ helpContents

void PTextEdit::helpContents ( )
privateslot

Slot: Opens online documentation.

Launches web browser with musrfit/musredit documentation URL.

Starts the help content browser.

Definition at line 3225 of file PTextEdit.cpp.

◆ insertAsymRunBlock

void PTextEdit::insertAsymRunBlock ( )
privateslot

Slot: Inserts an asymmetry RUN block into the current editor.

Delegates to PSubTextEdit::insertAsymRunBlock().

See also
PSubTextEdit::insertAsymRunBlock()

Start the dialog to enter a msr-file asymmetry run block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-run-block

Definition at line 1257 of file PTextEdit.cpp.

◆ insertCommandBlock

void PTextEdit::insertCommandBlock ( )
privateslot

Slot: Inserts a COMMANDS block into the current editor.

Delegates to PSubTextEdit::insertCommandBlock().

See also
PSubTextEdit::insertCommandBlock()

Inserts a default command block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-commands-block

Definition at line 1284 of file PTextEdit.cpp.

◆ insertFourierBlock

void PTextEdit::insertFourierBlock ( )
privateslot

Slot: Inserts a FOURIER block into the current editor.

Delegates to PSubTextEdit::insertFourierBlock().

See also
PSubTextEdit::insertFourierBlock()

Start the dialog to enter a msr-file Fourier block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-fourier-block

Definition at line 1293 of file PTextEdit.cpp.

◆ insertFunctionBlock

void PTextEdit::insertFunctionBlock ( )
privateslot

Slot: Inserts a FUNCTIONS block into the current editor.

Delegates to PSubTextEdit::insertFunctionBlock().

See also
PSubTextEdit::insertFunctionBlock()

Start the dialog to enter a msr-file function block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-functions-block

Definition at line 1248 of file PTextEdit.cpp.

◆ insertNonMusrRunBlock

void PTextEdit::insertNonMusrRunBlock ( )
privateslot

Slot: Inserts a non-µSR RUN block into the current editor.

Delegates to PSubTextEdit::insertNonMusrRunBlock().

See also
PSubTextEdit::insertNonMusrRunBlock()

Start the dialog to enter a msr-file nonMusr run block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-run-block

Definition at line 1275 of file PTextEdit.cpp.

◆ insertParameterBlock

void PTextEdit::insertParameterBlock ( )
privateslot

Slot: Inserts a FITPARAMETER block into the current editor.

Delegates to PSubTextEdit::insertParameterBlock().

See also
PSubTextEdit::insertParameterBlock()

Start the dialog to enter a msr-file fit-parameter block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-fitparameter-block

Definition at line 1219 of file PTextEdit.cpp.

◆ insertPlotBlock

void PTextEdit::insertPlotBlock ( )
privateslot

Slot: Inserts a PLOT block into the current editor.

Delegates to PSubTextEdit::insertPlotBlock().

See also
PSubTextEdit::insertPlotBlock()

Start the dialog to enter a msr-file plot block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-plot-block

Definition at line 1302 of file PTextEdit.cpp.

◆ insertSingleHistRunBlock

void PTextEdit::insertSingleHistRunBlock ( )
privateslot

Slot: Inserts a single histogram RUN block into the current editor.

Delegates to PSubTextEdit::insertSingleHistRunBlock().

See also
PSubTextEdit::insertSingleHistRunBlock()

Start the dialog to enter a msr-file single histogram run block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-run-block

Definition at line 1266 of file PTextEdit.cpp.

◆ insertStatisticBlock

void PTextEdit::insertStatisticBlock ( )
privateslot

Slot: Inserts a STATISTIC block into the current editor.

Delegates to PSubTextEdit::insertStatisticBlock().

See also
PSubTextEdit::insertStatisticBlock()

Inserts a default statistics block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-statistic-block

Definition at line 1311 of file PTextEdit.cpp.

◆ insertTheoryBlock

void PTextEdit::insertTheoryBlock ( )
privateslot

Slot: Inserts a THEORY block into the current editor.

Delegates to PSubTextEdit::insertTheoryBlock().

See also
PSubTextEdit::insertTheoryBlock()

Start the dialog to enter a msr-file theory block. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block

Definition at line 1228 of file PTextEdit.cpp.

◆ insertTheoryFunction

void PTextEdit::insertTheoryFunction ( QAction * a)
privateslot

Slot: Inserts a specific theory function into the current editor.

Parameters
aQAction containing the theory function name.

Extracts theory function name from action and delegates to PSubTextEdit::insertTheoryFunction().

See also
PSubTextEdit::insertTheoryFunction()

Insert a selected theory function. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block

Parameters
aaction of the selected theory function

Definition at line 1239 of file PTextEdit.cpp.

◆ insertTitle

void PTextEdit::insertTitle ( )
privateslot

Slot: Inserts a title block into the current editor.

Delegates to PSubTextEdit::insertTitle().

See also
PSubTextEdit::insertTitle()

Start the dialog to enter a msr-file title. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-title

Definition at line 1210 of file PTextEdit.cpp.

◆ jumpToBlock

void PTextEdit::jumpToBlock ( int idx)
privateslot

Slot: Jumps cursor to selected msr file block.

Parameters
idxIndex of selected block in jump-to-block combo box.

Moves cursor to the beginning of the selected block (FITPARAMETER, THEORY, RUN, COMMANDS, etc.) for quick navigation.

slot called when jumpToBlock combobox is selected

Parameters
idx

Definition at line 3542 of file PTextEdit.cpp.

◆ load()

void PTextEdit::load ( const QString & f,
const int index = -1 )
private

Loads a file into the editor.

Opens and loads the specified file into a new tab or existing tab if already open. Handles file reading, error checking, and tab creation/switching. Updates recent files list and file system watcher.

Parameters
fAbsolute or relative path to the file to load.
indexOptional tab index where file should be loaded. If -1 (default), creates a new tab or switches to existing tab.
See also
fileOpen() for the user-facing file open dialog
fileAlreadyOpen() to check if file is already loaded

load a msr-file.

Parameters
ffilename
indexif == -1, add the file as a new tab, otherwise, replace the contents of the tab at index.

Definition at line 1130 of file PTextEdit.cpp.

◆ mupp

void PTextEdit::mupp ( )
privateslot

Slot: Launches mupp (muon parameter plot).

PTextEdit::mupp.

Spawns mupp tool for plotting parameter evolution across multiple msr files.

Calls mupp, the muSR parameter plotter.

Definition at line 3185 of file PTextEdit.cpp.

◆ musrCalcChisq

void PTextEdit::musrCalcChisq ( )
privateslot

Slot: Calculates chi-square for current msr file.

Runs musrfit with chi-square calculation mode.

calls musrfit –chisq-only <msr-file>.

Definition at line 2186 of file PTextEdit.cpp.

◆ musrDump

void PTextEdit::musrDump ( )
privateslot

Slot: Dumps raw histogram data from run files.

Displays dialog to select run file and dump raw data in various formats for inspection or external analysis.

Dumps the run header information of a selected muSR data file.

Definition at line 3161 of file PTextEdit.cpp.

◆ musrFit

void PTextEdit::musrFit ( )
privateslot

Slot: Executes fit with current msr file.

Saves current file, runs musrfit fitting engine, captures output, and optionally launches musrView for visualization.

calls musrfit <options> <msr-file>. <options> can be set in the MusrFit/Preferences.

Definition at line 2225 of file PTextEdit.cpp.

◆ musrFT

void PTextEdit::musrFT ( )
privateslot

Slot: Opens Fourier transform dialog.

Displays PGetMusrFTOptionsDialog for configuring and performing Fourier transforms on µSR data.

Calls musrFT via selection/option dialog. It will ask the user if he/she wants to overwrite some of the default settings.

Definition at line 2891 of file PTextEdit.cpp.

◆ musrMsr2Data

void PTextEdit::musrMsr2Data ( )
privateslot

Slot: Opens msr2data conversion dialog.

Displays PMsr2DataDialog for batch conversion of msr files to various data formats.

See also
PMsr2DataDialog for conversion options

Starts a msr2data input dialog which collects all the necessary data before calling msr2data.

Definition at line 2345 of file PTextEdit.cpp.

◆ musrPrefs

void PTextEdit::musrPrefs ( )
privateslot

Slot: Opens preferences dialog.

Displays PPrefsDialog for configuring application settings like default paths, font, editor dimensions, theme icons.

See also
PPrefsDialog for available preferences

Calls the preferences dialog which is used to set some global options.

Definition at line 2934 of file PTextEdit.cpp.

◆ musrSetSteps

void PTextEdit::musrSetSteps ( )
privateslot

Slot: Launches musrStep for setting fit step sizes.

PTextEdit::musrSetSteps.

Spawns musrStep tool to configure MINUIT step sizes for parameters based on parameter statistics.

Definition at line 2989 of file PTextEdit.cpp.

◆ musrSwapMsrMlog

void PTextEdit::musrSwapMsrMlog ( )
privateslot

Slot: Swaps between .msr and .mlog files.

If current file is .msr, switches to corresponding .mlog file (fit log). If .mlog, switches to .msr file.

Swaps the currently open msr-file with its mlog-file (if present) and updates musredit accordingly.

Definition at line 3053 of file PTextEdit.cpp.

◆ musrT0

void PTextEdit::musrT0 ( )
privateslot

Slot: Opens musrT0 dialog for determining t0 timing parameter.

Launches tool to determine t0 (time zero) from raw data.

Calls musrt0 <msr-file>.

Definition at line 2831 of file PTextEdit.cpp.

◆ musrView

void PTextEdit::musrView ( )
privateslot

Slot: Launches musrView for viewing fit results.

Spawns musrview to visualize data and fit from current msr file.

Calls musrview <msr-file>.

Definition at line 2691 of file PTextEdit.cpp.

◆ musrView2Dat

void PTextEdit::musrView2Dat ( )
privateslot

Slot: Launches musrView in 2-data file mode.

Spawns musrview to compare two data files side-by-side.

Exports the view data of a collection of msr-files to a dat-file.

Definition at line 2767 of file PTextEdit.cpp.

◆ musrWiz

void PTextEdit::musrWiz ( )
privateslot

Slot: Launches musrWiz (msr file creation wizard).

PTextEdit::musrWiz.

Spawns musrWiz as external process for interactive msr file creation with step-by-step guidance.

Definition at line 2144 of file PTextEdit.cpp.

◆ replace

void PTextEdit::replace ( )
privateslot

Slot: Replaces current match and finds next occurrence.

Performs replacement at current cursor position, then searches for next match. Used in interactive replace mode.

SLOT: handles the replaced command.

Definition at line 3419 of file PTextEdit.cpp.

◆ replaceAll

void PTextEdit::replaceAll ( )
privateslot

Slot: Replaces all occurrences without prompting.

Iterates through document replacing all matches of search pattern with replacement text. Used in batch replace mode.

SLOT: handles the replace all command.

Definition at line 3441 of file PTextEdit.cpp.

◆ replaceAndClose

void PTextEdit::replaceAndClose ( )
privateslot

Slot: Replaces current match and closes replace dialog.

Performs replacement at current cursor position, then closes the find/replace dialog.

SLOT: handles the repalce and close command.

Definition at line 3430 of file PTextEdit.cpp.

◆ setFileSystemWatcherActive

void PTextEdit::setFileSystemWatcherActive ( )
privateslot

Slot: Re-enables file system watcher after delay.

Connected to timer that fires after save operations complete, re-enabling change detection for open files.

See also
fileSystemWatcherActivation() for activation management

slot needed to reactivate the file system watcher. It is called by PTextEdit::fileSystemWatcherActivation() after some given timeout.

Definition at line 3532 of file PTextEdit.cpp.

◆ setupEditActions()

void PTextEdit::setupEditActions ( )
private

Initializes Edit menu and toolbar actions.

Initializes the Edit menu and toolbar.

Creates and configures all Edit menu items and corresponding toolbar buttons including Undo, Redo, Select All, Copy, Cut, Paste, Find, Find Next, Find Previous, Replace, Comment, and Uncomment.

See also
editUndo(), editCopy(), editFind(), etc. for slot implementations

Creates and configures all Edit menu items and corresponding toolbar buttons including Undo, Redo, Select All, Copy, Cut, Paste, Find, Find Next, Find Previous, Replace, Comment, and Uncomment. Each action includes icons (theme-aware), shortcuts, and connections.

Definition at line 459 of file PTextEdit.cpp.

◆ setupFileActions()

void PTextEdit::setupFileActions ( )
private

Initializes File menu and toolbar actions.

Initializes the File menu and toolbar.

Creates and configures all File menu items and corresponding toolbar buttons including New, Open, Recent Files, Reload, Save, Print, Close, and Exit. Sets up keyboard shortcuts, status tips, icons (with theme-appropriate variants), and signal-slot connections.

See also
fileNew(), fileOpen(), fileSave(), etc. for slot implementations

Creates and configures all File menu items and corresponding toolbar buttons. Each action includes:

  • Icon (with theme-appropriate variant)
  • Keyboard shortcut
  • Status bar tip
  • Signal-slot connection

Menu Items Created: New, Open, Recent Files, Reload, Open Prefs, Save, Save As, Save Prefs, Print, Close, Close All, Close All Others, Exit

Theme Support: Icons are loaded in dark and plain variants. Menu and toolbar may use different variants based on system theme detection and user preferences.

Definition at line 277 of file PTextEdit.cpp.

◆ setupHelpActions()

void PTextEdit::setupHelpActions ( )
private

Initializes Help menu actions.

Initializes the Help menu.

Creates Help menu with Contents (online documentation), About Qt, and About musredit items.

See also
helpContents(), helpAbout() for slot implementations

Creates the Help menu with actions for accessing online documentation (Contents), displaying Qt version information (About Qt), and showing the musredit About dialog with version and copyright info.

Definition at line 1076 of file PTextEdit.cpp.

◆ setupJumpToBlock()

void PTextEdit::setupJumpToBlock ( )
private

Initializes the Jump to Block combo box.

Creates a combo box in the toolbar that lists all msr file blocks (FITPARAMETER, THEORY, RUN, COMMANDS, etc.), allowing quick navigation to any block by selecting it from the dropdown.

See also
jumpToBlock() for the navigation slot implementation

Setup the JumpToBlock actions.

Definition at line 1102 of file PTextEdit.cpp.

◆ setupMusrActions()

void PTextEdit::setupMusrActions ( )
private

Initializes Musr menu and toolbar actions.

Initializes the Musr menu and toolbar.

Creates and configures all µSR-specific menu items including musrWiz, musrFit, msr2data, musrView, musrT0, musrFT, and all block insertion commands. Sets up icons, shortcuts, and connections to analysis tools.

See also
musrFit(), musrView(), insertTheoryBlock(), etc. for implementations

Creates and configures all µSR-specific menu items including analysis tools (musrFit, musrView, msr2data, musrT0, musrFT, musrCalcChisq, musrStep, musrDump, mupp), utility functions (musrWiz, musrSwapMsrMlog), and all block insertion commands (Title, FITPARAMETER, THEORY, FUNCTIONS, RUN blocks, COMMANDS, FOURIER, PLOT, STATISTIC). Includes theory function submenu with all available theory functions.

Definition at line 790 of file PTextEdit.cpp.

◆ setupTextActions()

void PTextEdit::setupTextActions ( )
private

Initializes Text menu and toolbar actions.

Initializes the Text menu and font toolbar controls.

Creates font family and font size combo boxes in the toolbar, allowing users to change text formatting for the current editor.

See also
textFamily(), textSize() for slot implementations

Creates the Text menu and adds font family and font size combo boxes to the toolbar. Users can select from available system fonts and standard font sizes to customize the editor appearance.

Definition at line 745 of file PTextEdit.cpp.

◆ switchMenuIcons()

void PTextEdit::switchMenuIcons ( )
private

Switches menu icons between dark and plain variants.

Updates all menu action icons to use either dark-themed or plain icons based on fDarkMenuIcon flag. Called when theme changes or preferences are updated.

See also
getTheme() for theme detection

Switch menu icons according to the fAdmin settings

Definition at line 3737 of file PTextEdit.cpp.

◆ switchToolbarIcons()

void PTextEdit::switchToolbarIcons ( )
private

Switches toolbar icons between dark and plain variants.

Updates all toolbar action icons to use either dark-themed or plain icons based on fDarkToolBarIcon flag. Called when theme changes or preferences are updated.

See also
getTheme() for theme detection

Switch toolbar icons according to the fAdmin settings

Definition at line 3800 of file PTextEdit.cpp.

◆ textChanged

void PTextEdit::textChanged ( const bool forced = false)
privateslot

Slot: Responds to text changes in editor.

Parameters
forcedIf true, forces update even if fFontChanging is true.

Updates window title to show modified state, refreshes jump-to-block combo box to reflect current msr file structure.

SLOT: called when the text of the document has changed. It adds a star to the tab label if the document has been modified.

Parameters
forced

Definition at line 3371 of file PTextEdit.cpp.

◆ textFamily

void PTextEdit::textFamily ( const QString & f)
privateslot

Slot: Changes font family for current editor.

Parameters
fFont family name (e.g., "Courier", "Monospace").

Changes the font.

Parameters
ffont name

Definition at line 2112 of file PTextEdit.cpp.

◆ textSize

void PTextEdit::textSize ( const QString & p)
privateslot

Slot: Changes font size for current editor.

Parameters
pFont size as string (e.g., "10", "12", "14").

Changes the font size.

Parameters
pfont size in points.

Definition at line 2129 of file PTextEdit.cpp.

Member Data Documentation

◆ fActions

QMap<QString, QAction*> PTextEdit::fActions
private

Definition at line 966 of file PTextEdit.h.

◆ fAdmin

std::unique_ptr<PAdmin> PTextEdit::fAdmin
private

pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc.

Definition at line 957 of file PTextEdit.h.

◆ fComboFont

std::unique_ptr<QComboBox> PTextEdit::fComboFont
private

combo box for the font selector

Definition at line 972 of file PTextEdit.h.

◆ fComboSize

std::unique_ptr<QComboBox> PTextEdit::fComboSize
private

combo box for the font size

Definition at line 973 of file PTextEdit.h.

◆ fDarkMenuIcon

bool PTextEdit::fDarkMenuIcon {false}
private

flag indicating if a dark or plain icon shall be used in the menu pull-downs

Definition at line 955 of file PTextEdit.h.

◆ fDarkToolBarIcon

bool PTextEdit::fDarkToolBarIcon {false}
private

flag indicating if a dark or plain icon shall be used in the toolbar

Definition at line 956 of file PTextEdit.h.

◆ fEditH

int PTextEdit::fEditH {800}
private

Definition at line 963 of file PTextEdit.h.

◆ fEditW

int PTextEdit::fEditW {900}
private

Definition at line 963 of file PTextEdit.h.

◆ fFilenames

QMap<PSubTextEdit*, QString> PTextEdit::fFilenames
private

mapper between tab widget object and filename

Definition at line 978 of file PTextEdit.h.

◆ fFileSystemWatcher

std::unique_ptr<QFileSystemWatcher> PTextEdit::fFileSystemWatcher
private

checks if msr-files are changing on the disk while being open in musredit.

Definition at line 958 of file PTextEdit.h.

◆ fFileSystemWatcherActive

bool PTextEdit::fFileSystemWatcherActive
private

flag to enable/disable the file system watcher

Definition at line 959 of file PTextEdit.h.

◆ fFileSystemWatcherTimeout

QTimer PTextEdit::fFileSystemWatcherTimeout
private

timer used to re-enable file system watcher. Needed to delay the re-enabling

Definition at line 960 of file PTextEdit.h.

◆ fFindReplaceData

PFindReplaceData* PTextEdit::fFindReplaceData
private

structure holding the ncessary input for find/replace

Definition at line 970 of file PTextEdit.h.

◆ fFontChanging

bool PTextEdit::fFontChanging {false}
private

flag needed to prevent some textChanged feature to occure when only the font changed

Definition at line 974 of file PTextEdit.h.

◆ fJumpToBlock

std::unique_ptr<QComboBox> PTextEdit::fJumpToBlock
private

combo box used to jump to the msr-file blocks

Definition at line 975 of file PTextEdit.h.

◆ fLastDirInUse

QString PTextEdit::fLastDirInUse {QString("")}
private

string holding the path from where the last file was loaded.

Definition at line 961 of file PTextEdit.h.

◆ fMsr2DataParam

PMsr2DataParam* PTextEdit::fMsr2DataParam
private

structure holding the necessary input information for msr2data

Definition at line 969 of file PTextEdit.h.

◆ fMusrFTPrevCmd

QStringList PTextEdit::fMusrFTPrevCmd
private

Definition at line 962 of file PTextEdit.h.

◆ fMusrT0Action

std::unique_ptr<QAction> PTextEdit::fMusrT0Action
private

Definition at line 967 of file PTextEdit.h.

◆ fRecentFilesAction

QAction* PTextEdit::fRecentFilesAction[MAX_RECENT_FILES]
private

array of the recent file actions

Definition at line 981 of file PTextEdit.h.

◆ fRecentFilesMenu

QMenu* PTextEdit::fRecentFilesMenu
private

recent file menu

Definition at line 980 of file PTextEdit.h.

◆ fStatusBar

QStatusBar* PTextEdit::fStatusBar {nullptr}
private

Definition at line 964 of file PTextEdit.h.

◆ fTabWidget

std::unique_ptr<QTabWidget> PTextEdit::fTabWidget
private

tab widget in which the text editor(s) are placed

Definition at line 977 of file PTextEdit.h.


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