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. Glitches when resize widget
Forum Updated to NodeBB v4.3 + New Features

Glitches when resize widget

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 1.8k 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
    ahmedalaa
    wrote on last edited by
    #1

    Hi ,

    I am facing a problem when resizing a QMainWindow that contains a toolbar and a QStackedWidget.

    Initially, the QMainWindow is shown with no problem, then when I try to change the current index of the QStackedWidget (which results in resizing the whole window to be adjusted for the new index widget) the QMainWindow have some glitches in painting, a solid color rectangle covers my objects and it only re-appear when I select another window.

    I am using QWidget::show() to pop-up the QMainWindow.

    Please advise.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Any chance to show picture of this glitch ?
      Its nearly impossible to guess what could be wrong with no code
      and no picture :)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ahmedalaa
        wrote on last edited by
        #3

        I can't find a way to attach a picture here, I've uploaded to another website:

        http://postimg.org/image/o35o96wvr/

        mrjjM 1 Reply Last reply
        0
        • A ahmedalaa

          I can't find a way to attach a picture here, I've uploaded to another website:

          http://postimg.org/image/o35o96wvr/

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ahmedalaa
          Hi
          Looks like you have an widget which parent as mainwindow
          and not a stacked or other widget
          so its not inside anything.

          Do you use UI files or do u have code to create the gui?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ahmedalaa
            wrote on last edited by ahmedalaa
            #5

            I am using code to create gui, I think it is not a widget since when I click or hover on any object it appears.

            As you can see a part of the table view appeared when I just clicked inside it:
            http://postimg.org/image/7llhe32lz/

            and Also when I just minimize the window and maximize it again, everything is shown correctly.

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Ok, it does look strange.
              I have no idea what it is.

              Are all widgets in layouts?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                ahmedalaa
                wrote on last edited by
                #7

                Every Widget is in layouts.
                I think the problem related to resizing the main window.

                I've overrided the resizeEvent() function and called from inside it adjustSize(), I tried to call repaint and updateGeometry() after adjustSize() but it did not make any differnece.

                Hint: I'm running the application through VM if this makes any difference.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  ahmedalaa
                  wrote on last edited by
                  #8

                  I found the solution, it is related to the loading through VM, I think something relating to the graphic system mode, I've changed the mode and it worked perfectly :)

                  Thank you for your help :)

                  1 Reply Last reply
                  1

                  • Login

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