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 problem with picking/intersecting in ... mue General 0 Sat Jun 09, 2018 11:18 am View latest post
No new posts OpenScenGraph-3.6.1 release candidate... robertosfield General 0 Thu Apr 26, 2018 9:40 am View latest post
No new posts OpenScenGraph 3.6 release candidate 5... robertosfield General 4 Wed Apr 04, 2018 2:50 pm View latest post
No new posts How to setup OSG for code block(windo... mayank General 0 Wed Jan 31, 2018 11:03 am View latest post
No new posts multiple window pick incorrect robertosfield General 1 Fri Aug 11, 2017 6:45 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