5 #ifndef BITCOIN_QT_GUIUTIL_H
6 #define BITCOIN_QT_GUIUTIL_H
12 #include <QHeaderView>
13 #include <QItemDelegate>
14 #include <QMessageBox>
16 #include <QProgressBar>
30 class QAbstractItemView;
37 class QProgressDialog;
65 QString
HtmlEscape(
const QString& str,
bool fMultiLine=
false);
66 QString
HtmlEscape(
const std::string& str,
bool fMultiLine=
false);
74 void copyEntryData(
const QAbstractItemView *view,
int column,
int role=Qt::EditRole);
81 QList<QModelIndex>
getEntryData(
const QAbstractItemView *view,
int column);
88 bool hasEntryData(
const QAbstractItemView *view,
int column,
int role);
107 QString
getSaveFileName(QWidget *parent,
const QString &caption,
const QString &dir,
108 const QString &filter,
109 QString *selectedSuffixOut);
120 QString
getOpenFileName(QWidget *parent,
const QString &caption,
const QString &dir,
121 const QString &filter,
122 QString *selectedSuffixOut);
158 bool eventFilter(QObject *obj, QEvent *evt)
override;
176 bool eventFilter(QObject* watched, QEvent* event)
override;
243 qreal
calculateIdealFontSize(
int width,
const QString& text, QFont font, qreal minPointSize = 4, qreal startPointSize = 14);
253 void clicked(
const QPoint& point);
266 void clicked(
const QPoint& point);
283 bool eventFilter(QObject *
object, QEvent *event)
override;
295 int TextWidth(
const QFontMetrics& fm,
const QString& text);
305 void PopupMenu(QMenu* menu,
const QPoint& point, QAction* at_action =
nullptr);
308 #endif // BITCOIN_QT_GUIUTIL_H
void stretchColumnWidth(int column)
ToolTipToRichTextFilter(int size_threshold, QObject *parent=nullptr)
bool eventFilter(QObject *obj, QEvent *evt) override
Utility functions used by the Bitcoin Qt UI.
void LogQtInfo()
Writes to debug.log short info about the used Qt and the host system.
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
void mouseReleaseEvent(QMouseEvent *event) override
void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode)
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
void on_geometriesChanged()
int TextWidth(const QFontMetrics &fm, const QString &text)
Returns the distance in pixels appropriate for drawing a subsequent character after text...
bool isDust(interfaces::Node &node, const QString &address, const CAmount &amount)
int secondToLastColumnIndex
QString dateTimeStr(const QDateTime &date)
Qt::ConnectionType blockingGUIThreadConnection()
Get connection type to call object slot in GUI thread with invokeMethod.
QString formatBytes(uint64_t bytes)
QString formatTimeOffset(int64_t nTimeOffset)
bool GetStartOnSystemStartup()
QString HtmlEscape(const QString &str, bool fMultiLine)
Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text repre...
void connectViewHeadersSignals()
Line edit that can be marked as "invalid" to show input validation feedback.
int getAvailableWidthForColumn(int column)
Qt event filter that intercepts QEvent::FocusOut events for QLabel objects, and resets their `textInt...
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
QString formatBitcoinURI(const SendCoinsRecipient &info)
void bringToFront(QWidget *w)
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...
bool eventFilter(QObject *object, QEvent *event) override
int64_t CAmount
Amount in satoshis (Can be negative)
void mouseReleaseEvent(QMouseEvent *event) override
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
bool isObscured(QWidget *w)
QString formatPingTime(int64_t ping_usec)
qreal calculateIdealFontSize(int width, const QString &text, QFont font, qreal minPointSize, qreal font_size)
QString formatDurationStr(int secs)
void setClipboard(const QString &str)
void handleCloseWindowShortcut(QWidget *w)
int lastColumnMinimumWidth
bool eventFilter(QObject *watched, QEvent *event) override
Makes a QTableView last column feel as if it was being resized from its left border.
bool hasEntryData(const QAbstractItemView *view, int column, int role)
Returns true if the specified field of the currently selected view entry is not empty.
void clicked(const QPoint &point)
Emitted when the label is clicked.
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
void PolishProgressDialog(QProgressDialog *dialog)
ClickableProgressBar ProgressBar
void on_sectionResized(int logicalIndex, int oldSize, int newSize)
void disconnectViewHeadersSignals()
int allColumnsMinimumWidth
fs::path qstringToBoostPath(const QString &path)
ConnectionType
Different types of connections to a peer.
LabelOutOfFocusEventFilter(QObject *parent)
QString formatServicesStr(quint64 mask)
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 ...
void adjustTableColumnsWidth()
bool SetStartOnSystemStartup(bool fAutoStart)
void clicked(const QPoint &point)
Emitted when the progressbar is clicked.
QString formatNiceTimeOffset(qint64 secs)
QString getDefaultDataDirectory()
Determine default data directory for operating system.
QString boostPathToQString(const fs::path &path)
Top-level interface for a bitcoin node (bitcoind process).
void resizeColumn(int nColumnIndex, int width)
ItemDelegate(QObject *parent)
QList< QModelIndex > getEntryData(const QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.