QtRoot 5.34 and X11 errors

Hi Valeri,

[quote=“fine”]Did you try that on Windows ?[/quote]Yes, on Windows and on Linux (SLC6)… why?

Cheers, Bertrand.

[quote=“bellenot”]Hi Valeri,

[quote=“fine”]Did you try that on Windows ?[/quote]Yes, on Windows and on Linux (SLC6)… why?

Cheers, Bertrand.[/quote]It should generate the avalanche of update events.

Well, OK, maybe one could filter it like this:

//______________________________________________________________________________
void QMainCanvas::changeEvent(QEvent * e)
{
   if (e->type() == QEvent ::WindowStateChange) {
      QWindowStateChangeEvent * event = static_cast< QWindowStateChangeEvent * >( e );
      if (( event->oldState() & Qt::WindowMaximized ) ||
          ( event->oldState() & Qt::WindowMinimized ) ||
          ( event->oldState() == Qt::WindowNoState && 
            this->windowState() == Qt::WindowMaximized )) {
         if (canvas->getCanvas()) {
            canvas->getCanvas()->Resize();
            canvas->getCanvas()->Update();
         }
      }
   }
}

Even with QMainCanvas::changeEvent() addition (I tried both variants, with or without state filtering) it does not really work for me. I made brief screencast to show what happens on my desktop, see dl.dropboxusercontent.com/u/569 … rding2.mp4. I added debugging print to see that changeEvent() is really called, you can see that in terminal window. Can this behavior depend on a window manager as well?

Well, yes, maybe… And it also probably depend on the version of Qt… (I successfully tried on Windows and Linux SLC6)

In case of interest, there’s an experimental fork of ROOT available that has integrated the most important parts of the Sourceforge QtRoot directly into CMake build system of a fork of ROOT’s 5.34-branch. The default CMake configuration builds with Qt5-support and an example application that has an auto resizing canvas in a grid layout. Note though that it has been developed and tested with only Windows, so no guarantees on other platforms. Many functionalities in QtRoot are missing though, because QtRoot was also ported from Qt4 to Qt5 in the process and many GUI elements were disabled in order to get build work, but basics such a TQtWidget etc. should work.


Hello,

I was having issues with ROOT and Qt. I inherited a monitoring GUI that embeds TCanvas into a Qt application and initially was unable to run due to libGpad errors which seems to have been fixed after re-configuring ROOT with X11 enabled and Cocoa disabled (I am on Mac OSX 10.10). To test whether the Gui is working I have tried the “simple_canvas” application pointed to above.

I am using Qt 5.6 and Root 5.34/34. In order to compile this application (simple_canvas) I have had to ad Qt+=widgets to the *.pro file and also I have had to remove the dependency on the library RGL (so I have removed the “-lRGL” from the LIBS in the *.pro file) as this library was not found in my ROOT lib/ directory.

When I run the application, the window opens but the canvas is entirely black (attached as “simple_canvas_gui”)


although when I save the canvas as an *.eps file I see the histogram and canvas has actually been drawn (attached as “test.eps”) test.eps (9.84 KB).

My console is also flooded with the Errors reported previously:

Error in : BadWindow (invalid Window parameter) (XID: 2506113776, XREQ: 2)
Error in : BadDrawable (invalid Pixmap or Window parameter) (XID: 2506113776, XREQ: 62)

My main concern though is the fact that the histogram/canvas is not shown when the application is running. Is this due to the library RGL missing (I am not entirely sure what this library is) or due to something that needs to be set (openGL) for Mac OS?

Thanks!