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);
int64_t CAmount
Amount in satoshis (Can be negative)
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=nullptr)
Line edit that can be marked as "invalid" to show input validation feedback.
Top-level interface for a bitcoin node (bitcoind process).
Utility functions used by the Bitcoin Qt UI.
fs::path qstringToBoostPath(const QString &path)
bool isObscured(QWidget *w)
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)
void handleCloseWindowShortcut(QWidget *w)
void PolishProgressDialog(QProgressDialog *dialog)
bool isDust(interfaces::Node &node, const QString &address, const CAmount &amount)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get open filename, convenience wrapper for QFileDialog::getOpenFileName.
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)
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 dateTimeStr(const QDateTime &date)
QString formatDurationStr(int secs)
QString formatBitcoinURI(const SendCoinsRecipient &info)
QString formatTimeOffset(int64_t nTimeOffset)
QString formatServicesStr(quint64 mask)
QString formatNiceTimeOffset(qint64 secs)
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
bool GetStartOnSystemStartup()
QString formatPingTime(int64_t ping_usec)
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.