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. Impossible to use repaint() again
Qt 6.11 is out! See what's new in the release blog

Impossible to use repaint() again

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • A Offline
    A Offline
    akonshi
    wrote on last edited by
    #1

    Hello everyone,

    i am quite new in Qt Developement and already have a problem:
    I have a MainWindow class #typical# which ownes a pointer on a another class - called Map.
    When pressing a QAction the old Map is deleted and a new is constructed. After that an algorithm generates an island and similar stuff. I use an dynamic two-dimensional array for that... after generating the Map should be shown. First I used about 940 QWidgets for that with different colours etc. That worked as often as i wanted.
    Now I wanted to start with painting. Therefore I call repaint()-method after Generate().
    First time it works fine #and fast what was the main reason for changing#.
    But when clicking again on QAction it doesn't work.
    Using comment out i found out that i can either call the repaint() or the Generate()-function. Generating is different from ctor..
    Does anybody know what i can do?

    MfG akonshi

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      To trigger your paint event just call update() on your custom widget.

      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