qt6-bb10/examples
Marc Mutz 2325914112 sqlbrowser example: use idiomatic Qt [2/3]: use button-box / override accept()
- The old code used two QPushButtons in a QHBoxLayout to provide
  Ok/Cancel buttons. This hard-codes the positions and text (and
  icons) of these buttons, instead of adapting to the platform style.

  The new code simply uses QDialogButtonBox, which is designed for
  this purpose.

- Also, the old code connected the Ok button's clicked() signal to a
  custom slot that then called QDialog::accept(). This means that the
  code in the custom slot is not executed when the dialog is accepted
  by other means (e.g. return press in one of the line edits
  ("auto-default"), though I'm not sure here).

  The new code uses the idiomatic Qt way of overriding
  QDialog::accept() instead, and connects the button-box's accepted()
  signal to it. This is done in the .ui file, so it already works in
  Designer preview.

- Finally, the old code made a manual connection from the Cancel
  button to QDialog::reject().

  The new code uses the Qt idiom of connecting in the .ui file
  directly, using QDialogButtonBox::rejected() as the signal.

Amends 2690822428, which, however,
inherited all of the above from even older code.

Change-Id: I83afd6156a0811e0c0f99f2480625ea6b69ff78b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3419c299369ac1da94ba5710aaf5f5f65c38c33c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8dbd0828e94497ab6ee6c5d924e51b4778e5bccc)
2025-01-02 19:19:41 +00:00
..
aggregate
corelib Doc: Remove usage of defunct QDoc command 2024-08-28 11:39:51 +00:00
dbus CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
gui rhiwindow: Set DPR on image texture to ensure DPR-agnostic drawing 2024-04-18 23:15:25 +02:00
network Examples: Disable QtC junction points for examples using 'shared' directory 2024-12-20 07:21:19 +00:00
opengl Doc: Remove usage of defunct QDoc command 2024-08-28 11:39:51 +00:00
qmake examples: port qmake examples to new connection style 2022-12-21 22:52:17 +02:00
qtconcurrent CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
qtestlib CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
sql sqlbrowser example: use idiomatic Qt [2/3]: use button-box / override accept() 2025-01-02 19:19:41 +00:00
vulkan Examples: Disable QtC junction points for examples using 'shared' directory 2024-12-20 07:21:19 +00:00
widgets Examples: Disable QtC junction points for examples using 'shared' directory 2024-12-20 07:21:19 +00:00
xml CMake: Add deployment API to our examples 2024-03-22 20:23:52 +01:00
CMakeLists.txt CMake: Allow building all examples as standalone just like tests 2024-03-14 11:44:16 +01:00
README
examples.pro Remove undocumented embedded examples 2023-11-17 19:39:33 +01:00

README

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.