Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Trigering a repaint event
Qt 6.11 is out! See what's new in the release blog

Trigering a repaint event

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • musimbateM Offline
    musimbateM Offline
    musimbate
    wrote on last edited by
    #1

    Hi all,I am trying to get a window to be repainted after some set up and I find it weird that it is not being repainted after calling update() .I have even called repaint() on the window and nothing happened.Has anybody run into such a problem before ?If yes I would really appreciate it if you shared.

    Thanks.

    Why join the navy if you can be a pirate?-Steve Jobs

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Are updates enabled (QWidget::setUpdatesEnabled)? Or are we talking about QtQuick? Then you need to set the item dirty (QQuickItem::ItemHasContents) before it will update. See "the doc":http://doc-snapshot.qt-project.org/5.0/qtquick/qquickitem.html#updatePaintNode.

      (Z(:^

      1 Reply Last reply
      0
      • musimbateM Offline
        musimbateM Offline
        musimbate
        wrote on last edited by
        #3

        I checked that the updates are enabled and they are.I have tried every idea I could come up with and no luck so far.Here is what I want to achieve.I have a bunch of control buttons on my main window and I want to use them to control the position of the palettes(LEFT/RIGHT).

        Here is my slot that responds to a button push:
        @void UBBoardPaletteManager::leftRightButtonClicked()
        {

        UBApplication::boardController->paletteManager()->leftPalette()->setOrientation(eUBDockOrientation_Right);
        UBApplication::boardController->paletteManager()->leftPalette()->repaint();
        UBApplication::mainWindow->repaint();
        UBApplication::app()->processEvents(QEventLoop::AllEvents);
        }@

        and in the constructor of the palette I made sure that updates are enabled by the following code:

        @UBLeftPalette::UBLeftPalette(QWidget *parent, const char *name):
        UBDockPalette(eUBDockPaletteType_LEFT, parent)
        {
        ............

            setUpdatesEnabled(true);
        

        }@

        With this setup it is my belief that after the button is pushed ,the palette(widget) should automatically be redrawn and positioned where i want it to be.

        Is something wrong with my idea flow?Thanks for your time.

        Why join the navy if you can be a pirate?-Steve Jobs

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved