OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

QPropertyAnimation with openscengraph window


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
arfaa
Newbie


Joined: 27 Jul 2017
Posts: 5

PostPosted: Tue Aug 22, 2017 9:09 am    Post subject:
QPropertyAnimation with openscengraph window
Reply with quote

Hi, i have QWidget and i want him to disappear duration X time. In qt my code works:

...

Thank you!

Cheers,
Maxim
Code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPushButton>
#include <QPropertyAnimation>
#include <QGraphicsEffect>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect();
    ui->pushButton->setGraphicsEffect(eff);
    QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
    a->setDuration(3500);
    a->setStartValue(0);
    a->setEndValue(1);
    a->setEasingCurve(QEasingCurve::InCubic);
    a->start(QPropertyAnimation::DeleteWhenStopped);
    //connect(a,SIGNAL(finished()),this,SLOT(hideThisWidget()));

    connect(ui->pushButton, SIGNAL(clicked(bool)), this, SLOT(hideButton()) );

}

MainWindow::~MainWindow()
{
    delete ui;

}

void MainWindow::hideButton()
{
    QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect();
    ui->pushButton->setGraphicsEffect(eff);
    QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
    a->setDuration(3500);
    a->setStartValue(1);
    a->setEndValue(0);
    a->setEasingCurve(QEasingCurve::OutBack);
    a->start(QPropertyAnimation::DeleteWhenStopped);
}

but then i use this code with OSG, he doesn't work.

The window where everything happens is osgViewer::CompositeViewer.
How can I solve this problem?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts multiple window pick incorrect robertosfield General 1 Fri Aug 11, 2017 6:45 am View latest post
No new posts Prevent resizing with window decoration Meldryt General 2 Tue Aug 08, 2017 1:44 pm View latest post
No new posts How to use frame buffer object in exi... saedrna1 General 2 Sat Feb 18, 2017 3:54 am View latest post
No new posts Embed in SFML window, rendering probl... rebootl General 2 Mon Oct 31, 2016 5:27 pm View latest post
No new posts hook osg into other window saedrna1 General 4 Sun Jul 31, 2016 1:59 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP