| Wireshark 4.7.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
29 class QAction;
30 class QFont;
31 class QRect;
32
33#ifdef __cplusplus
34 extern "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
41 struct _address;
42 struct 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
64 char *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
109 const QString int_to_qstring(qint64 value, int field_width = 0, int base = 10);
110
118 const QString address_to_qstring(const struct _address *address, bool enclose = false);
119
126 const QString address_to_display_qstring(const struct _address *address);
127
136 const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt)
137G_GNUC_PRINTF(3, 0);
138
147 const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt)
148G_GNUC_PRINTF(3, 0);
149
156 const QString range_to_qstring(const range_string *range);
157
164 const QString bits_s_to_qstring(const double bits_s);
165
172 const QString file_size_to_qstring(const int64_t size);
173
180 const QString time_t_to_qstring(time_t ti_time);
181
188QString html_escape(const QString plain_string);
189
196 void smooth_font_size(QFont &font);
197
204 bool qActionLessThan(const QAction *a1, const QAction *a2);
205
212 bool qStringCaseLessThan(const QString &s1, const QString &s2);
213
220 void desktop_show_in_folder(const QString file_path);
221
229 bool rect_on_screen(const QRect &rect);
230
237 void 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
253 void 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
276 void 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
qActionLessThan
bool qActionLessThan(const QAction *a1, const QAction *a2)
Definition qt_ui_utils.cpp:201
bits_s_to_qstring
const QString bits_s_to_qstring(const double bits_s)
Definition qt_ui_utils.cpp:157
gchar_free_to_qbytearray
QByteArray gchar_free_to_qbytearray(char *glib_string)
Definition qt_ui_utils.cpp:61
qvector_rtpstream_ids_copy
QVector< rtpstream_id_t * > qvector_rtpstream_ids_copy(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:298
int_to_qstring
const QString int_to_qstring(qint64 value, int field_width=0, int base=10)
Definition qt_ui_utils.cpp:82
file_size_to_qstring
const QString file_size_to_qstring(const int64_t size)
Definition qt_ui_utils.cpp:163
html_escape
QString html_escape(const QString plain_string)
Definition qt_ui_utils.cpp:176
gbytearray_free_to_qbytearray
QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array)
Definition qt_ui_utils.cpp:75
desktop_show_in_folder
void desktop_show_in_folder(const QString file_path)
Definition qt_ui_utils.cpp:210
storeLastDir
void storeLastDir(QString dir)
Store the directory as last directory being used.
Definition qt_ui_utils.cpp:352
time_t_to_qstring
const QString time_t_to_qstring(time_t ti_time)
Definition qt_ui_utils.cpp:169
address_to_display_qstring
const QString address_to_display_qstring(const struct _address *address)
make_filter_based_on_rtpstream_id
QString make_filter_based_on_rtpstream_id(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:318
rect_on_screen
bool rect_on_screen(const QRect &rect)
Definition qt_ui_utils.cpp:280
val_to_qstring
const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt) G_GNUC_PRINTF(3
qstring_strdup
char * qstring_strdup(QString q_string)
Definition qt_ui_utils.cpp:53
smooth_font_size
void smooth_font_size(QFont &font)
Definition qt_ui_utils.cpp:181
gstring_free_to_qbytearray
QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
Definition qt_ui_utils.cpp:68
set_action_shortcuts_visible_in_context_menu
void set_action_shortcuts_visible_in_context_menu(QList< QAction * > actions)
Definition qt_ui_utils.cpp:291
val_ext_to_qstring
const QString const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt) G_GNUC_PRINTF(3
gchar_free_to_qstring
QString gchar_free_to_qstring(char *glib_string)
Definition qt_ui_utils.cpp:57
address_to_qstring
const QString address_to_qstring(const struct _address *address, bool enclose=false)
qStringCaseLessThan
bool qStringCaseLessThan(const QString &s1, const QString &s2)
Definition qt_ui_utils.cpp:205
qvector_rtpstream_ids_free
void qvector_rtpstream_ids_free(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:311
openDialogInitialDir
QString openDialogInitialDir()
Return the last directory that had been opened.
Definition qt_ui_utils.cpp:340
range_to_qstring
const QString const QString const QString range_to_qstring(const range_string *range)
Definition qt_ui_utils.cpp:148
rtp_stream.h
_address
Definition address.h:58
_range_string
Definition value_string.h:570
_value_string_ext
Extended metadata for a value_string array.
Definition value_string.h:325
_value_string
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
epan_range
Definition range.h:41