Results 1 to 11 of 11

Thread: Custom dialog

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Custom dialog

    here is an example with opacity animation (if I understand you correctly)
    Qt Code:
    1. void Test::setLabelOpacity(int opacity)
    2. {
    3. m_label->setWindowOpacity(opacity / 100.0);
    4. }
    5.  
    6. void Test::showLabel()
    7. {
    8. QPixmap pixmap(300, 300);
    9. QPainter painter(&pixmap);
    10. QRectF rectangle(0.0, 0.0, 299.0, 299.0);
    11. painter.setBrush(Qt::red);
    12. painter.setPen(Qt::red);
    13. painter.drawRoundedRect(rectangle, 20.0, 15.0);
    14.  
    15. m_label = new QLabel();
    16. m_label->setMask(QBitmap(pixmap));
    17. m_label->setPixmap(pixmap);
    18. m_label->setAttribute(Qt::WA_DeleteOnClose);
    19.  
    20.  
    21. QTimeLine *timeLine = new QTimeLine(1000, this);
    22. timeLine->setCurveShape(QTimeLine::LinearCurve);
    23. timeLine->setFrameRange(0, 100);
    24. connect(timeLine, SIGNAL(frameChanged(int)), SLOT(setLabelOpacity(int)));
    25. timeLine->start();
    26.  
    27. m_label->setWindowOpacity(0);
    28. m_label->show();
    29. }
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. The following user says thank you to spirit for this useful post:

    simol (1st April 2009)

Similar Threads

  1. Issue with Modelless dialog on Mac
    By Satyanarayana Chebrolu in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2009, 10:10
  2. Replies: 9
    Last Post: 13th August 2008, 18:07
  3. Replies: 3
    Last Post: 18th October 2007, 08:07
  4. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  5. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48

Tags for this Thread

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.