[Qt-jambi-interest] Weird Problem while Moving Window
Danny Sporea
dannysporea at yahoo.com
Wed Feb 27 19:51:43 CET 2008
Hi all,
I'm having a controller class that all it does is show
a new window and hides the old one. The showing window
does some calculations in the showEvent() method, and
it takes a couple of seconds to show. During that
small interval, if I move the original window, the
original window doesn't hide anymore, but it's neither
active, and shows weird traces of old windows inside
when something is moved over it. If I don't move it,
it hides normally.
I'll try to exemplify with some code:
MainClass:
----------
public final class Test {
private static MyUI ui;
private static DelayedUI dui;
public static void main( String[] args ) {
QApplication.initialize( args );
ui = new MyUI();
dui = new DelayedUI();
ui.show();
QApplication.exec();
}
public static void showDUI() {
dui.show();
ui.hide();
}
}
DelayedUI:
----------
public class DelayedUI extends QDialog {
public DelayedUI(){
}
public DelayedUI( QWidget parent ) {
super( parent );
}
protected void showEvent( QShowEvent ev ) {
try { Thread.sleep( 10000 ); } catch ( Exception
e ) { }
super.showEvent( ev );
}
}
MyUI:
-----
public class MyUI extends QDialog {
public Ui_MyUI ui = new Ui_MyUI();
public MyUI(){
ui.setupUi( this );
}
public MyUI(QWidget parent){
super( parent );
ui.setupUi( this );
}
public void on_pushButton_clicked() {
Test.showDUI();
}
}
The only workaround I found is to first hide the
original window and then to show the new one, but this
will create an unwanted flicker effect. I exagerated
in the test code with the 10000 sleep, but it allows
anybody to freely move the original window while the
new one sleeps in order to test it. My operation in
the showEvent() takes 1-3 seconds.
Is there any workaround or solution to this problem
without the flicker by hiding properly the old window
when the new one finishes appear on the screen ?
Thanks,
Danny
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
More information about the Qt-jambi-interest
mailing list