5#ifndef BITCOIN_QT_GUIUTIL_H
6#define BITCOIN_QT_GUIUTIL_H
14#include <QItemDelegate>
18#include <QProgressBar>
34class QAbstractItemView;
82QString
HtmlEscape(
const QString &str,
bool fMultiLine =
false);
83QString
HtmlEscape(
const std::string &str,
bool fMultiLine =
false);
94 int role = Qt::EditRole);
103QList<QModelIndex>
getEntryData(
const QAbstractItemView *view,
int column);
112bool hasEntryData(
const QAbstractItemView *view,
int column,
int role);
136 const QString &dir,
const QString &filter,
137 QString *selectedSuffixOut);
152 const QString &dir,
const QString &filter,
153 QString *selectedSuffixOut);
194 bool eventFilter(QObject *obj, QEvent *evt)
override;
212 bool eventFilter(QObject *watched, QEvent *event)
override;
232 int allColsMinimumWidth, QObject *parent);
249 QHeaderView::ResizeMode resizeMode);
289 qreal minPointSize = 4, qreal startPointSize = 14);
331 bool eventFilter(QObject *
object, QEvent *event)
override;
342int TextWidth(
const QFontMetrics &fm,
const QString &text);
352void PopupMenu(QMenu *menu,
const QPoint &point, QAction *at_action =
nullptr);
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
void mouseReleaseEvent(QMouseEvent *event) override
void clicked(const QPoint &point)
Emitted when the label is clicked.
void mouseReleaseEvent(QMouseEvent *event) override
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
ItemDelegate(QObject *parent)
bool eventFilter(QObject *object, QEvent *event) override
Qt event filter that intercepts QEvent::FocusOut events for QLabel objects, and resets their ‘textInt...
bool eventFilter(QObject *watched, QEvent *event) override
LabelOutOfFocusEventFilter(QObject *parent)
Makes a QTableView last column feel as if it was being resized from its left border.
void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode)
int allColumnsMinimumWidth
void resizeColumn(int nColumnIndex, int width)
void on_sectionResized(int logicalIndex, int oldSize, int newSize)
TableViewLastColumnResizingFixer(QTableView *table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent)
Initializes all internal variables and prepares the the resize modes of the last 2 columns of the tab...
int secondToLastColumnIndex
void stretchColumnWidth(int column)
void on_geometriesChanged()
void connectViewHeadersSignals()
void adjustTableColumnsWidth()
int getAvailableWidthForColumn(int column)
void disconnectViewHeadersSignals()
int lastColumnMinimumWidth
Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text repre...
bool eventFilter(QObject *obj, QEvent *evt) override
ToolTipToRichTextFilter(int size_threshold, QObject *parent=0)
Line edit that can be marked as "invalid" to show input validation feedback.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
Top-level interface for a bitcoin node (bitcoind process).
Utility functions used by the Bitcoin Qt UI.
QString NetworkToQString(Network net)
Convert enum Network to QString.
fs::path qstringToBoostPath(const QString &path)
Convert QString to OS specific boost path through UTF-8.
bool isObscured(QWidget *w)
bool parseBitcoinURI(const QString &scheme, const QUrl &uri, SendCoinsRecipient *out)
bool isDust(interfaces::Node &node, const QString &address, const Amount amount, const CChainParams &chainParams)
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
QString HtmlEscape(const QString &str, bool fMultiLine)
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
QList< QModelIndex > getEntryData(const QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.
QString formatBytes(uint64_t bytes)
QString formatDurationStr(std::chrono::seconds dur)
Convert seconds into a QString with days, hours, mins, secs.
void handleCloseWindowShortcut(QWidget *w)
void PolishProgressDialog(QProgressDialog *dialog)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
std::string DummyAddress(const CChainParams ¶ms)
QString getDefaultDataDirectory()
Determine default data directory for operating system.
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
QString 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 ...
QString boostPathToQString(const fs::path &path)
Convert OS specific boost path to QString through UTF-8.
bool SetStartOnSystemStartup(bool fAutoStart)
ClickableProgressBar ProgressBar
void bringToFront(QWidget *w)
void LogQtInfo()
Writes to debug.log short info about the used Qt and the host system.
QString 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 dateTimeStr(const QDateTime &date)
QString formatBitcoinURI(const SendCoinsRecipient &info)
QString formatTimeOffset(int64_t nTimeOffset)
Format a CNodeCombinedStats.nTimeOffset into a user-readable string.
QString convertToCashAddr(const CChainParams ¶ms, const QString &addr)
QString formatServicesStr(quint64 mask)
Format CNodeStats.nServices bitmask into a user-readable string.
QString formatNiceTimeOffset(qint64 secs)
bool GetStartOnSystemStartup()
QStringList splitSkipEmptyParts(const QString &s, const QString &separator)
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text.
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
void setClipboard(const QString &str)
bool hasEntryData(const QAbstractItemView *view, int column, int role)
Returns true if the specified field of the currently selected view entry is not empty.
qreal calculateIdealFontSize(int width, const QString &text, QFont font, qreal minPointSize, qreal font_size)
ConnectionType
Different types of connections to a peer.