]> sigrok.org Git - pulseview.git/commitdiff
Integrated property widgets with dialog
authorJoel Holdsworth <redacted>
Fri, 28 Dec 2012 10:03:34 +0000 (10:03 +0000)
committerJoel Holdsworth <redacted>
Fri, 28 Dec 2012 10:10:16 +0000 (10:10 +0000)
pv/dialogs/hwcap.cpp
pv/dialogs/hwcap.h

index d6481ab56ea7cb77d174604471051a4fce960fef..9e73138dbead9d105ec1a78ef8dcd3963ded0ac4 100644 (file)
@@ -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
index 7b826fee7128872eb19799631122cc57ddccf8ac..0548c8aedb0e383729b3f3c830e2c5cb4913347d 100644 (file)
@@ -22,6 +22,8 @@
 #define PULSEVIEW_PV_HWCAP_H
 
 #include <QDialog>
+#include <QDialogButtonBox>
+#include <QVBoxLayout>
 
 #include <pv/prop/binding/hwcap.h>
 
@@ -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;
 };