diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-02-17 12:35:07 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-02-17 20:35:26 +0000 |
commit | da620866878f5299daf041041120e4bd6c5d50ef (patch) | |
tree | 16a9a8260b31cfbfdd08becce7dc9db59978a065 /docbook/wsdg_src | |
parent | 2c43b6885e21580374f79ed498c960ce180ca7ad (diff) |
WSUG: Add more dialog guidelines.
Change-Id: I59a14bf9712c05d75398b8ed2dc103fe3443f7af
Reviewed-on: https://code.wireshark.org/review/7203
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'docbook/wsdg_src')
-rw-r--r-- | docbook/wsdg_src/WSDG_chapter_userinterface.asciidoc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docbook/wsdg_src/WSDG_chapter_userinterface.asciidoc b/docbook/wsdg_src/WSDG_chapter_userinterface.asciidoc index f9fff2a330..5ed852f350 100644 --- a/docbook/wsdg_src/WSDG_chapter_userinterface.asciidoc +++ b/docbook/wsdg_src/WSDG_chapter_userinterface.asciidoc @@ -98,6 +98,27 @@ combinations (particularly `QDialog(parent, Qt::Window)`) can lead to odd and inconsistent behavior. Again, subclassing `WiresharkDialog` will take care of this for you. +Most of the dialogs in ui/qt share many similarities, including method names, +widget names, and behavior. Most dialogs should have the following, although +it's not strictly required: + +- An `updateWidgets()` method, which enables and disables widgets depending on + the current state and constraints of the dialog. For example, the Coloring + Rules dialog disables the button:[Save] button if the user has entered an + invalid display filter. +- A `hintLabel()` widget subclassed from `QLabel` or `ElidedLabel`, placed just + above the dialog button box. The hint label provides guidance and feedback to + the user. +- A context menu (`ctx_menu_`) for additional actions not present in the + button box. +- If the dialog box contains a `QTreeWidget` you might want to add your own + `QTreeWidgetItem` subclass with the following methods: +[horizontal] + `drawData()`:: Draws column data with any needed formatting. + `colData()`:: Returns the data for each column as a `QVariant`. Used for + copying as CSV, YAML, etc. + `operator<()`:: Allows sorting columns based on their raw data. + ===== Strings If you're using GLib string functions or plain old C character array idioms in |