Fix #123: add drag-and-drop support to file name fields, plus related small fixes#2552
Open
dcwhite wants to merge 8 commits into
Open
Fix #123: add drag-and-drop support to file name fields, plus related small fixes#2552dcwhite wants to merge 8 commits into
dcwhite wants to merge 8 commits into
Conversation
… Matlab dialogs Adds FileNameLineEdit, a QLineEdit subclass that accepts file URL drops and emits editingFinished, then promotes all 14 fileNameLineEdit_ widgets in the DataIO and Matlab module UI files to use it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduce LogColorPriority and an atomic currentLogPriority_ to ensure log button color only escalates to higher-priority states. setLogButtonColor now computes an incoming priority and uses compare_exchange_weak to update the atomic only if the incoming priority is strictly greater (prevents a remark from overriding an existing error color; fixes #103). Reset currentLogPriority_ to None in resetLogButtonColor and when starting executeWithSignals. Initialize member in the header.
Qt's uic tool cannot qualify custom widget names — it always generates unqualified construction (new FileNameLineEdit(parent)). The <namespace> element in .ui custom widget blocks is a Qt Designer runtime (QUiLoader) feature only; uic rejects it even in Qt 6.10. Custom widgets used in .ui files must live in the global namespace. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…odule filter Qt's QLineEdit::setClearButtonEnabled(true) provides a dynamic × button that appears inside the widget only when text is present — exactly the Firefox-style behaviour requested. The separate clearFilterButton_ widget and its .ui connection are removed; no C++ changes needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces shared_ptr<spire::VarBuffer>(new spire::VarBuffer(...)) with make_shared<spire::VarBuffer>(...) in all six call sites, combining the object and control-block allocations into one. The full unique_ptr migration described in #560 requires a larger refactor; see issue comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: every formatting operation called setPlainText(toPlainText()), which discards all HTML (including color spans) and re-sets the document with only the current single character format. Replace every occurrence with QTextCursor::select(Document) + mergeCharFormat so font-size and color changes are applied to all text without destroying each other. Also sync currentColor_/previousColor_ from loaded HTML in setNoteHtml so that Reset Color and Cancel operate on the actual loaded color rather than always reverting to Qt::white. Add colorBackup_ so Cancel fully restores color tracking state alongside HTML and font-size index. Fix changeTextAlignment to use mergeBlockFormat on all blocks instead of the same broken setPlainText pattern (resolves the "one line at a time" TODO as a side effect). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Effective Modern C++ Item 42: convert push_back(T(args)) to emplace_back(args) and map.insert(make_pair(k,v)) to map.emplace(k,v) where the element is always constructed in-place from forwarded arguments. Targets: SpireVBO::AttributeData and SpireSubPass::Uniform vectors in the visualization/rendering pipeline (GlyphConstructor, ShowField, ShowColorMapModule, ShowString, TextBuilder), Variable push_back in ElectrodeCoilSetupDialog, and std::map/std::set insert(make_pair) calls in SRInterface, ReorderNormalCoherentlyAlgo, and BuildPointCloudToLatVolMappingMatrix. Note: reverted boost::bimap left-view — it predates std::map's emplace and does not expose that API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make_sharedfor VarBuffer allocationsemplaceover insertion where appropriate (Convert insertion calls to emplacement calls when it makes sense #1384)Test plan
🤖 Generated with Claude Code