<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QPropertyAnimation, partially works.]]></title><description><![CDATA[<p dir="auto">Hi guys I have a query about QPropertyAnimation, I have a form with a QTableView where I show data, and then below in a GroupBox some controls, which together are the details, I made an animation to show that GroupBox, when I clicked on a button , it is shown and hidden well, but when you continue clicking it no longer shows anything, any suggestion would be appreciated, greetings.<br />
I leave my code.</p>
<pre><code>#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include &lt;QMainWindow&gt;
#include &lt;QSqlDatabase&gt;
#include &lt;QSqlTableModel&gt;

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
  Q_OBJECT

public:
  MainWindow(QWidget *parent = nullptr);
  ~MainWindow();

private slots:
  void on_btnMostrar_clicked();

private:
  Ui::MainWindow *ui;
  QSqlDatabase mDb;
  QSqlTableModel *model;
  int _height=0;
  int endValue=0;
  bool showDetails=false;

};
#endif // MAINWINDOW_H

</code></pre>
<pre><code>#include "mainwindow.h"
#include "ui_mainwindow.h"
#include &lt;QSqlError&gt;
#include &lt;QMessageBox&gt;
#include &lt;QtDebug&gt;
#include &lt;QPropertyAnimation&gt;
#include &lt;QDebug&gt;

MainWindow::MainWindow(QWidget *parent)
  : QMainWindow(parent), ui(new Ui::MainWindow)
{
  ui-&gt;setupUi(this);
  qInfo()&lt;&lt;mDb.drivers();
  mDb=QSqlDatabase::addDatabase("QPSQL");
  if(!mDb.isDriverAvailable("QPSQL")){
      QMessageBox::critical(this,qApp-&gt;applicationName(),mDb.lastError().text());
      return;
    }
  mDb.setPort(5432);
  mDb.setHostName("localhost");
  mDb.setDatabaseName("covid");
  mDb.setUserName("postgres");
  mDb.setPassword("password");
  if(!mDb.open()){
      QMessageBox::critical(this,qApp-&gt;applicationName(), mDb.lastError().text());
      return;
    }
  model=new QSqlTableModel(this);
  model-&gt;setTable("datos");
  model-&gt;select();
  
  ui-&gt;tableView-&gt;setModel(model);
  ui-&gt;gbDatos-&gt;setVisible(false);
//  ui-&gt;btnMostrar-&gt;setCheckable(true);

}

MainWindow::~MainWindow()
{
  delete ui;
}
void MainWindow::on_btnMostrar_clicked()
{
  if(showDetails==true)
    _height=this-&gt;height();
  else
    _height=this-&gt;height()-ui-&gt;gbDatos-&gt;height();

  if(_height==293){
      endValue=this-&gt;height();
      showDetails=true;
      ui-&gt;gbDatos-&gt;setVisible(true);
    }else{
      endValue=293;
      showDetails=false;
      ui-&gt;gbDatos-&gt;setVisible(false);
    }

  QPropertyAnimation *animate=new QPropertyAnimation(this,"minimumHeight");
  animate-&gt;setDuration(1000);
  animate-&gt;setStartValue(_height);
  animate-&gt;setEndValue(endValue);
  animate-&gt;setEasingCurve(QEasingCurve::OutQuad);
  animate-&gt;start();
}
</code></pre>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/165c6c0e-4edb-4c70-b3e5-0002f97763fe.png" alt="a32f0005-4059-4de7-93d7-d9b69e82cf21-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/b718c961-3763-4464-bc2f-cc7e41c9fa23.png" alt="90ab815f-95ae-48bf-ba4e-3d802b043593-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/120033/qpropertyanimation-partially-works</link><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 14:24:46 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/120033.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Oct 2020 01:10:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QPropertyAnimation, partially works. on Sun, 18 Oct 2020 18:24:17 GMT]]></title><description><![CDATA[<p dir="auto">You can use for example the size hint to get the estimated final size of your widget.</p>
]]></description><link>https://forum.qt.io/post/622881</link><guid isPermaLink="true">https://forum.qt.io/post/622881</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 18 Oct 2020 18:24:17 GMT</pubDate></item><item><title><![CDATA[Reply to QPropertyAnimation, partially works. on Mon, 19 Oct 2020 18:47:11 GMT]]></title><description><![CDATA[<p dir="auto">great, fix my little problem, thanks.</p>
]]></description><link>https://forum.qt.io/post/623020</link><guid isPermaLink="true">https://forum.qt.io/post/623020</guid><dc:creator><![CDATA[lincoln]]></dc:creator><pubDate>Mon, 19 Oct 2020 18:47:11 GMT</pubDate></item><item><title><![CDATA[Reply to QPropertyAnimation, partially works. on Sun, 18 Oct 2020 18:24:17 GMT]]></title><description><![CDATA[<p dir="auto">You can use for example the size hint to get the estimated final size of your widget.</p>
]]></description><link>https://forum.qt.io/post/622881</link><guid isPermaLink="true">https://forum.qt.io/post/622881</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 18 Oct 2020 18:24:17 GMT</pubDate></item><item><title><![CDATA[Reply to QPropertyAnimation, partially works. on Sun, 18 Oct 2020 03:38:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/622736">QPropertyAnimation, partially works.</a>:</p>
<blockquote>
<p dir="auto">293 looks like a magic number that is going to get you in trouble.<br />
You should not rely on that kind of value for your animations.</p>
</blockquote>
<p dir="auto">And then what should I use, would be the question.</p>
]]></description><link>https://forum.qt.io/post/622763</link><guid isPermaLink="true">https://forum.qt.io/post/622763</guid><dc:creator><![CDATA[lincoln]]></dc:creator><pubDate>Sun, 18 Oct 2020 03:38:32 GMT</pubDate></item><item><title><![CDATA[Reply to QPropertyAnimation, partially works. on Sat, 17 Oct 2020 18:10:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">293 looks like a magic number that is going to get you in trouble.</p>
<p dir="auto">You should not rely on that kind of value for your animations.</p>
]]></description><link>https://forum.qt.io/post/622736</link><guid isPermaLink="true">https://forum.qt.io/post/622736</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sat, 17 Oct 2020 18:10:09 GMT</pubDate></item></channel></rss>