⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1.49 KB)
Bug #14483
ยป main.cpp
Michael Seibt
, 04/20/2026 08:53 AM
#include
<Wt/WBootstrap5Theme.h>
#include
<Wt/WApplication.h>
#include
<Wt/WContainerWidget.h>
#include
<Wt/WGridLayout.h>
#include
<Wt/WHBoxLayout.h>
#include
<Wt/WVBoxLayout.h>
#include
<Wt/WText.h>
using
namespace
std
;
using
namespace
Wt
;
#define SET_BS5THEME 1
// Always apply theme before creating widgets!
class
CThemedApplication
:
public
WApplication
{
public:
CThemedApplication
(
const
WEnvironment
&
rcEnv
)
:
WApplication
{
rcEnv
}
{
#if SET_BS5THEME
setTheme
(
make_shared
<
WBootstrap5Theme
>
());
#endif
}
};
class
CApplication
final
:
public
CThemedApplication
{
public:
CApplication
(
const
WEnvironment
&
rcEnv
);
private:
WContainerWidget
&
m_rRoot
{
*
root
()};
};
CApplication
::
CApplication
(
const
WEnvironment
&
rcEnv
)
:
CThemedApplication
{
rcEnv
}
{
static
atomic
<
int
>
_instanceNumber
{
0
};
const
int
instanceNumber
{
++
_instanceNumber
};
setTitle
(
format
(
"bug repro {} instance {}"
,
WT_VERSION_STR
,
instanceNumber
));
}
int
main
(
int
argc
,
char
*
argv
[])
{
return
WRun
(
argc
,
argv
,
[](
const
WEnvironment
&
rcEnv
)
{
try
{
return
make_unique
<
CApplication
>
(
rcEnv
);
}
catch
(
const
std
::
exception
&
rcException
)
{
cerr
<<
"exception "
<<
typeid
(
remove_cvref
<
decltype
(
rcException
)
>::
type
).
name
()
<<
": "
<<
rcException
.
what
()
<<
endl
;
#if DEBUG
exit
(
-
1
);
#endif
throw
;
}
});
}
(1-1/1)
Loading...