# QtWebKit

**URL:** <https://discuss.avogadro.cc/t/qtwebkit/2162>\
**Category:** Development\
**Created:** [June 5, 2012, 9:40pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162 "2012-06-05T21:40:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [June 5, 2012, 9:40pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/1 "2012-06-05T21:40:27Z")

</div>

Hi everyone,

I just finished a new revision of the polymer builder, which embeds previews of the monomers using SVG and QtWebKit (see attached).

Now, this does add a small dependency, since we did not previously require QtWebKit, but I think the benefit is high, and we’ll probably start to use embedded web views more. (For example, perhaps the input generators could be done with HTML + JavaScript?)

Thoughts? Concerns?

-Geoff

* * *

Prof. Geoffrey Hutchison  
Department of Chemistry  
University of Pittsburgh  
tel: (412) 648-0492  
email: [geoff.hutchison@gmail.com](mailto:geoff.hutchison@gmail.com)  
web: [http://hutchison.chem.pitt.edu/](http://hutchison.chem.pitt.edu/)

---

<div class="post-metadata">

**Author:** ![allison.vacanti](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/allison.vacanti/32/112_2.png) [@allison.vacanti](https://discuss.avogadro.cc/u/allison.vacanti)\
**Post date:** [June 5, 2012, 9:49pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/2 "2012-06-05T21:49:51Z")

</div>

On Tue, Jun 5, 2012 at 5:40 PM, Geoffrey Hutchison [geoff.hutchison@gmail.com](mailto:geoff.hutchison@gmail.com) wrote:

> I just finished a new revision of the polymer builder, which embeds  
> previews of the monomers using SVG and QtWebKit (see attached).
> 
> Now, this does add a small dependency, since we did not previously require  
> QtWebKit, but I think the benefit is high, and we’ll probably start to use  
> embedded web views more. (For example, perhaps the input generators could  
> be done with HTML + JavaScript?)

Very cool! I don’t think it will be a problem, I’d imagine that most  
packagers build Qt with webkit anyway, but Marcus would know more for sure.  
Was there no other way to display an SVG?

Now the important question: Can it use this openbabel painter?

> **[Painting molecules your way - Introducing the paint format](https://baoilleach.blogspot.com/2012/04/painting-molecules-your-way-introducing.html)**
>
> If the range of depiction output formats (PNG, SVG and ASCII currently) provided by Open Babel is not enough for you, you can easily draw mo...

🙂

Dave

---

<div class="post-metadata">

**Author:** ![Michael\_Banck](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@Michael\_Banck](https://discuss.avogadro.cc/u/Michael_Banck)\
**Post date:** [June 5, 2012, 9:51pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/3 "2012-06-05T21:51:46Z")

</div>

Hi,

On Tue, Jun 05, 2012 at 05:40:27PM -0400, Geoffrey Hutchison wrote:

> I just finished a new revision of the polymer builder, which embeds  
> previews of the monomers using SVG and QtWebKit (see attached).
> 
> Now, this does add a small dependency, since we did not previously  
> require QtWebKit, but I think the benefit is high, and we’ll probably  
> start to use embedded web views more. (For example, perhaps the input  
> generators could be done with HTML + JavaScript?)

As long as it does not bump the minimum required version of Qt, I would  
say it is a no-brainer - most people who have Qt should have QtWebKit as  
well I guess.

Michael

---

<div class="post-metadata">

**Author:** ![mhanwell](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/mhanwell/32/16_2.png) [@mhanwell](https://discuss.avogadro.cc/u/mhanwell)\
**Post date:** [June 5, 2012, 10:30pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/4 "2012-06-05T22:30:35Z")

</div>

On Tue, Jun 5, 2012 at 5:49 PM, David Lonie [david.lonie@kitware.com](mailto:david.lonie@kitware.com) wrote:

> On Tue, Jun 5, 2012 at 5:40 PM, Geoffrey Hutchison [geoff.hutchison@gmail.com](mailto:geoff.hutchison@gmail.com) wrote:
> 
> > I just finished a new revision of the polymer builder, which embeds  
> > previews of the monomers using SVG and QtWebKit (see attached).
> > 
> > Now, this does add a small dependency, since we did not previously require  
> > QtWebKit, but I think the benefit is high, and we’ll probably start to use  
> > embedded web views more. (For example, perhaps the input generators could be  
> > done with HTML + JavaScript?)
> 
> Very cool! I don’t think it will be a problem, I’d imagine that most  
> packagers build Qt with webkit anyway, but Marcus would know more for sure.  
> Was there no other way to display an SVG?
> 
> Now the important question: Can it use this openbabel  
> painter? [Noel O'Blog: Painting molecules your way - Introducing the paint format](http://baoilleach.blogspot.com/2012/04/painting-molecules-your-way-introducing.html)

It is a fairly large dependency (I think QtWebKit is a similar size to  
the rest of Qt), but most people who have Qt have it installed. There  
are some SVG rendering classes in Qt, but I think they were deprecated  
in Qt5 and don’t handle all of SVG very well.

I don’t see the value in using webkit for the input generators, but  
don’t object to using webkit for these in a plugin. It looks great,  
and I think for interactive web pages with teaching material etc this  
could be interesting.

I would like to focus on fixing some of the crashes reported by  
Michael before adding new features for 1.1.0, but remain flexible.

Once we have this release out it would be good to discuss some of the  
new work we have been doing for Avogadro 2.0. I have been seeing some  
great rendering performance increases using GLSL/impostor spheres, it  
leads to a simpler but quite different API for engines too.

Marcus

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [June 6, 2012, 2:04am UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/5 "2012-06-06T02:04:40Z")

</div>

> As long as it does not bump the minimum required version of Qt,

Nope. It existed as far back as Qt 4.4.

> It is a fairly large dependency (I think QtWebKit is a similar size to  
> the rest of Qt), but most people who have Qt have it installed. There  
> are some SVG rendering classes in Qt, but I think they were deprecated  
> in Qt5 and don’t handle all of SVG very well.

Right. I think they intended to improve the SVG code and then after adopting WebKit, it made zero sense. Why offer two SVG implementations?

> I don’t see the value in using webkit for the input generators, but  
> don’t object to using webkit for these in a plugin.

The value of HTML+JavaScript for input generators is three-fold IMHO:

1. Each input generator would really just be an HTML file, so it’s easy to distribute or download new ones.
2. The barrier to entry is lower – external projects can clearly find someone willing to adapt HTML and JavaScript even if not C++/Qt.
3. It’s easier to customize – we don’t need to ship all input generators. In Avogadro 1.1, the menu is getting quite long! Imagine if we also supported VASP, Erekale, GROMACS, etc.

> I would like to focus on fixing some of the crashes reported by  
> Michael before adding new features for 1.1.0, but remain flexible.

As some of you know, I am currently finishing a contract/grant through the US DoD (or more correctly, their computational chemistry researchers) for a set of features. The project must complete by June 22nd, when we have to deliver source + binaries. While I’d also like to fix a pile of bugs, I’m in bigger trouble if I don’t complete the set of requested features. They obviously would like to see Avogadro in general improve, but the polymer builder was a key feature request. The mountain of _other_ (non-coding) work is also large, but I have one remaining key feature to write – a distance geometry implementation to create amorphous, random polymer unit cells.

Whether these features “ship” in 1.1.0 or 1.1.1 or whatever is less important at the moment. (Although if someone can help me create a Windows binary, that would be wonderful.) There is a method to the patches which hit Gerrit right now.

> Once we have this release out it would be good to discuss some of the  
> new work we have been doing for Avogadro 2.0. I have been seeing some  
> great rendering performance increases using GLSL/impostor spheres

Yes, I think we’d all be interested to hear about some of the Avogadro 2.0 projects… but aren’t you also able to work on 1.1.0 bug fixes? 😉 Should we pick a day or week for bug-squashing?

-Geoff

---

<div class="post-metadata">

**Author:** ![Michael\_Banck](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@Michael\_Banck](https://discuss.avogadro.cc/u/Michael_Banck)\
**Post date:** [June 6, 2012, 9:52am UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/6 "2012-06-06T09:52:56Z")

</div>

On Tue, Jun 05, 2012 at 10:04:40PM -0400, Geoffrey Hutchison wrote:

> > I don’t see the value in using webkit for the input generators, but  
> > don’t object to using webkit for these in a plugin.
> 
> The value of HTML+JavaScript for input generators is three-fold IMHO:
> 
> 1. Each input generator would really just be an HTML file, so it’s  
> easy to distribute or download new ones.
> 2. The barrier to entry is lower – external projects can clearly find  
> someone willing to adapt HTML and JavaScript even if not C++/Qt.
> 3. It’s easier to customize – we don’t need to ship all input  
> generators. In Avogadro 1.1, the menu is getting quite long! Imagine  
> if we also supported VASP, Erekale, GROMACS, etc.

I think the way forward would be to group input generators by field,  
e.g. molecular semi-empirical/ab-initio, periodical and molecular  
dynamics and then figure out a set of common base features (like, HF,  
MP2, CCSD) every input generator would provide, plus an input element to  
switch between Codes (GAMESS, NWChem and so on).

Michael

---

<div class="post-metadata">

**Author:** ![mhanwell](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/mhanwell/32/16_2.png) [@mhanwell](https://discuss.avogadro.cc/u/mhanwell)\
**Post date:** [June 6, 2012, 2:59pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/7 "2012-06-06T14:59:11Z")

</div>

On Tue, Jun 5, 2012 at 10:04 PM, Geoffrey Hutchison [geoff.hutchison@gmail.com](mailto:geoff.hutchison@gmail.com) wrote:

> > I don’t see the value in using webkit for the input generators, but  
> > don’t object to using webkit for these in a plugin.
> 
> The value of HTML+JavaScript for input generators is three-fold IMHO:
> 
> 1. Each input generator would really just be an HTML file, so it’s easy to distribute or download new ones.
> 2. The barrier to entry is lower – external projects can clearly find someone willing to adapt HTML and JavaScript even if not C++/Qt.
> 3. It’s easier to customize – we don’t need to ship all input generators. In Avogadro 1.1, the menu is getting quite long! Imagine if we also supported VASP, Erekale, GROMACS, etc.

I think there are other solutions to this, but would be interested  
what you come up with. I was hoping to prototype something more  
dynamic than requiring C++, but simpler than HTML + JavaScript. It  
would certainly be good to come up with something easier for people to  
edit, but Python or simple template approaches could also be viable.

> > I would like to focus on fixing some of the crashes reported by  
> > Michael before adding new features for 1.1.0, but remain flexible.
> 
> As some of you know, I am currently finishing a contract/grant through the US DoD (or more correctly, their computational chemistry researchers) for a set of features. The project must complete by June 22nd, when we have to deliver source + binaries. While I’d also like to fix a pile of bugs, I’m in bigger trouble if I don’t complete the set of requested features. They obviously would like to see Avogadro in general improve, but the polymer builder was a key feature request. The mountain of _other_ (non-coding) work is also large, but I have one remaining key feature to write – a distance geometry implementation to create amorphous, random polymer unit cells.
> 
> Whether these features “ship” in 1.1.0 or 1.1.1 or whatever is less important at the moment. (Although if someone can help me create a Windows binary, that would be wonderful.) There is a method to the patches which hit Gerrit right now.

I think 1.1.0 would be good to release with minimal extra features at  
this point, but I was hoping to have it tagged already. It is nice to  
have some background on the timing of what you are pushing. I also  
have deliverables to work towards, and a mountain of other work…

> > Once we have this release out it would be good to discuss some of the  
> > new work we have been doing for Avogadro 2.0. I have been seeing some  
> > great rendering performance increases using GLSL/impostor spheres
> 
> Yes, I think we’d all be interested to hear about some of the Avogadro 2.0 projects… but aren’t you also able to work on 1.1.0 bug fixes? 😉 Should we pick a day or week for bug-squashing?

I will get some done over the next day or two, and we could make  
another feature release in the next month or two.

Marcus

---

<div class="post-metadata">

**Author:** ![Michael\_Banck](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@Michael\_Banck](https://discuss.avogadro.cc/u/Michael_Banck)\
**Post date:** [June 6, 2012, 6:10pm UTC](https://discuss.avogadro.cc/t/qtwebkit/2162/8 "2012-06-06T18:10:06Z")

</div>

Hi,

On Wed, Jun 06, 2012 at 10:59:11AM -0400, Marcus D. Hanwell wrote:

> On Tue, Jun 5, 2012 at 10:04 PM, Geoffrey Hutchison [geoff.hutchison@gmail.com](mailto:geoff.hutchison@gmail.com) wrote:
> 
> > Whether these features “ship” in 1.1.0 or 1.1.1 or whatever is less  
> > important at the moment. (Although if someone can help me create a  
> > Windows binary, that would be wonderful.) There is a method to the  
> > patches which hit Gerrit right now.
> 
> I think 1.1.0 would be good to release with minimal extra features at  
> this point, but I was hoping to have it tagged already.

The Debian freeze is approaching (said to happen in June), but not  
making it will not be the end of the world, we can still ship it as a  
backport I guess.

Michael
