⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1.04 KB)
Bug #7197
» spinbox_valueChanged.cpp
test to reproduce it (Wt 4) -
Roel Standaert, 08/14/2019 12:57 PM
#include
<Wt/WApplication.h>
#include
<Wt/WBreak.h>
#include
<Wt/WContainerWidget.h>
#include
<Wt/WDoubleSpinBox.h>
#include
<Wt/WPushButton.h>
#include
<Wt/WServer.h>
#include
<Wt/WSpinBox.h>
#include
<iostream>
int
main
(
int
argc
,
char
**
argv
)
{
return
Wt
::
WRun
(
argc
,
argv
,
[](
const
Wt
::
WEnvironment
&
env
)
{
auto
app
=
std
::
make_unique
<
Wt
::
WApplication
>
(
env
);
auto
root
=
app
->
root
();
auto
intSpin
=
root
->
addNew
<
Wt
::
WSpinBox
>
();
auto
dblSpin
=
root
->
addNew
<
Wt
::
WDoubleSpinBox
>
();
root
->
addNew
<
Wt
::
WBreak
>
();
auto
connectBtn
=
root
->
addNew
<
Wt
::
WPushButton
>
(
Wt
::
utf8
(
"Connect signals"
));
connectBtn
->
clicked
().
connect
([
intSpin
,
dblSpin
]{
intSpin
->
valueChanged
().
connect
([](
int
value
){
std
::
cout
<<
"spinbox value changed to: "
<<
value
<<
'\n'
;
});
// intSpin->changed().connect([]{});
dblSpin
->
valueChanged
().
connect
([](
double
value
){
std
::
cout
<<
"double spinbox value changed to: "
<<
value
<<
'\n'
;
});
// dblSpin->changed().connect([]{});
});
return
app
;
});
}
« Previous
1
2
Next »
(1-1/2)
Loading...