diff options
author | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2011-07-20 21:34:27 -0300 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> | 2011-07-21 12:04:29 -0300 |
commit | 9b3437aca096e90b39c9508265f6ecced1c56dec (patch) | |
tree | aa40cac34782f1eab27cf4beb5f59fcde740cfc0 /snowshoe.pro | |
parent | b0801b91ff5d6577334fe44201b07ea6001d0740 (diff) |
Create a BrowserObject to expose functionality to QML
This commit adds a BrowserObject object, that will expose functionality
to QML, rather than making C++ peeking on QML to see what it needs to do.
The name is "long/unusual" to avoid clashing with QML ids.
The first property exposed is the windowTitle, so we can do the
controlling logic in QML world. In this commit we use a Binding {} object
to connect the windowTitle with the active tab title.
Our previous approach was to make C++ listen to the right titleChanged
and change itself. And there was a bug on it, if one page in a tab not
active changed the title (via document.title = "hahaha"), it would change
the title of the window.
Reviewed-by: Alexis Menard
Diffstat (limited to 'snowshoe.pro')
-rw-r--r-- | snowshoe.pro | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/snowshoe.pro b/snowshoe.pro index 2b7ccf8..2f4c47d 100644 --- a/snowshoe.pro +++ b/snowshoe.pro @@ -5,12 +5,14 @@ QT += declarative SOURCES += \ main.cpp \ + BrowserObject.cpp \ BrowserWindow.cpp \ MainView.cpp \ DeclarativeDesktopWebView.cpp \ TripleClickMonitor.cpp HEADERS += \ + BrowserObject.h \ BrowserWindow.h \ MainView.h \ DeclarativeDesktopWebView.h \ |