Module bitcoin_qt::gui_util
source · Expand description
| Utility functions used by the Bitcoin | Qt UI. |
Structs
- | Qt event filter that intercepts QEvent::FocusOut | events for QLabel objects, and resets | their `textInteractionFlags’ property | to get rid of the visible cursor. | | This is a temporary fix of QTBUG-59514. |
- | Qt event filter that intercepts ToolTipChange | events, and replaces the tooltip with | a rich text representation if needed. | This assures that Qt can word-wrap long | tooltip messages. | | Tooltips longer than the provided size | threshold (in characters) are wrapped. |
Constants
- | Use this flags to prevent a “What’s This” | button in the title bar of the dialog | on | | Windows. |
- | Just some dummy data to generate a convincing | random-looking (but consistent) address |
Functions
- | Connects an additional shortcut to | a QAbstractButton. Works around the | one shortcut limitation of the button’s | shortcut property. | | ———– | @param[in] button | | QAbstractButton to assign shortcut | to | ––––– | @param[in] shortcut | | QKeySequence to use as shortcut |
- | Get connection type to call object slot | in GUI thread with invokeMethod. The | call will be blocking. | | ———– | @return | | If called from the GUI thread, return | a QtDirectConnection. | | If called from another thread, return | a QtBlockingQueuedConnection. |
- | Convert OS specific boost path to QString | through UTF-8 |
- | Activate, show and raise the widget |
- | Convert enum ConnectionType to QString |
- | Copy a field of the currently selected | entry of a view to the clipboard. Does | nothing if nothing is selected. | | ———– | @param[in] column | | Data column to extract from the model | ––––– | @param[in] role | | Data role to extract from the model @see | TransactionView::copyLabel, TransactionView::copyAmount, | TransactionView::copyAddress |
- | Create human-readable string from | date |
- | Generate a dummy address with invalid | CRC, starting with the network prefix. |
- | A drop-in replacement of QObject::connect | function (see: https://doc.qt.io/qt-5/qobject.html#connect-3), | that guaranties that all exceptions | are handled within the slot. | | ———– | @note | | This function is incompatible with | Qt private signals. |
- | Return a monospace font |
- | Convert seconds into a QString with | days, hours, mins, secs |
- | Format a NodeStats.m_last_ping_time | into a user-readable string or display | N/A, if 0 |
- | Format NodeStats.nServices bitmask | into a user-readable string |
- | Format a NodeCombinedStats.nTimeOffset | into a user-readable string |
- | Determine default data directory for | operating system. |
- | Return a field of the currently selected | entry as a QString. Does nothing if nothing | is selected. | | ———– | @param[in] column | | Data column to extract from the model | @see TransactionView::copyLabel, | TransactionView::copyAmount, TransactionView::copyAddress |
- | Get open filename, convenience wrapper | for QFileDialog::getOpenFileName. | | ———– | @param[in] parent | | Parent window (or 0) | ––––– | @param[in] caption | | Window caption (or empty, for default) | ––––– | @param[in] dir | | Starting directory (or empty, to default | to documents directory) | ––––– | @param[in] filter | | Filter specification such as “Comma | Separated Files (*.csv)” | ––––– | @param[out] selectedSuffixOut | | Pointer to return the suffix (file type) | that was selected (or 0). | | Can be useful when choosing the save | file format based on suffix. |
- | Get save filename, mimics QFileDialog::getSaveFileName, | except that it appends a default suffix | when no suffix is provided by the user. | | ———– | @param[in] parent | | Parent window (or 0) | ––––– | @param[in] caption | | Window caption (or empty, for default) | ––––– | @param[in] dir | | Starting directory (or empty, to default | to documents directory) | ––––– | @param[in] filter | | Filter specification such as “Comma | Separated Files (*.csv)” | ––––– | @param[out] selectedSuffixOut | | Pointer to return the suffix (file type) | that was selected (or 0). | | Can be useful when choosing the save | file format based on suffix. |
- | Set shortcut to close window |
- | Returns true if the specified field | of the currently selected view entry | is not empty. | | ———– | @param[in] column | | Data column to extract from the model | ––––– | @param[in] role | | Data role to extract from the model @see | TransactionView::contextualMenu |
- | Returns true if pixmap has been set. | | QPixmap* QLabel::pixmap() is deprecated | since Qt 5.15. |
- | HTML escaping for rich text controls |
- | Returns true if given address+amount | meets “dust” definition |
- | Determine whether a widget is hidden | behind other windows |
- | Loads the font from the file specified | by file_name, aborts if it fails. |
- | Writes to debug.log short info about | the used Qt and the host system. |
- | Replaces a plain text link with an HTML | tagged one. |
- | Convert enum Network to QString |
- | Queue a function to run in an object’s | event loop. This can be replaced by a | call to the QMetaObject::invokeMethod | functor overload after Qt 5.10, but | for now use a QObject::connect for compatibility | with older Qt versions, based on https://stackoverflow.com/questions/21646467/how-to-execute-a-functor-or-a-lambda-in-a-given-thread-in-qt-gcd-style |
- | Open the config file |
- | Open debug.log |
- | Parse “bitcoin:” URI into recipient | object, return true on successful parsing |
- | Fix known bugs in QProgressDialog class. |
- | Call QMenu::popup() only on supported | QT_QPA_PLATFORM. |
- | Convert QString to OS specific boost | path through UTF-8 |
- | Set up widget for address |
- | Shows a QDialog instance asynchronously, | and deletes it on close. |
- | Splits the string into substrings wherever | separator occurs, and returns the list | of those strings. Empty strings do not | appear in the result. | | QString::split() signature differs | in different Qt versions: | | - QString::SplitBehavior is deprecated | since Qt 5.15 | | - QtSplitBehavior was introduced | in Qt 5.14 | | If {QString|Qt}::SkipEmptyParts | behavior is required, use this function | instead of QString::split(). |
- | Returns the start-moment of the day | in local time. | | QDateTime::QDateTime(const QDate& | date) is deprecated since Qt 5.15. | | QDate::startOfDay() was introduced | in Qt 5.14. |
- | Returns the distance in pixels appropriate | for drawing a subsequent character | after text. | | In Qt 5.12 and before the QFontMetrics::width() | is used and it is deprecated since Qt | 5.13. | | In Qt 5.11 the QFontMetrics::horizontalAdvance() | was introduced. |