Results 1 to 8 of 8

Thread: Disappearing content of QMainWindow

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2014
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Disappearing content of QMainWindow

    Hello,
    I am porting some code from Qt3 to Qt4. I have a form which uses a QtMainWindow, this is showing some canvas obtained with QTRoot (I think this is not important for the bug I am going to explain).
    In the constructor the canvas is added to the QtMainWindow, then another class is using this to show some histograms. When I run the executable I see that when I try to plot the histograms, they are correctly showed for a small fraction of second, then they disappear. To show them again I must click inside the QMainWindow where the canvas is put, but if I do something outside then they disappear again. I think this means that the histograms are showed just if the canvas is selected. I tried to solve this with a lot of commands like raise() and so on, but the problem is still occurring.

    I can put some simplified code lines to help myself with the explanation:

    Qt Code:
    1. HistogramView::HistogramView(...)
    2. MyQRootCanvas *my_canvas = new MyQRootCanvas( frame, "my_canvas" );
    3. vboxLayout->addWidget( my_canvas );
    4. }
    To copy to clipboard, switch view to plain text mode 

    Then the class which calls HistogramView is calling the command:

    Qt Code:
    1. histogramViewList.push_back( new HistogramView(...) ) {
    2. histogramViewList.back()->show();
    3. }
    To copy to clipboard, switch view to plain text mode 

    The show() command is showing the QmainWindow, the histogram is showed for a very small time and disappears, and appears again just if I click in the canvas, as I described before.
    I did not write the code myself, I am just trying to port it to Qt4.

    I really say thank you to anybody who can help me solving this problem or gives me any suggestion.
    Last edited by Antares; 8th April 2014 at 15:50.

Similar Threads

  1. Sharing same QToolbar amongst multiple QMainWindows
    By Henry Blue Heeler in forum Newbie
    Replies: 8
    Last Post: 31st December 2013, 23:57
  2. Changing QMainWindows backgroundcolor
    By dennis81 in forum Qt Programming
    Replies: 4
    Last Post: 10th October 2012, 12:12
  3. Dragging QDockWidgets between QMainWindows
    By FelixB in forum Newbie
    Replies: 3
    Last Post: 14th October 2011, 07:37
  4. shared QUnstackStack among several QMainWindows ?
    By umanga in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2010, 06:58
  5. How to change between QMainWindows???
    By webquinty in forum Newbie
    Replies: 3
    Last Post: 16th October 2009, 10:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.