|
musredit 1.0.0
|
Main window class for the musredit application. More...
#include <PTextEdit.h>


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. | |
| PSubTextEdit * | currentEditor () 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< PAdmin > | fAdmin |
| 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 |
| PMsr2DataParam * | fMsr2DataParam |
| structure holding the necessary input information for msr2data | |
| PFindReplaceData * | fFindReplaceData |
| 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 | |
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.
Edit Menu:
Text Menu:
Musr Menu:
Help Menu:
Definition at line 237 of file PTextEdit.h.
| 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:
Theme Detection: The constructor attempts to detect the system theme automatically:
File System Watcher: Monitors open files for external changes:
Command-Line File Loading: If arguments are provided:
Each file is loaded into a separate tab.
| parent | Pointer to parent widget. Typically nullptr for the main window. If provided, establishes parent-child relationship for proper memory management and event propagation. |
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.
| parent | Pointer to parent widget (typically nullptr for main window). |
Definition at line 156 of file PTextEdit.cpp.
|
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:
Both pointers are safely checked for nullptr before deletion and set to nullptr after freeing to prevent double deletion.
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.
Definition at line 246 of file PTextEdit.cpp.
|
privateslot |
Slot: Applies font settings when tab changes.
| Unused | tab 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.
|
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.
|
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.
|
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 the currently tab selected textedit object.
Definition at line 1176 of file PTextEdit.cpp.
|
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.
| e | Pointer to the PSubTextEdit widget to connect. Must not be nullptr. |
Setup the necessray signal/slot connections for the textedit object.
| e | textedit object |
Definition at line 1196 of file PTextEdit.cpp.
|
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.
|
privateslot |
Slot: Copy selected text to clipboard.
Copy the selection of the current textedit tab.
Definition at line 1843 of file PTextEdit.cpp.
|
privateslot |
Slot: Cut selected text to clipboard.
Cut the selection of the current textedit tab.
Definition at line 1832 of file PTextEdit.cpp.
|
privateslot |
Slot: Opens find dialog.
Displays PFindDialog for searching text in current editor.
Starts a find dialog, and searches for a find string.
Definition at line 1865 of file PTextEdit.cpp.
|
privateslot |
Slot: Opens find and replace dialog.
Displays PReplaceDialog for searching and replacing text.
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.
|
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.
|
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.
|
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.
|
privateslot |
Slot: Redo previously undone edit operation.
Text redo of the current textedit tab
Definition at line 1810 of file PTextEdit.cpp.
|
privateslot |
Slot: Select all text in current editor.
Select all text of the current textedit tab.
Definition at line 1821 of file PTextEdit.cpp.
|
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.
|
privateslot |
Slot: Undo last edit operation.
Text undo of the current textedit tab.
Definition at line 1799 of file PTextEdit.cpp.
|
privateslot |
Slot: Handles exit status of musrSetSteps process.
PTextEdit::existStatusMusrSetSteps.
| exitCode | Process exit code (0 = success, non-zero = error). |
| exitStatus | Exit status (normal exit or crash). |
Called when musrSetSteps process terminates. Checks for errors and displays appropriate messages.
| exitCode | |
| exitStatus |
Definition at line 3324 of file PTextEdit.cpp.
|
privateslot |
Slot: Handles exit status of musrWiz process.
| exitCode | Process exit code (0 = success, non-zero = error). |
| exitStatus | Exit status (normal exit or crash). |
Called when musrWiz process terminates. Checks for errors and displays appropriate messages.
| exitCode | |
| exitStatus |
Definition at line 3260 of file PTextEdit.cpp.
|
private |
Checks if a file is already open in a tab.
Searches through all open tabs to determine if the given file is already loaded. If found, returns the tab index.
| finfo | QFileInfo object for the file to check. |
| idx | Output parameter set to tab index if file is open, -1 otherwise. |
| finfo | |
| idx |
Definition at line 3714 of file PTextEdit.cpp.
|
privateslot |
Slot: Handles file system watcher notifications.
| fileName | Path 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).
| fileName | file name of the changed file. |
Definition at line 3478 of file PTextEdit.cpp.
|
privateslot |
Slot: Closes the current tab.
| check | If 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.
| check | if set to true, a warning dialog will popup if the file is not saved yet. |
Definition at line 1661 of file PTextEdit.cpp.
|
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.
|
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.
|
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.
|
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.
|
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.
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.
|
privateslot |
Slot: Opens the preferences file in a new tab.
Loads musredit_startup.xml into the editor for direct editing of application preferences.
Will save the currently selected file.
Definition at line 1449 of file PTextEdit.cpp.
|
privateslot |
Slot: Opens a recently used file.
Identifies which recent file action was triggered and loads that file. Updates the recent files list.
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.
|
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.
|
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.
|
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.
Will save the currently selected file.
Definition at line 1498 of file PTextEdit.cpp.
|
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.
|
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.
|
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.
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.
|
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.
fill the recent file list in the menu.
Definition at line 3615 of file PTextEdit.cpp.
|
privateslot |
Slot: Responds to font changes in editor.
| f | New 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.
| f | font object |
Definition at line 3349 of file PTextEdit.cpp.
|
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.
Definition at line 330 of file PTextEdit.h.
|
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.
Definition at line 316 of file PTextEdit.h.
|
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.
| runListStr | String containing run numbers (e.g., "1234, 1235, 1236"). |
| ok | Output parameter set to true if parsing succeeded, false otherwise. |
run list is split (space separated), expanded (start-end -> start, start+1, ..., end) or (start:end:step -> start, start+step, ..., end) to a list.
| runListStr | list to be split and expanded |
| ok | true if everything is fine; false if an error has been encountered |
Definition at line 3633 of file PTextEdit.cpp.
|
private |
Detects the current system theme.
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.
Definition at line 3561 of file PTextEdit.cpp.
|
privateslot |
Slot: Displays musredit About dialog.
Shows PMusrEditAbout dialog with version and copyright info.
Starts the help about info box.
Definition at line 3238 of file PTextEdit.cpp.
|
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.
|
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.
|
privateslot |
Slot: Inserts an asymmetry RUN block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a COMMANDS block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a FOURIER block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a FUNCTIONS block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a non-µSR RUN block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a FITPARAMETER block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a PLOT block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a single histogram RUN block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a STATISTIC block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a THEORY block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Inserts a specific theory function into the current editor.
| a | QAction containing the theory function name. |
Extracts theory function name from action and delegates to PSubTextEdit::insertTheoryFunction().
Insert a selected theory function. See also http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block
| a | action of the selected theory function |
Definition at line 1239 of file PTextEdit.cpp.
|
privateslot |
Slot: Inserts a title block into the current editor.
Delegates to 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.
|
privateslot |
Slot: Jumps cursor to selected msr file block.
| idx | Index 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
| idx |
Definition at line 3542 of file PTextEdit.cpp.
|
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.
| f | Absolute or relative path to the file to load. |
| index | Optional tab index where file should be loaded. If -1 (default), creates a new tab or switches to existing tab. |
load a msr-file.
| f | filename |
| index | if == -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.
|
privateslot |
Slot: Launches mupp (muon parameter plot).
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.
|
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.
|
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.
|
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.
|
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.
|
privateslot |
Slot: Opens msr2data conversion dialog.
Displays PMsr2DataDialog for batch conversion of msr files to various data formats.
Starts a msr2data input dialog which collects all the necessary data before calling msr2data.
Definition at line 2345 of file PTextEdit.cpp.
|
privateslot |
Slot: Opens preferences dialog.
Displays PPrefsDialog for configuring application settings like default paths, font, editor dimensions, theme icons.
Calls the preferences dialog which is used to set some global options.
Definition at line 2934 of file PTextEdit.cpp.
|
privateslot |
Slot: Launches musrStep for setting fit step sizes.
Spawns musrStep tool to configure MINUIT step sizes for parameters based on parameter statistics.
Definition at line 2989 of file PTextEdit.cpp.
|
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.
|
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.
|
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.
|
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.
|
privateslot |
Slot: Launches musrWiz (msr file creation wizard).
Spawns musrWiz as external process for interactive msr file creation with step-by-step guidance.
Definition at line 2144 of file PTextEdit.cpp.
|
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.
|
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.
|
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.
|
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.
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.
|
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.
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.
|
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.
Creates and configures all File menu items and corresponding toolbar buttons. Each action includes:
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.
|
private |
Initializes Help menu actions.
Initializes the Help menu.
Creates Help menu with Contents (online documentation), About Qt, and About musredit items.
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.
|
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.
Setup the JumpToBlock actions.
Definition at line 1102 of file PTextEdit.cpp.
|
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.
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.
|
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.
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.
|
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.
Switch menu icons according to the fAdmin settings
Definition at line 3737 of file PTextEdit.cpp.
|
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.
Switch toolbar icons according to the fAdmin settings
Definition at line 3800 of file PTextEdit.cpp.
|
privateslot |
Slot: Responds to text changes in editor.
| forced | If 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.
| forced |
Definition at line 3371 of file PTextEdit.cpp.
|
privateslot |
Slot: Changes font family for current editor.
| f | Font family name (e.g., "Courier", "Monospace"). |
Changes the font.
| f | font name |
Definition at line 2112 of file PTextEdit.cpp.
|
privateslot |
Slot: Changes font size for current editor.
| p | Font size as string (e.g., "10", "12", "14"). |
Changes the font size.
| p | font size in points. |
Definition at line 2129 of file PTextEdit.cpp.
|
private |
Definition at line 966 of file PTextEdit.h.
|
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.
|
private |
combo box for the font selector
Definition at line 972 of file PTextEdit.h.
|
private |
combo box for the font size
Definition at line 973 of file PTextEdit.h.
|
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.
|
private |
flag indicating if a dark or plain icon shall be used in the toolbar
Definition at line 956 of file PTextEdit.h.
|
private |
Definition at line 963 of file PTextEdit.h.
|
private |
Definition at line 963 of file PTextEdit.h.
|
private |
mapper between tab widget object and filename
Definition at line 978 of file PTextEdit.h.
|
private |
checks if msr-files are changing on the disk while being open in musredit.
Definition at line 958 of file PTextEdit.h.
|
private |
flag to enable/disable the file system watcher
Definition at line 959 of file PTextEdit.h.
|
private |
timer used to re-enable file system watcher. Needed to delay the re-enabling
Definition at line 960 of file PTextEdit.h.
|
private |
structure holding the ncessary input for find/replace
Definition at line 970 of file PTextEdit.h.
|
private |
flag needed to prevent some textChanged feature to occure when only the font changed
Definition at line 974 of file PTextEdit.h.
|
private |
combo box used to jump to the msr-file blocks
Definition at line 975 of file PTextEdit.h.
|
private |
string holding the path from where the last file was loaded.
Definition at line 961 of file PTextEdit.h.
|
private |
structure holding the necessary input information for msr2data
Definition at line 969 of file PTextEdit.h.
|
private |
Definition at line 962 of file PTextEdit.h.
|
private |
Definition at line 967 of file PTextEdit.h.
|
private |
array of the recent file actions
Definition at line 981 of file PTextEdit.h.
|
private |
recent file menu
Definition at line 980 of file PTextEdit.h.
|
private |
Definition at line 964 of file PTextEdit.h.
|
private |
tab widget in which the text editor(s) are placed
Definition at line 977 of file PTextEdit.h.