forked from qt-creator/qt-creator
QmlDesigner.EasingPane: fixed displaying issues
This commit is contained in:
@@ -7,9 +7,6 @@
|
|||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QSequentialAnimationGroup>
|
#include <QSequentialAnimationGroup>
|
||||||
|
|
||||||
#include <qdebug.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
class PixmapItem : public QObject, public QGraphicsPixmapItem
|
class PixmapItem : public QObject, public QGraphicsPixmapItem
|
||||||
@@ -24,12 +21,15 @@ class EasingSimulation : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EasingSimulation(QObject *parent=0, int length=210):QObject(parent) {
|
QGraphicsView *m_g;
|
||||||
|
EasingSimulation(QObject *parent=0, QGraphicsView *v=0):QObject(parent) {
|
||||||
m_qtLogo = new PixmapItem(QPixmap(":/qt_logo.png"));
|
m_qtLogo = new PixmapItem(QPixmap(":/qt_logo.png"));
|
||||||
m_scene.addItem(m_qtLogo);
|
m_scene.addItem(m_qtLogo);
|
||||||
m_scene.setSceneRect(0,0,length,m_qtLogo->boundingRect().height());
|
m_scene.setSceneRect(0,0,v->viewport()->width(),m_qtLogo->boundingRect().height());
|
||||||
m_qtLogo->hide();
|
m_qtLogo->hide();
|
||||||
m_sequential = 0;
|
m_sequential = 0;
|
||||||
|
m_g = v;
|
||||||
|
m_g->setScene(&m_scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
~EasingSimulation() { delete m_qtLogo; }
|
~EasingSimulation() { delete m_qtLogo; }
|
||||||
@@ -37,7 +37,10 @@ public:
|
|||||||
QGraphicsScene *scene() { return &m_scene; }
|
QGraphicsScene *scene() { return &m_scene; }
|
||||||
void show() { m_qtLogo->show(); }
|
void show() { m_qtLogo->show(); }
|
||||||
void hide() { m_qtLogo->hide(); }
|
void hide() { m_qtLogo->hide(); }
|
||||||
void reset() { m_qtLogo->setPos(0,0); }
|
void reset() {
|
||||||
|
m_qtLogo->setPos(0,0);
|
||||||
|
m_scene.setSceneRect(0,0,m_g->viewport()->width(),m_qtLogo->boundingRect().height());
|
||||||
|
}
|
||||||
void stop() {
|
void stop() {
|
||||||
if (m_sequential) {
|
if (m_sequential) {
|
||||||
m_sequential->stop();
|
m_sequential->stop();
|
||||||
@@ -90,8 +93,8 @@ EasingContextPane::EasingContextPane(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
m_simulation = new EasingSimulation(this, 210);
|
m_simulation = new EasingSimulation(this,ui->graphicsView);
|
||||||
ui->graphicsView->setScene(m_simulation->scene());
|
// ui->graphicsView->setScene(m_simulation->scene());
|
||||||
|
|
||||||
m_easingGraph = new EasingGraph(this);
|
m_easingGraph = new EasingGraph(this);
|
||||||
m_easingGraph->raise();
|
m_easingGraph->raise();
|
||||||
@@ -349,11 +352,6 @@ void QmlDesigner::EasingContextPane::on_overshootSpinBox_valueChanged(double new
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlDesigner::EasingContextPane::on_graphSelectButton_clicked()
|
|
||||||
{
|
|
||||||
setGraphDisplayMode(m_displayMode==GraphMode?SimulationMode:GraphMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlDesigner::EasingContextPane::on_playButton_clicked()
|
void QmlDesigner::EasingContextPane::on_playButton_clicked()
|
||||||
{
|
{
|
||||||
setGraphDisplayMode(SimulationMode);
|
setGraphDisplayMode(SimulationMode);
|
||||||
|
@@ -38,7 +38,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void propertyChanged(const QString &, const QVariant &);
|
void propertyChanged(const QString &, const QVariant &);
|
||||||
void removeProperty(const QString &);
|
void removeProperty(const QString &);
|
||||||
void removeAndChangeProperty(const QString &, const QString &, const QVariant &);
|
void removeAndChangeProperty(const QString &, const QString &, const QVariant &, bool);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e);
|
||||||
@@ -58,7 +58,6 @@ private:
|
|||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void on_playButton_clicked();
|
void on_playButton_clicked();
|
||||||
void on_graphSelectButton_clicked();
|
|
||||||
void on_overshootSpinBox_valueChanged(double );
|
void on_overshootSpinBox_valueChanged(double );
|
||||||
void on_periodSpinBox_valueChanged(double );
|
void on_periodSpinBox_valueChanged(double );
|
||||||
void on_amplitudeSpinBox_valueChanged(double );
|
void on_amplitudeSpinBox_valueChanged(double );
|
||||||
|
@@ -282,7 +282,7 @@ QWidget* ContextPaneWidget::createEasingWidget()
|
|||||||
|
|
||||||
connect(m_easingWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
|
connect(m_easingWidget, SIGNAL(propertyChanged(QString,QVariant)), this, SIGNAL(propertyChanged(QString,QVariant)));
|
||||||
connect(m_easingWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
|
connect(m_easingWidget, SIGNAL(removeProperty(QString)), this, SIGNAL(removeProperty(QString)));
|
||||||
connect(m_easingWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant)));
|
connect(m_easingWidget, SIGNAL(removeAndChangeProperty(QString,QString,QVariant,bool)), this, SIGNAL(removeAndChangeProperty(QString,QString,QVariant, bool)));
|
||||||
|
|
||||||
return m_easingWidget;
|
return m_easingWidget;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user