Results 1 to 5 of 5

Thread: Sliding effect of widgets created using QQuickWidget.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Sliding effect of widgets created using QQuickWidget.

    hello,

    Can you please elaborate with an example.
    actually, going forward we might have multiple qmls and dynamic object(qml).
    and the screen size will be fixed in which we want sliding effect for all the screens

    below is code code snippet I was trying today. though it is not working.

    Qt Code:
    1. //mainwindow.cpp
    2. void MainWindow ::addNewImage()
    3. {
    4.  
    5. QQuickWidget *mQQuickWidget1 = new QQuickWidget();
    6.  
    7. //QWidget *container1 = QWidget::createWindowContainer(view1,this );
    8. mQQuickWidget1->setSource(QUrl("qrc:/qml/res/layouts/AndroidDelegate.qml"));
    9. ui->verticalLayout->insertWidget(ui->verticalLayout->count() - 1,mQQuickWidget1,0,Qt::AlignCenter);
    10. /*newly added code for animation*/
    11. QPropertyAnimation *animation = new QPropertyAnimation(mQQuickWidget1,"pos",this);
    12. QRect pix = QRect(QPoint(0,0), mQQuickWidget1->size());
    13. pix.moveCenter(QPoint(width()/2,0));
    14.  
    15. animation->setDuration(2000);
    16. animation->setStartValue(QPoint(-(mQQuickWidget1->width()),mQQuickWidget1->x()));
    17. animation->setEndValue(QPoint(pix.y(),mQQuickWidget1->x()));
    18. // animation->easingCurve(QEasingCurve::OutBounce);
    19. animation->start();
    20.  
    21. mQQuickWidget->hide();
    22. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 8th March 2016 at 09:45. Reason: missing [code] tags

Similar Threads

  1. Widgets must be created in the GUI thread.
    By Thành Viên Mới in forum Qt Programming
    Replies: 10
    Last Post: 8th November 2011, 16:53
  2. Replies: 2
    Last Post: 22nd April 2011, 13:38
  3. How to access Widgets created in Tab View
    By kapoorsudhish in forum Newbie
    Replies: 5
    Last Post: 23rd October 2009, 13:12
  4. Zooming effect by scaling widgets
    By Cruz in forum Qt Programming
    Replies: 3
    Last Post: 1st February 2009, 09:43
  5. is it possible to animate sliding widgets on show/hide
    By discostu in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2007, 08:59

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
  •  
Qt is a trademark of The Qt Company.