Wt Release notes
Wt Release notes
This file lists important notes on migrating existing applications to
newer version of Wt. It lists changes in the library that may break
the way you build Wt, the way you configure Wt or the Wt API and
behaviour.
Release 2.2.3 (Jan 26, 2009)
This release is a maintenance release, with mostly bug fixes and
feature improvements.
A) Main new features in existing classes:
- WAbstractItemModel:
- const char * data in boost::any is now
also supported.
- WAbstractProxyModel:
- Implemented toRawIndex()
and fromRawIndex() so that indexes can be recovered
when the model's layout is changed, if the underlying model
provides implementations for toRawIndex()
and fromRawIndex().
- WComboBox:
- Also supports StyleClassRole data role for items
- WDialog:
- New method setTitleBarEnabled() to disable the default
title bar.
- WMenu:
- New method removeItem(), only works when rendered as a
list.
- WTabWidget:
- New method removeTab().
- WTreeView:
- New method setColumn1Fixed() to fix the first
column while scrolling horizontally through the other columns.
- New method setColumnFormat() to control formatting of
data.
- New method setColumnBorder() to set the
internal column border color.
- New method setColumnResizeEnabled() to disable resize
handles.
- The view now also reacts correctly to insertion and
removal of model columns.
B) New examples
-
gitmodel:
- An example that demonstrates how to implement a custom abstract
item model.
- treeview-dragdrop:
- An example that demonstrates drag and drop support in WTreeView.
C) Changes that break backward compatibility
- WApplication:
- useStyleSheet() only supports a subset of IE condition
strings, since the string is now parsed by Wt rather than by IE (when
dynamically loading stylesheets, the comment-syntax does not work
reliably).
Release 2.2.2 (Dec 1, 2008)
As of now, we will also be listing noteworthy new API features,
even if they are no concern for backwards compatibility.
A) New classes:
- WPopupMenu,
WPopupMenuItem:
- A popup menu, which you would typically use to present a
context menu.
- WAbstractProxyModel,
WSortFilterProxyModel:
- Proxy models, which present data from a source model in a
different way.
- WLoadingIndicator, WDefaultLoadingIndicator,
WOverlayLoadingIndicator:
- Customizable loading indicators.
B) Main new features in existing classes:
- WTreeView, WAbstractItemModel:
- The WAbstractItemModel interface was extended to allow handling
of drag & drop events, and WTreeView now is able to start
dragging and handle dropping of item selections and other data.
- JSignal:
- You can now pass the original (keyboard/mouse) JavaScript event
as a parameter to custom signals.
- WTreeView:
- access mouse event in itemClicked, doubleClicked and
mouseWentDown signals.
- WServer:
- Support for widget-set mode, allowing a Wt application to be
embedded in an existing web page/application.
C) Changes that break backward compatibility
This release does not contain changes that break existing
applications.
Release 2.2.1 (Nov 3, 2008)
This release is as usually a mix of bug fixes, improvements and new
features.
We have made a significant change to the MVC system, which will
break existing program code in case you have implemented your own
models (i.e. deriving from WAbstractItemModel) or views
widgets (i.e. components that listen to model changes).
The WAbstractItemModel interface was changed to support
hierarchical models. This means that most methods will now take an
extra parameter that specifies the parent WModelIndex,
and also all signals have now this extra parameter. Because the
parameter has a default value of WModelIndex() which corresponds to
the top level parent, the API is largely backwards compatible when
merely using the model. It is only those classes that reimplement the
interface, or listen to signal events, that are affected.
The immediate benefit of the new WAbstracItemModel
interface is that it allows us to implement View widgets like the new
WTreeView widget.
Release 2.2.0 (Sept 12, 2008)
This release has a rather substantial rewrite (and simplification)
of Wt's bootstrapping process. In the past, Wt used a frameset trick
to be able to load the AJAX-based skeleton when JavaScript was
available. Isntead, now, the entire AJAX-based stuff is loaded
directly into the bootstrap page. A benefit of the new approach is
that we avoid iframe tricks, which have been deprecated from strict
HTML and XHTML. But, it was in fact motivated in the first place to
support all major browsers for a new internal path API. This new API
allows to fully support URL changes and bookmarks in a unified way
(i.e. it works equally when the browser supports AJAX, no JavaScript,
or is a bot such as google bot).
As a consequence, this release contains the following changes that
may break your application:
- WMenu::enableBrowserHistory() and WMenu::browserHistoryId() have been removed, use the new methods WMenu::setInternalPathEnabled() and WMenu::setInternalBasePath()
- WMenuItem has been reorganized, and if you have
specialized WMenuItem you will need to adapt your reimplementation
to the new virtual interface. In the new interface, you need to
reimplement WMenuItem::createItemWidget() and
WMenuItem::updateItemWidget() allowing you to react to
item changes (internal path or text). The default implementation now
always uses a WAnchor.
- WApplication::setState(), WApplication::state() and WApplication::stateChanged have been deprecated. It is stronly advised that you use the new internal path API instead. This does require you to treat different parts of the state as a file hierarchy. See the WApplication::setInternalPath() documentation.
The following methods have been deprecated (but are still supported):
- WTable::numRows() has been renamed
to WTable::rowCount().
- WTable::numColumns() has been renamed
to WTable::columnCount().
Release 2.1.5 (July 25, 2008)
Wt now installs its include files in a Wt/ subdirectory. You may
want to change your build files to pick up this new include directory,
or, change your code to scope the include files to look like
#include<Wt/WLineEdit> instead of #include<WLineEdit>
This release contains the following changes that may break your
application:
- WText will validate XHTML text when it is set to the
widget. The old behaviour was to validate only before
rendering. The change was needed to be able to react to XML parse
errors. As a consequence if you are creating a WText with text that
is not valid XML, followed by a
call setFormatting(WText::PlainFormatting), you should
change this now to use the new WText constructor which
takes the TextFormat as a new argument: new WText(text,
Wt::PlainText, parentWidget)
- WContainerWidget::setLayout(WLayout *layout, bool fitWidth, bool
fitHeight) has been replaced with the more generic
WContainerWidget::setLayout(WLayout *layout, int
alignment).
The following methods and enumerations have been deprecated (but are
still supported):
- enum WText::Formatting has been renamed
to Wt::TextFormat. The old values map as follows on new
values:
- WText::XHTMLFormatting becomes Wt::XHTMLText;
- WText::XHTMLUnsafeFormatting becomes Wt::XHTMLUnsafeText
- WText::PlainFormatting becomes Wt::PlainText
- WText::setFormatting() has been renamed
to WText::setTextFormat() and
WText::formatting() has been renamed
to WText::textFormat().
Release 2.1.4 (July 4, 2008)
The following has changed for building Wt:
- The CMake variable CONFIGURATION (which defaulted to
/etc/wt/wt_config.xml) is no longer used, but instead there is now a
CONFIGDIR (/etc/wt/) which is used to store configuration
files.
The following has changed in the wt_config.xml file:
- The <valgrind-path> setting for the FCGI connector may now
be a command-line including arguments
This release should not contain changes that may break your
application.
Release 2.1.3 (May 20, 2008)
This release should not contain changes that may break your
application.
Release 2.1.2 (April 14, 2008)
The following changes may break your application build:
- WTreeNode::expanded() has been renamed
to WTreeNode::isExpanded().
Release 2.1.1 (April 10, 2008)
This release should not break any of your applications, but we did
deprecate some methods and enumeration types. You are advised to
migrate to the replacements methods since we will discontinue support
for the older ones in the future.
The following methods and enumerations have been deprecated:
- enum SelectionUnit has been renamed
to SelectionBehavior. The old values map as follows on new
values: CellSelection becomes SelectItems;
RowSelection becomes SelectRows.
- WWidget::setOffset(int sides, WLength) is deprecated,
and the new method is WWidget::setOffsets(WLength, int
sides): the argument order has been switched to be consistent
with the method signature of setMargin()
and setPadding().
- WResource::suggestFilename() has been renamed to
WResource::suggestFileName().
The following changes affect run-time behaviour:
- WTreeNode now supports a policy for when to show a child count
indication. The old behaviour was to always show the child count.
Now, by default this option is disabled. Use
WTreeNode::setChildCountPolicy(Enabled) to get the old
behaviour back, if you wish.
Release 2.1.0
The library dependencies have changed slightly.
To build Wt 2.1.0, you need:
- CMake 2.4 or later
- boost 1.34.1 (boost 1.33.1 might should still work, but is
not recommended)
- asio 0.3.9: either the boost or non-boost version (only
for the http connector)
- optionally, openssl for HTTPS support (only for the http
connector)
- optionally, libz for gzip compression support (only for
the http connector)
- fcgi library, including C++ bindings (libfcgi++)(only for the
fcgi connector)
Furthermore, the Wt::Ext library has been upgraded and now wraps
around the extjs 2.x library, instead of extjs 1.x.
Some API changes may need a porting effort:
- Ext::ProgressDialog: doesn't show by default, you
need to call show() to show the dialog.
- Ext::ContentPanel, Ext::BorderLayout have
been removed. They have been replaced with a stand-alone layout
system, that may manage contents in
an Ext::Container. The layout system provides
WBorderLayout and several other layout managers.
- WSignalMapper has been expanded to allow mapping of
signals with an extra argument, which is passed to the mapped
signal. Because of this, the signature of the class has been
expanded with an extra template argument. If you have forward
declarations to WSignalMapper, you will need to modify
these too (or simply include WSignalMapper).
-
- WAnchor: no longer uses a WLabel internally,
and the label-releated methods have been removed.
Release 2.0.5
- WDialog (and WMessageBox) usage changed, and
is now more like Qt. When you are not
using WDialog::exec() or WMessageBox::show(...),
then you must explictly show() the dialog to show it. You
can now also hide() the dialog if you want.
-
Moved several enums from within classes to the Wt namespace. This is
likely to break your code at compile time when you are using one. The
fix is to remove the class scope from the enum type or value.
- WScrollArea::Orientation -> Wt::Orientation
- WMenu::Orientation -> Wt::Orientation
- WMessageBox::StandardButton -> Wt::StandardButton
- WMessageBox::Icon -> Wt::Icon
Release 2.0.4
Important: 2.0.4a contains a fix for a bug introduced in 2.0.4 that
reset the deploy-path in wthttpd.
This release adds a few new features:
- WComboBox (and WSelectionBox) now use
a WAbstractItemModel in a more flexible model/view
system.
- Stylesheets may be browser-conditional (by Patrick Fischer)
- wthttpd may serve custom error pages (by Patrick Fischer)
- WResource can now access HTTP GET or POST query
arguments. This will break your code (at compile time) if you
have implemented your own WResource, since the signature of the
streamResourceData() method has been changed to pass
the arguments map as a second parameter.
Release 2.0.1
This release fixes some build-related problems, as well as smaller
bugs. The main improvement in this release is related to use of Wt
in resource-constrained embedded systems.
The most visible change is that the dependency on the Xerces C++ XML
library was dropped in favour of the much smaller Mini-XML
library. The draw-back is a reduction of supported character
encodings to only UTF8 and UTF16, next to the default locale character
encoding (which is typically an 8-bit flavour).
When using the built-in httpd, you can now disable support for SSL
at compile time, freeing a number of SSL-related dependencies.
In the API, more comparison operators (== and !=) were added to
WString, and a WViewWidget was added for simple MVC widgets (with
the main purpose to reduce session-state at the server).
Release 2.0.0
This release contains numerous changes which are likely to cause some
porting effort for Wt 1.1.x applications to work properly.
If you are upgrading from a 1.99.x release, you will notice that
some of these notes have actually evolved, especially with respect to
WString and unicode support.
Here is a list of changes with respect to Wt 1.1.x that are likely
to require your attention, and some tips on how to do the porting.
1) Namespace Wt
All Wt classes are now inside the namespace Wt.
To handle this change, you will need to:
- Wrap forward declarations to Wt widgets in header files inside a
Wt namespace, or #include <WFwdDeclarations>
- and scope all Wt classes with Wt::,
- or import the Wt namespace: using namespace Wt;
2) WString
Previously, most widgets offered double methods that either used a
std::string for literal text, or a
WMessage for localized text.
In the new release, widgets use Wt::WString for both
literal and localized text. WString offers unicode support for both
literal as well as localized text. To create a literal string,
simply assign or construct a Wt::WString from that string. The
strings supported or both narrow and wide C and C++ strings. UTF8
encoded narrow strings may also be converted. To create a localized
string, use one of the static methods WString::tr(const
std::string key) and WWidget::tr(const std::string
key).
To help with legacy code, WMessage is now a typedef for WString, but
is deprecated and should not be used in new code. Unfortunately, the
constructors WMessage(const char *text) and
WMessage(const std::string text), changed meaning!
While previously they took a key to construct a localized message,
they now take a literal text (the exact opposite!), since they are
in fact plain WString() constructors. As a consequence your application
will display key values instead of resolving those values (but will
not break entirely).
The new approach offers the benefit of only requiring one method
signature for both literal and localizable text. This not only
simplifies our work, but more importantly by using
WString for displayed text in the API of your own
widgets, localization (including the automatic language switching)
comes automatically and is decided on by the user of your widget.
Fortunately, there is a straightforward trick to handle most consequences
of this change:
- Replace WMessage(...) with tr(...),
- add .value() when using the result of functions such
as WText::text(),
- change your own classes to use WString
wherever they expect some text that will be displayed, instead of
std::string or WMessage.
3) Wide string API
Since Wt 2.0.0, the API for Wt has been changed to use WString
instead of C++ narrow strings. WString supports both narrow and wide
strings, and provides conversion between both. It does not provide
string operations, however, and instead acts as a string
container. You should convert to a C++ string type to perform
operations. You should also not use WString outside of the user
interface part of your application.
4) No more wmain()
Previously, the Wt library implemented the main(int argc, char
**argv) function, and called a wmain() function
which created the WApplication instance.
Wt 2.0.0 allows multiple applications to run within a single process.
Therefore, the WApplication::exec() approach was no longer
feasible. The new approach requires that:
- your main function should look like this:
int main(int argc, char **argv)
{
return Wt::WRun(argc, argv, &createApplication);
}
- where createApplication is a function of the following
signature:
Wt::WApplication *createApplication(const Wt::WEnvironment& env)
{
// return a new application object.
}
5) Configuration in /etc/wt/wt_config.xml
Wt 2.0.0 uses a configuration file for a number of settings that
could previously be configured at build time of the library, or
in the API. The latter functions are:
- WApplication::setMaximumRquestSize()
- WApplication::setIdleTimeout()
6) Removed obsolete classes
Wt 2.0.0 removed a number of classes that were still in the widget
tree, but have been obsoleted by more flexible classes:
- WAbstractTab, WButtonTab, and WTabWidget are obsoleted by the more flexible WMenu.
7) Deprecate boost::regex from WRegExpValidator API
The constructor and methods that takes a boost::regex object in
the WRegExpValidator API have been deprecated, to remove the dependency
on boost from the public API. You should consider the std::string based
construtor and method instead.
8) WObject::emit() has been removed.
Since Wt 1.99.1, we have removed WObject::emit() function. Instead,
you may simply call the signal with its arguments, or use the
explicit emit method (recommended).
To adapt your code, you should:
- Replace all emit(MySignal(...)) with MySignal(...) or MySignal.emit(...)
9) WResource::streamResourceData() signature has changed.
Since Wt 2.0.0, WResource::streamResourceData() returns a boolean value
which indicates if all data has been streamed. If you have reimplemented
WResource for your applications, you must update the signature and return
true.
The change is relevant only within the new server-push support that is
now in Wt 2.0.0. This allows you to continuously append to the content
of a resource.
10) Rename of WJavascriptSlot to JSlot.
Release 1.1.7
This release contains lots of additions and improvements, but should
be completely backwards-compatible.
Release 1.1.6
There is one change which will impact the behaviour of current applications:
Currently, on exit, by default the last widget updates are shown. So, no
more good-bye message. This changes slightly when one needs to redirect()
to a new location: not when WApplication::exec() returns, but during the
same event handling as when calling WApplication::quit().
Release 1.1.5
Nothing special...
Release 1.1.4
Changes to impact everybody, since the previous release:
-
The dependency for libxml++ (and its large number of dependencies) has
been dropped, and replaced by Xerces-C++ (which has no further dependencies).
-
Wt programs need to link against libwtfcgi.so, instead of libwt.so. In the
future Wt will also support different web-connnector systems besides
FastCGI.
-
The signatures of wmain() and WApplication constructor have changed:
new signatures are:
- int wmain(const WEnvironment& env)
- WApplication::WApplication(const WEnvironment& env)
Other changes:
- Support for unicode is implemented, but perhaps needs more testing
by non-Western people ? Only UTF-8 is supported currently.
- Addition of a WTimer class -- see mission example.
- Many bug fixes which should make Wt more robust against illegal CGI
requests (which are ignored), and now Wt should exit cleanly in more
(all?) circumstances.
- Addition of feed-back for pending AJAX requests (does not work yet on
IE).
- Support for style sheets is improved: now inline decoration styles
will override style sheet styles. See hangman or treelist examples.
- The browser can be redirected to a new page. This is useful when the
application is terminated -- or to change during the application from
HTTP to HTTPS and back.
- WValidationStatus API has changed -- less complicated now.