From: Joel Holdsworth Date: Fri, 28 Dec 2012 10:03:34 +0000 (+0000) Subject: Integrated property widgets with dialog X-Git-Tag: pulseview-0.1.0~181 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=497a5b8b11a300f5851d0eabe06f62b2905fcfe1;p=pulseview.git Integrated property widgets with dialog --- diff --git a/pv/dialogs/hwcap.cpp b/pv/dialogs/hwcap.cpp index d6481ab5..9e73138d 100644 --- a/pv/dialogs/hwcap.cpp +++ b/pv/dialogs/hwcap.cpp @@ -25,8 +25,20 @@ namespace dialogs { HwCap::HwCap(QWidget *parent, struct sr_dev_inst *sdi) : QDialog(parent), + _layout(this), + _button_box(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, + Qt::Horizontal, this), _hw_cap_binding(sdi) { + connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); + connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); + + setLayout(&_layout); + + QWidget *const form = _hw_cap_binding.get_form(this); + _layout.addWidget(form); + + _layout.addWidget(&_button_box); } } // namespace dialogs diff --git a/pv/dialogs/hwcap.h b/pv/dialogs/hwcap.h index 7b826fee..0548c8ae 100644 --- a/pv/dialogs/hwcap.h +++ b/pv/dialogs/hwcap.h @@ -22,6 +22,8 @@ #define PULSEVIEW_PV_HWCAP_H #include +#include +#include #include @@ -34,6 +36,9 @@ public: HwCap(QWidget *parent, struct sr_dev_inst *sdi); private: + QVBoxLayout _layout; + QDialogButtonBox _button_box; + pv::prop::binding::HwCap _hw_cap_binding; };