Re: [Development] Problem porting app from Qt4 to Qt5 with multiple X-screen

2015-02-10 Thread Christian Ehrlicher
 Von: Christian Ehrlicher ch.ehrlic...@gmx.de
 Am 09.02.2015 um 15:35 schrieb Friedemann Kleint:
  Hi,
 
  we've multiple X-screens configured (:0.0 ... :0.3) but Qt5 seems to
  have lost the ability to display something on another screen than the
  default
   QMainWindow *wm = new QMainWindow(dw-screen(1));
 
  Change https://codereview.qt-project.org/#/c/105285/ for
  https://bugreports.qt.io/browse/QTBUG-44070[https://bugreports.qt.io/browse/QTBUG-44070]
   should improve that.
 Thx for the info. I'll check this out tomorrow and report back if my
 issues are all gone :)
Ok, now at least all widgets with a desktop widget as parent are created on the 
correct screen. But as soon as I open a child window (e.g. the file open dialog 
on my example) this is created on the applications primary screen.
Should I fill a bug report for this?


btw: Is it correct that QScreen::geometry() returns 0/0 every time (openSUSE 
13.2/Qt 5.3.2 rpm)

Christian
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Problem porting app from Qt4 to Qt5 with multiple X-screen

2015-02-10 Thread Friedemann Kleint
Hi,

 Ok, now at least all widgets with a desktop widget as parent are 
created on the correct screen. But as soon as I open a child window 
(e.g. the file open dialog on my example) this is created on the 
applications primary screen. Should I fill a bug report for this?

Yes please, with a small example (see 
http://qt-project.org/wiki/ReportingBugsInQt ) . Do you pass a parent 
widget to the dialog?

 Qt4 I'm using QX11EmbedWidget/EmbedContainer.
  In Qt5 I use QWidget::createWindowContainer() + 
QWindow::fromWinId(). The simple testcase (a QWidget on client and 
server side) works as expected but I my application it does

To my knowledge, the window container functionality is not intended for 
this purpose ( see related issue 
https://bugreports.qt.io/browse/QTBUG-34771 ).

 btw: Is it correct that QScreen::geometry() returns 0/0 every time 
(openSUSE 13.2/Qt 5.3.2 rpm)

As size?  -  it should report the correct geometry. Which desktop 
environment is this?

Regards,
Friedemann

-- 
Friedemann Kleint | The Qt Company

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Problem porting app from Qt4 to Qt5 with multiple X-screen

2015-02-09 Thread Christian Ehrlicher
Am 09.02.2015 um 15:35 schrieb Friedemann Kleint:
 Hi,

   we've multiple X-screens configured (:0.0 ... :0.3) but Qt5 seems to
 have lost the ability to display something on another screen than the
 default
QMainWindow *wm = new QMainWindow(dw-screen(1));

 Change https://codereview.qt-project.org/#/c/105285/ for
 https://bugreports.qt.io/browse/QTBUG-44070 should improve that.
Thx for the info. I'll check this out tomorrow and report back if my 
issues are all gone :)

   embedding an application window into another application doesn't work
 correct - the embeded window gets resized with the master but as soon as
 I click somewhere in the master, the embedded window is hidden by the
 master.

 How do you embed the window?
In Qt4 I'm using QX11EmbedWidget/EmbedContainer. In Qt5 I use 
QWidget::createWindowContainer() + QWindow::fromWinId(). The simple 
testcase (a QWidget on client and server side) works as expected but I 
my application it does not work. I could not yet figure out which side 
is the problem - on the server site I want to use it as centralWidget() 
of a QMainWindow, on the client side it's a QWidget with custom 
paintings outside the paintevent. I hope to get to this tomorrow evening.

Christian
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Problem porting app from Qt4 to Qt5 with multiple X-screen

2015-02-09 Thread Christian Ehrlicher
Hi,



Im trying to port a Qt4 application to Qt5. All works fine except two points:

- weve multiple X-screens configured (:0.0 ... :0.3) but Qt5 seems to have lost the ability to display something on another screen than the default

- embedding an application window into another application doesnt work correct - the embeded window gets resized with the master but as soon as I click somewhere in the master, the embedded window is hidden by the master.

The second problem can maybe worked around by merging the two applications into one (its on my todo) but its still a problem in qt then...



The first problem can be shown with a small testcase:

-

int main(int argc, char** argv)
{
 QApplication app(argc, argv);
 QDesktopWidget *dw = app.desktop();
 QMainWindow *wm = new QMainWindow(dw-screen(1));
 wm-winId(); // not needed with Qt4
 wm-windowHandle()-setScreen(QGuiApplication::screens().at(1)); // not needed with Qt4
 wm-show();
 QFileDialog::getOpenFileName(wm);
 return app.exec();
}
-

It looks like the parentwidgets screen is not respected when the child is created. The QMainWindow can be shown on screen 1 with the help of QWindow::setScreen() but all children of QMainWindow are displayed on the default screen instead the one where the parent lives.

I tried to dig into the sources to see whats going wrong but Im lost somewhere between QWindow and the xcb plugin... :(



Anyone an idea where to look further or what could went wrong here?



Thx,

Christian Ehrlicher




___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Problem porting app from Qt4 to Qt5 with multiple X-screen

2015-02-09 Thread Friedemann Kleint
Hi,

 we've multiple X-screens configured (:0.0 ... :0.3) but Qt5 seems to 
have lost the ability to display something on another screen than the 
default
  QMainWindow *wm = new QMainWindow(dw-screen(1));

Change https://codereview.qt-project.org/#/c/105285/ for 
https://bugreports.qt.io/browse/QTBUG-44070 should improve that.

 embedding an application window into another application doesn't work 
correct - the embeded window gets resized with the master but as soon as 
I click somewhere in the master, the embedded window is hidden by the 
master.

How do you embed the window?

Regards,
Friedemann

-- 
Friedemann Kleint | The Qt Company

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development