Results 1 to 10 of 10

Thread: QPropertyAnimation strange behavior only on Ubuntu

  1. #1
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QPropertyAnimation strange behavior only on Ubuntu

    Hi, I use following code to create "drop-down" dialog when user click 'more' button

    Qt Code:
    1. QPropertyAnimation *animation = new QPropertyAnimation(this, "size");
    2. animation->setDuration(150);
    3. animation->setStartValue(QSize(this->width(), this->height()));
    4. animation->setEndValue(QSize(this->width(), 360)); // on start has 250
    5. animation->start(QPropertyAnimation::DeleteWhenStopped);
    To copy to clipboard, switch view to plain text mode 

    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

    Qt Code:
    1. this->resize(this->width(), this->height()+360);
    To copy to clipboard, switch view to plain text mode 

    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.
    Last edited by atomic; 30th July 2015 at 19:46.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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,
    _

  3. #3
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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.

    untitled.zip

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    atomic (31st July 2015)

  6. #5
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    'Identical' you mean identical to Ubuntu so resize and unexpected moves?

  7. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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,
    _

  8. The following user says thank you to anda_skoa for this useful post:

    atomic (1st August 2015)

  9. #7
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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/0B1o...ew?usp=sharing

  10. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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,
    _

  11. #9
    Join Date
    Jan 2014
    Posts
    76
    Thanks
    17
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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,

  12. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QPropertyAnimation strange behavior only on Ubuntu

    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,
    _

Similar Threads

  1. Qt process strange behavior
    By rspock in forum Newbie
    Replies: 5
    Last Post: 15th March 2013, 17:11
  2. QSqlDatabase strange behavior
    By macav in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2011, 15:21
  3. strange behavior of paintEvent
    By hashb in forum Qt Programming
    Replies: 3
    Last Post: 30th August 2010, 07:48
  4. Weird behavior under Ubuntu Gnome
    By psih128 in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2010, 14:26
  5. Strange resize behavior
    By Lykurg in forum Newbie
    Replies: 3
    Last Post: 9th January 2007, 13:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.