Qt widget flickering on resize on a Mac machine
<p>I am trying to move and resize a QWidget based on the mainWindow's position. Following is my code. This code works perfectly fine on Qt on a windows machine.</p>

<p>However, when I run the same qt project on a mac machine, the myWidget lags before moving to the MainWindow position. Also, myWidget flickers when I resize the MainWindow. I have tried to run the code in update block inside paint events and move events as well. They work correctly on a windows machine but I get the same flickering and lag on a Mac.</p>

<p>Could someone tell me why and any ways to correct this?</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);

    panelWidth=this-&gt;width();
    myWidget-&gt;resize(panelWidth,panelHeight-50);
    myWidget-&gt;setWindowFlags(Qt::WindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint));
    myWidget-&gt;setAttribute(Qt::WA_TranslucentBackground);

    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(update()));
    timer-&gt;start(10);

}
void MainWindow::update()
{
    panelWidth=this-&gt;width();
    panelHeight=this-&gt;height();

   myWidget-&gt;move(this-&gt;pos().x(),this-&gt;pos().y()+30);
   myWidget-&gt;resize(panelWidth,panelHeight-50);
   
}</code></pre>
</div>
</div>
</p>