Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
qt_ui_utils.h
Go to the documentation of this file.
1
12#ifndef __QT_UI_UTILS_H__
13#define __QT_UI_UTILS_H__
14
15// xxx - copied from ui/gtk/gui_utils.h
16
21#include <config.h>
22
23#include <glib.h>
24
25#include "ui/rtp_stream.h"
26
27#include <QString>
28
29class QAction;
30class QFont;
31class QRect;
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
37// These are defined elsewhere in ../gtk/
38#define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
39#define RECENT_KEY_REMOTE_HOST "recent.remote_host"
40
41struct _address;
42struct epan_range;
43
44#ifdef __cplusplus
45}
46#endif /* __cplusplus */
47
48/*
49 * Helper macro, to prevent old-style-cast warnings, when using GList in c++ code
50 */
51#define gxx_list_next(list) ((list) ? ((reinterpret_cast<GList *>(list))->next) : Q_NULLPTR)
52#define gxx_constlist_next(list) ((list) ? ((reinterpret_cast<const GList *>(list))->next) : Q_NULLPTR)
53#define gxx_list_previous(list) ((list) ? ((reinterpret_cast<GList *>(list))->prev) : Q_NULLPTR)
54#define gxx_constlist_previous(list) ((list) ? ((reinterpret_cast<const GList *>(list))->prev) : Q_NULLPTR)
55
56#define gxx_list_data(type, list) ((list) ? ((reinterpret_cast<type>(list->data))) : Q_NULLPTR)
57
64char *qstring_strdup(QString q_string);
65
73QString gchar_free_to_qstring(char *glib_string);
74
82QByteArray gchar_free_to_qbytearray(char *glib_string);
83
91QByteArray gstring_free_to_qbytearray(GString *glib_gstring);
92
98QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array);
99
109const QString int_to_qstring(qint64 value, int field_width = 0, int base = 10);
110
118const QString address_to_qstring(const struct _address *address, bool enclose = false);
119
126const QString address_to_display_qstring(const struct _address *address);
127
136const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt)
137G_GNUC_PRINTF(3, 0);
138
147const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt)
148G_GNUC_PRINTF(3, 0);
149
156const QString range_to_qstring(const range_string *range);
157
164const QString bits_s_to_qstring(const double bits_s);
165
172const QString file_size_to_qstring(const int64_t size);
173
180const QString time_t_to_qstring(time_t ti_time);
181
188QString html_escape(const QString plain_string);
189
196void smooth_font_size(QFont &font);
197
204bool qActionLessThan(const QAction *a1, const QAction *a2);
205
212bool qStringCaseLessThan(const QString &s1, const QString &s2);
213
220void desktop_show_in_folder(const QString file_path);
221
229bool rect_on_screen(const QRect &rect);
230
237void set_action_shortcuts_visible_in_context_menu(QList<QAction *> actions);
238
246QVector<rtpstream_id_t *>qvector_rtpstream_ids_copy(QVector<rtpstream_id_t *> stream_ids);
247
253void qvector_rtpstream_ids_free(QVector<rtpstream_id_t *> stream_ids);
254
261QString make_filter_based_on_rtpstream_id(QVector<rtpstream_id_t *> stream_ids);
262
271QString openDialogInitialDir();
272
276void storeLastDir(QString dir);
277
278#endif /* __QT_UI_UTILS__H__ */
279
280// XXX Add a routine to fetch the HWND corresponding to a widget using QPlatformIntegration
bool qActionLessThan(const QAction *a1, const QAction *a2)
Definition qt_ui_utils.cpp:201
const QString bits_s_to_qstring(const double bits_s)
Definition qt_ui_utils.cpp:157
QByteArray gchar_free_to_qbytearray(char *glib_string)
Definition qt_ui_utils.cpp:61
QVector< rtpstream_id_t * > qvector_rtpstream_ids_copy(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:298
const QString int_to_qstring(qint64 value, int field_width=0, int base=10)
Definition qt_ui_utils.cpp:82
const QString file_size_to_qstring(const int64_t size)
Definition qt_ui_utils.cpp:163
QString html_escape(const QString plain_string)
Definition qt_ui_utils.cpp:176
QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array)
Definition qt_ui_utils.cpp:75
void desktop_show_in_folder(const QString file_path)
Definition qt_ui_utils.cpp:210
void storeLastDir(QString dir)
Store the directory as last directory being used.
Definition qt_ui_utils.cpp:352
const QString time_t_to_qstring(time_t ti_time)
Definition qt_ui_utils.cpp:169
const QString address_to_display_qstring(const struct _address *address)
QString make_filter_based_on_rtpstream_id(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:318
bool rect_on_screen(const QRect &rect)
Definition qt_ui_utils.cpp:280
const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt) G_GNUC_PRINTF(3
char * qstring_strdup(QString q_string)
Definition qt_ui_utils.cpp:53
void smooth_font_size(QFont &font)
Definition qt_ui_utils.cpp:181
QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
Definition qt_ui_utils.cpp:68
void set_action_shortcuts_visible_in_context_menu(QList< QAction * > actions)
Definition qt_ui_utils.cpp:291
const QString const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt) G_GNUC_PRINTF(3
QString gchar_free_to_qstring(char *glib_string)
Definition qt_ui_utils.cpp:57
const QString address_to_qstring(const struct _address *address, bool enclose=false)
bool qStringCaseLessThan(const QString &s1, const QString &s2)
Definition qt_ui_utils.cpp:205
void qvector_rtpstream_ids_free(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:311
QString openDialogInitialDir()
Return the last directory that had been opened.
Definition qt_ui_utils.cpp:340
const QString const QString const QString range_to_qstring(const range_string *range)
Definition qt_ui_utils.cpp:148
Definition address.h:56
Definition value_string.h:292
Definition value_string.h:169
Definition value_string.h:25
Definition range.h:41