Using Qt, C++ on Windows, Ctrl-C copies a selection of text that includes the title, message, and so forth from a QMessageBox. I have added some additional fields and would like to add some custom text to the information copied from the standard QMessageBox from these fields. What do I override in QMessageBox to allow me to grab the text that is already being created and add my own text to it?
In QMessageBox, how do I add to the text copied by Ctrl-C?
1.2k Views Asked by Mike At
2
There are 2 best solutions below
2
fbucek
On
You can set all QMessageBox text selectable by mouse like this:
QMessageBox mb;
mb.setTextInteractionFlags(Qt::TextSelectableByMouse);
QMessageBox::setTextInteractionFlags(Qt::TextInteractionFlags flags);
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in QT
- qt c++ fonction converting adress to coordinates (longitude, latitude)
- Qml table and chart using python
- Qt: running callback in the main thread from the worker thread
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Frameless Qt + WinAPI maximized window size is bigger than the availableGeometry()
- new window with c++ qt
- How to get scaling from transformation matrix
- How to build just Qt core libraries from Qt sources
- doxyqml not documenting qml files properly
- Incorrect assignment from a QStringList to a char * array
- How to make QT Chart size larger than widget size?
- Queued async operations with QtConcurrent interfere QImage from freed
- Questions about qt5 dynamic link library
- how to document QML files inside C++ project?
- How do I keep my screen contents centered and also have a scrollbar in QT?
Related Questions in QMESSAGEBOX
- Close QMessageBox after timer's timeout. If mouse events are detected, timer has to be reset
- Why can't I change the window icon on a QMessageBox with setIcon in PySide6?
- When i launch a pyqt6 qmessagebox from a function called by a watchdog event my program crashes
- How to check if user pressed the cross in top right corner in QMessageBox?
- Cannot make a loop of opening dialog boxes in Qt
- Pyqt Qmessagebox died in the while loop
- How to change QMessagebox button and background color?
- QMessageBox keeps terminating
- QMessage in a function thread?
- How to dim background when using qmessagebox?
- PyQt5 Abnormal exit when running QMessageBox
- QMessageBox black out
- Hiding PyQt main window affects behaviour of child dialog
- QT QMessageBox control linebreak
- How to translate standard buttons in Qt?
Related Questions in CLIPBOARD-INTERACTION
- How to lock access to the clipboard programmatically?
- copy to android system clipboard in nvim from termux
- Chrome Extension (v3) - Unable to read Clipboard in popup.js
- How to convert old C++ Clipboard procedures?
- Copy & Paste the Selected text from the PDF File using AXAcroPDF in VB.NET
- Copy to clipboard on empty selection in the Jupyter notebook
- Incomplete paste in a file (using cat) when copy selection from terminal
- Browser `paste` event with multiple files selection
- Call a clipboard access prompt in IE 11 with JS after user has refused it
- Event listener 'Copy' doesn't work with "Copy Link Address"
- Outlook calendar item clipboard format documentation?
- How to copy text, which is in a for-each loop, to clipboard when span is clicked?
- What is the equivalent code for navigator.clipboard.readText() in angular
- Java - Listen for copy and paste from clipboard
- Clipboard managers pasting in F# Interactive
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You need to reimplement
QMessageBoxand all functions you want to use. Here is minimal example:custommessagebox.h
custommessagebox.cpp
Usage:
Also You might need to override
question(),warning(),critical()and some other functions.