Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
guiutil.h File Reference
#include <consensus/amount.h>
#include <net.h>
#include <netaddress.h>
#include <util/check.h>
#include <util/fs.h>
#include <QApplication>
#include <QEvent>
#include <QHeaderView>
#include <QItemDelegate>
#include <QLabel>
#include <QMessageBox>
#include <QMetaObject>
#include <QObject>
#include <QProgressBar>
#include <QString>
#include <QTableView>
#include <cassert>
#include <chrono>
#include <utility>
Include dependency graph for guiutil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GUIUtil::ToolTipToRichTextFilter
 Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. More...
class  GUIUtil::ThemedLabel
class  GUIUtil::ClickableLabel
class  GUIUtil::ClickableProgressBar
class  GUIUtil::ItemDelegate

Namespaces

namespace  interfaces
namespace  GUIUtil
 Utility functions used by the Bitcoin Qt UI.

Typedefs

typedef ClickableProgressBar GUIUtil::ProgressBar

Functions

QString GUIUtil::dateTimeStr (const QDateTime &date)
QString GUIUtil::dateTimeStr (qint64 nTime)
QFont GUIUtil::fixedPitchFont (bool use_embedded_font)
void GUIUtil::setupAddressWidget (QValidatedLineEdit *widget, QWidget *parent)
void GUIUtil::AddButtonShortcut (QAbstractButton *button, const QKeySequence &shortcut)
 Connects an additional shortcut to a QAbstractButton.
bool GUIUtil::parseBitcoinURI (const QUrl &uri, SendCoinsRecipient *out)
bool GUIUtil::parseBitcoinURI (QString uri, SendCoinsRecipient *out)
QString GUIUtil::formatBitcoinURI (const SendCoinsRecipient &info)
bool GUIUtil::isDust (interfaces::Node &node, const QString &address, const CAmount &amount)
QString GUIUtil::HtmlEscape (const QString &str, bool fMultiLine)
QString GUIUtil::HtmlEscape (const std::string &str, bool fMultiLine)
void GUIUtil::copyEntryData (const QAbstractItemView *view, int column, int role=Qt::EditRole)
 Copy a field of the currently selected entry of a view to the clipboard.
QList< QModelIndex > GUIUtil::getEntryData (const QAbstractItemView *view, int column)
 Return a field of the currently selected entry as a QString.
bool GUIUtil::hasEntryData (const QAbstractItemView *view, int column, int role)
 Returns true if the specified field of the currently selected view entry is not empty.
void GUIUtil::setClipboard (const QString &str)
void GUIUtil::LoadFont (const QString &file_name)
 Loads the font from the file specified by file_name, aborts if it fails.
QString GUIUtil::getDefaultDataDirectory ()
 Determine default data directory for operating system.
QString GUIUtil::ExtractFirstSuffixFromFilter (const QString &filter)
 Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...).
QString GUIUtil::getSaveFileName (QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
 Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user.
QString GUIUtil::getOpenFileName (QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
 Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
Qt::ConnectionType GUIUtil::blockingGUIThreadConnection ()
 Get connection type to call object slot in GUI thread with invokeMethod.
bool GUIUtil::isObscured (QWidget *w)
void GUIUtil::bringToFront (QWidget *w)
void GUIUtil::handleCloseWindowShortcut (QWidget *w)
void GUIUtil::openDebugLogfile ()
bool GUIUtil::openBitcoinConf ()
fs::path GUIUtil::QStringToPath (const QString &path)
 Qt event filter that intercepts QEvent::FocusOut events for QLabel objects, and resets their `textInteractionFlags' property to get rid of the visible cursor.
QString GUIUtil::PathToQString (const fs::path &path)
 Convert OS specific boost path to QString through UTF-8.
QString GUIUtil::NetworkToQString (Network net)
 Convert enum Network to QString.
QString GUIUtil::ConnectionTypeToQString (ConnectionType conn_type, bool prepend_direction)
 Convert enum ConnectionType to QString.
QString GUIUtil::formatDurationStr (std::chrono::seconds dur)
 Convert seconds into a QString with days, hours, mins, secs.
QString GUIUtil::FormatPeerAge (std::chrono::seconds time_connected)
 Convert peer connection time to a QString denominated in the most relevant unit.
QString GUIUtil::formatServicesStr (quint64 mask)
 Format CNodeStats.nServices bitmask into a user-readable string.
QString GUIUtil::formatPingTime (std::chrono::microseconds ping_time)
 Format a CNodeStats.m_last_ping_time into a user-readable string or display N/A, if 0.
QString GUIUtil::formatTimeOffset (int64_t time_offset)
 Format a CNodeStateStats.time_offset into a user-readable string.
QString GUIUtil::formatNiceTimeOffset (qint64 secs)
QString GUIUtil::formatBytes (uint64_t bytes)
qreal GUIUtil::calculateIdealFontSize (int width, const QString &text, QFont font, qreal minPointSize, qreal font_size)
void GUIUtil::PolishProgressDialog (QProgressDialog *dialog)
int GUIUtil::TextWidth (const QFontMetrics &fm, const QString &text)
 Returns the distance in pixels appropriate for drawing a subsequent character after text.
void GUIUtil::LogQtInfo ()
 Writes to debug.log short info about the used Qt and the host system.
void GUIUtil::PopupMenu (QMenu *menu, const QPoint &point, QAction *at_action=nullptr)
 Call QMenu::popup() only on supported QT_QPA_PLATFORM.
QDateTime GUIUtil::StartOfDay (const QDate &date)
 Returns the start-moment of the day in local time.
bool GUIUtil::HasPixmap (const QLabel *label)
 Returns true if pixmap has been set.
QString GUIUtil::MakeHtmlLink (const QString &source, const QString &link)
 Replaces a plain text link with an HTML tagged one.
void GUIUtil::PrintSlotException (const std::exception *exception, const QObject *sender, const QObject *receiver)
template<typename Sender, typename Signal, typename Receiver, typename Slot>
auto GUIUtil::ExceptionSafeConnect (Sender sender, Signal signal, Receiver receiver, Slot method, Qt::ConnectionType type=Qt::AutoConnection)
 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.
void GUIUtil::ShowModalDialogAsynchronously (QDialog *dialog)
 Shows a QDialog instance asynchronously, and deletes it on close.
bool GUIUtil::IsEscapeOrBack (int key)
QString GUIUtil::WalletDisplayName (const std::string &name)
QString GUIUtil::WalletDisplayName (const QString &name)

Variables

constexpr auto GUIUtil::dialog_flags = Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint