PDA

View Full Version : QPropertyAnimation strange behavior only on Ubuntu



atomic
30th July 2015, 17:41
Hi, I use following code to create "drop-down" dialog when user click 'more' button



QPropertyAnimation *animation = new QPropertyAnimation(this, "size");
animation->setDuration(150);
animation->setStartValue(QSize(this->width(), this->height()));
animation->setEndValue(QSize(this->width(), 360)); // on start has 250
animation->start(QPropertyAnimation::DeleteWhenStopped);


and it works fine on windows but on ubuntu this code on every time when is called ( when user click 'more' button ) also moves dialog for top-left corner. Can you check this code on some linux distribution on simple dialog form?
What I am doing wrong? Maybe it is a bug Qt?

Thanks,

Edit.
Now i see that simple resize without animations


this->resize(this->width(), this->height()+360);

also moves my dialog window... why? How I can resize window on ubuntu / linux? It is problem of my code? System? Qt?
On Windows the same code works properly.

anda_skoa
30th July 2015, 21:16
Maybe the window manager used by Ubuntu tries to "balance" the resize, i.e. keep the windows center fixed.

You could try with a different window manager or try animating the geometry property.

If you attach a buildable example I am sure people with different setups would report back on how it works on their systems

Cheers,
_

atomic
31st July 2015, 09:50
Hi,
In attachment is simple example strange behavior of qpropertyanimation , if someone can please try run this code on ubuntu or other linux distro.

This code first run QDialog which works wrong - dialog is resized but also moves.
And after that when we close dialog, we see MainWindow and the same animation for MainWindow( top level window) works properly, strange...

For MainWindow QpropertyAnimation works fine but no for QDialog.

11300

anda_skoa
31st July 2015, 11:36
Behavior identical for both window types on Debian with Plasma Desktop version 4.11.13 using KWin 4.11.13 as its window manager.

Cheers,
_

atomic
31st July 2015, 12:20
'Identical' you mean identical to Ubuntu so resize and unexpected moves?

anda_skoa
31st July 2015, 15:30
I mean both windows show the same behavior.
When I click the button on the dialog, it expands downwards, it does not move.
When I click the button on the mainwindow, it expands downwards, it does not move.

Only if there is not enough vertical space left below either window, the window moves upwards as well.

Cheers,
_

atomic
1st August 2015, 07:33
Hi,

ok so think that I can report that behavior as issue QPropertyAnimation on Ubuntu to Qt.
Look on my short video when you can see whats happens.

Thanks,


https://drive.google.com/file/d/0B1okgMUSOFG9a3dhWWxmaTNPTkU/view?usp=sharing

anda_skoa
1st August 2015, 11:48
I doubt it has anything to do with the property animation, but you can verify that easily by resizing without animation.

If that shows the same behavior you would then check if it also applies to non-Qt windows.

If it does it is either a bug in the window manager used by Unity or expected behavior.

Cheers,
_

atomic
1st August 2015, 17:34
I doubt it has anything to do with the property animation, but you can verify that easily by resizing without animation.

Yes, behavior is the same ( wrong) for simple resize without animation, but only for dialog window, for main window it works properly.
But I created similar project in gtk+ and it works properly for main and also dialog window so this can be a bug inside Qt? Should I report this to Qt?

Thanks,

anda_skoa
2nd August 2015, 11:05
Try also with a different widget style to check if the behavior comes from that component or the dialog's base implementation.
Then reports against the respective component.

Cheers,
_