Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

qt_ui_utils.h
Go to the documentation of this file.
1 /* qt_ui_utils.h
2 * Declarations of Qt-specific UI utility routines
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11 #ifndef __QT_UI_UTILS_H__
12 #define __QT_UI_UTILS_H__
13
14 // xxx - copied from ui/gtk/gui_utils.h
15
20 #include <config.h>
21
22 #include <glib.h>
23
24 #include <QString>
25
26 class QAction;
27 class QFont;
28 class QRect;
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 // These are defined elsewhere in ../gtk/
35 #define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
36 #define RECENT_KEY_REMOTE_HOST "recent.remote_host"
37
38 struct _address;
39 struct epan_range;
40
41 #ifdef __cplusplus
42 }
43 #endif /* __cplusplus */
44
45 // Introduced in Qt 5.4
46 #ifndef qUtf8Printable
47 #define qUtf8Printable(str) str.toUtf8().constData()
48 #endif
49
56 gchar *qstring_strdup(QString q_string);
57
65 QString gchar_free_to_qstring(gchar *glib_string);
66
74 QByteArray gchar_free_to_qbytearray(gchar *glib_string);
75
83 QByteArray gstring_free_to_qbytearray(GString *glib_gstring);
84
94 const QString int_to_qstring(qint64 value, int field_width = 0, int base = 10);
95
103 const QString address_to_qstring(const struct _address *address, bool enclose = false);
104
111 const QString address_to_display_qstring(const struct _address *address);
112
121 const QString val_to_qstring(const guint32 val, const struct _value_string *vs, const char *fmt)
122 G_GNUC_PRINTF(3, 0);
123
132 const QString val_ext_to_qstring(const guint32 val, struct _value_string_ext *vse, const char *fmt)
133 G_GNUC_PRINTF(3, 0);
134
141 const QString range_to_qstring(const struct epan_range *range);
142
149 const QString bits_s_to_qstring(const double bits_s);
150
157 const QString file_size_to_qstring(const gint64 size);
158
165 const QString time_t_to_qstring(time_t ti_time);
166
173 QString html_escape(const QString plain_string);
174
181 void smooth_font_size(QFont &font);
182
189 bool qActionLessThan(const QAction *a1, const QAction *a2);
190
197 bool qStringCaseLessThan(const QString &s1, const QString &s2);
198
205 void desktop_show_in_folder(const QString file_path);
206
214 bool rect_on_screen(const QRect &rect);
215
216 #endif /* __QT_UI_UTILS__H__ */
217
218 // XXX Add a routine to fetch the HWND corresponding to a widget using QPlatformIntegration
219
220 /*
221 * Editor modelines
222 *
223 * Local Variables:
224 * c-basic-offset: 4
225 * tab-width: 8
226 * indent-tabs-mode: nil
227 * End:
228 *
229 * ex: set shiftwidth=4 tabstop=8 expandtab:
230 * :indentSize=4:tabSize=8:noTabs=true:
231 */
epan_range
Definition: range.h:42
val_to_qstring
const QString val_to_qstring(const guint32 val, const struct _value_string *vs, const char *fmt) G_GNUC_PRINTF(3
qActionLessThan
bool qActionLessThan(const QAction *a1, const QAction *a2)
Definition: qt_ui_utils.cpp:188
qstring_strdup
gchar * qstring_strdup(QString q_string)
Definition: qt_ui_utils.cpp:49
qStringCaseLessThan
bool qStringCaseLessThan(const QString &s1, const QString &s2)
Definition: qt_ui_utils.cpp:192
range_to_qstring
const QString const QString const QString range_to_qstring(const struct epan_range *range)
bits_s_to_qstring
const QString bits_s_to_qstring(const double bits_s)
Definition: qt_ui_utils.cpp:148
address_to_display_qstring
const QString address_to_display_qstring(const struct _address *address)
gchar_free_to_qbytearray
QByteArray gchar_free_to_qbytearray(gchar *glib_string)
Definition: qt_ui_utils.cpp:57
val_ext_to_qstring
const QString const QString val_ext_to_qstring(const guint32 val, struct _value_string_ext *vse, const char *fmt) G_GNUC_PRINTF(3
desktop_show_in_folder
void desktop_show_in_folder(const QString file_path)
Definition: qt_ui_utils.cpp:198
int_to_qstring
const QString int_to_qstring(qint64 value, int field_width=0, int base=10)
Definition: qt_ui_utils.cpp:71
html_escape
QString html_escape(const QString plain_string)
Definition: qt_ui_utils.cpp:167
address_to_qstring
const QString address_to_qstring(const struct _address *address, bool enclose=false)
file_size_to_qstring
const QString file_size_to_qstring(const gint64 size)
Definition: qt_ui_utils.cpp:154
gchar_free_to_qstring
QString gchar_free_to_qstring(gchar *glib_string)
Definition: qt_ui_utils.cpp:53
time_t_to_qstring
const QString time_t_to_qstring(time_t ti_time)
Definition: qt_ui_utils.cpp:160
smooth_font_size
void smooth_font_size(QFont &font)
Definition: qt_ui_utils.cpp:172
gstring_free_to_qbytearray
QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
Definition: qt_ui_utils.cpp:64
_value_string
Definition: value_string.h:24
_value_string_ext
Definition: value_string.h:164
rect_on_screen
bool rect_on_screen(const QRect &rect)
Definition: qt_ui_utils.cpp:230
_address
Definition: address.h:47