Project

General

Profile

Problems using Wt::WPaintedWidget

Added by Patrik Jeppsson over 13 years ago

Hi,

I've been evaluating Wt for a few days now and I really enjoy working with it.

I've managed to integrate some Qt-based code from another project and

everything seems to work just fine except for one thing.

They idea is that the (web-)server should be able to read some data from

another server (xml data) and then present the result to clients (some buttons

and simple graphics).

I thought it would be a good idea begin with presenting a few basic objects

like triangles, boxes and so forth. So, what I did was to reimplement the

WPaintedWidget::paintEvent() method to draw a blue box using WPainter::fillRect().

I created a few instances of my own WPainterWidget called CPaintArea and put them

in a WContainerWidget.

Using firebug in Firefox I can see that all the boxes excist and are positioned

correctly but I can't see them at all...

If it's any help my object hierarchy:

CMainWindow (WContainerWidget)

  • CView (CWContainerWidget)
  • CPaintArea (my boxes, a very basic impl. of WPaintedWidget)

I need this "WContainerWidget in WContainerWidget" hierachy since

I might need to present CViews in CViews, so to speak.

Any idea of what might be wrong?


Replies (3)

RE: Problems using Wt::WPaintedWidget - Added by Patrik Jeppsson over 13 years ago

It might be of interest that I do get a call to WPaintedWidget::paintEvent(Wt::WPaintDevice*)

so it should be able to draw itself.

Oh, and I have this red "Loading..." text in the upper right corner

that I can't remember putting there. Maybe that's related to my problem?

RE: Problems using Wt::WPaintedWidget - Added by Koen Deforche over 13 years ago

Hey,

The Loading... indicator is not good.

It points to an error either in the client-side code or the server-side process that crashed ? In any case, Firebug should tell you if there was a JavaScript error (normally, Wt should not generate such errors).

Did you give a size to your painted widgets ? They need to be set explicitly a size using resize().

Regards,

koen

RE: Problems using Wt::WPaintedWidget - Added by Patrik Jeppsson over 13 years ago

Hey,

Thanks for your reply. The Loading... indicator disapperad on it's own somehow.

I do know that my server code didn't crash though since I were running it through

a debugger.

I've managed to solve my problem with WPaintedWidget by resizing them, thanks a lot!

    (1-3/3)