projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Session: Add error messages
[pulseview.git]
/
pv
/
prop
/
int.cpp
diff --git
a/pv/prop/int.cpp
b/pv/prop/int.cpp
index e750e9fa9d8ec15757801c2809de31bbba196ef6..2930a3ea1e8c96b5d0091e6c2b640050ecb5d09f 100644
(file)
--- a/
pv/prop/int.cpp
+++ b/
pv/prop/int.cpp
@@
-14,12
+14,11
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
*/
-#include <
stdint.h
>
-#include <
assert.h
>
+#include <
cassert
>
+#include <
cstdint
>
#include <QSpinBox>
#include <QSpinBox>
@@
-34,21
+33,18
@@
namespace pv {
namespace prop {
Int::Int(QString name,
namespace prop {
Int::Int(QString name,
+ QString desc,
QString suffix,
optional< pair<int64_t, int64_t> > range,
Getter getter,
Setter setter) :
QString suffix,
optional< pair<int64_t, int64_t> > range,
Getter getter,
Setter setter) :
- Property(name, getter, setter),
+ Property(name,
desc,
getter, setter),
suffix_(suffix),
range_(range),
spin_box_(nullptr)
{
}
suffix_(suffix),
range_(range),
spin_box_(nullptr)
{
}
-Int::~Int()
-{
-}
-
QWidget* Int::get_widget(QWidget *parent, bool auto_commit)
{
int64_t int_val = 0, range_min = 0;
QWidget* Int::get_widget(QWidget *parent, bool auto_commit)
{
int64_t int_val = 0, range_min = 0;
@@
-95,10
+91,10
@@
QWidget* Int::get_widget(QWidget *parent, bool auto_commit)
range_min = 0, range_max = UINT64_MAX;
} else {
// Unexpected value type.
range_min = 0, range_max = UINT64_MAX;
} else {
// Unexpected value type.
- assert(
0
);
+ assert(
false
);
}
}
- // @todo
S
igrok supports 64-bit quantities, but Qt does not have a
+ // @todo
s
igrok supports 64-bit quantities, but Qt does not have a
// standard widget to allow the values to be modified over the full
// 64-bit range on 32-bit machines. To solve the issue we need a
// custom widget.
// standard widget to allow the values to be modified over the full
// 64-bit range on 32-bit machines. To solve the issue we need a
// custom widget.
@@
-145,10
+141,9
@@
void Int::commit()
new_value = g_variant_new_int64(spin_box_->value());
else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64))
new_value = g_variant_new_uint64(spin_box_->value());
new_value = g_variant_new_int64(spin_box_->value());
else if (g_variant_type_equal(type, G_VARIANT_TYPE_UINT64))
new_value = g_variant_new_uint64(spin_box_->value());
- else
- {
+ else {
// Unexpected value type.
// Unexpected value type.
- assert(
0
);
+ assert(
false
);
}
assert(new_value);
}
assert(new_value);
@@
-163,5
+158,5
@@
void Int::on_value_changed(int)
commit();
}
commit();
}
-}
//
prop
-}
//
pv
+}
// namespace
prop
+}
// namespace
pv