Author: sh-sh-sh
Date: Wed Jun 4 16:35:26 2008
New Revision: 48077
URL: http://svn.opensuse.org/viewcvs/yast?rev=48077&view=rev
Log:
use single shot timer
Modified:
trunk/qt/src/YQMainWinDock.cc
trunk/qt/src/YQMainWinDock.h
trunk/qt/src/YQWizard.cc
Modified: trunk/qt/src/YQMainWinDock.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQMainWinDock.cc?rev=48077&r1=48076&r2=48077&view=diff
==============================================================================
--- trunk/qt/src/YQMainWinDock.cc (original)
+++ trunk/qt/src/YQMainWinDock.cc Wed Jun 4 16:35:26 2008
@@ -19,7 +19,6 @@
#define YUILogComponent "qt-ui"
#include "YUILog.h"
-#include <QTimer>
#include <QResizeEvent>
#include "YQDialog.h"
#include
@@ -86,9 +85,11 @@
QRect rect = QRect( QPoint( 0, 0 ), size() );
- YQWizard *wizard = dialog->findWizard();
+ YQWizard * wizard = dialog->findWizard();
+
if ( wizard )
- yuiDebug() << "wizard " << wizard << " " << wizard->isSecondary() << endl;
+ yuiDebug() << dialog << " with " << wizard << " isSecondary: " << boolalpha << wizard->isSecondary() << endl;
+
if ( wizard && wizard->isSecondary() )
rect.setLeft( _sideBarWidth );
@@ -148,7 +149,7 @@
if ( _widgetStack.empty() )
return;
- // In the normal case, the (still or against) topmost dialog needs to be
+ // In the normal case, the (still or again) topmost dialog needs to be
// activated or deactivated directly. Since this is done on the QWidget
// level, its widgetRep() is needed -- which may or may not be the same as
// the YQDialog.
Modified: trunk/qt/src/YQMainWinDock.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQMainWinDock.h?rev=48077&r1=48076&r2=48077&view=diff
==============================================================================
--- trunk/qt/src/YQMainWinDock.h (original)
+++ trunk/qt/src/YQMainWinDock.h Wed Jun 4 16:35:26 2008
@@ -136,21 +136,24 @@
virtual void resizeEvent( QResizeEvent * event );
/**
- * Resize the visible child to the current size of the dock.
- **/
- void resizeVisibleChild();
-
- /**
* For secondary wizards
**/
void setSideBarWidth( int width );
/**
* Activate or deactivate the next-lower dialog in the dock when a new
- * dialog is opened or when a dialog is closed.
+ * dialog is opened or when a dialog is closed.
**/
void activateCurrentDialog( bool active );
-
+
+
+public slots:
+
+ /**
+ * Resize the visible child to the current size of the dock.
+ **/
+ void resizeVisibleChild();
+
protected slots:
Modified: trunk/qt/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWizard.cc?rev=48077&r1=48076&r2=48077&view=diff
==============================================================================
--- trunk/qt/src/YQWizard.cc (original)
+++ trunk/qt/src/YQWizard.cc Wed Jun 4 16:35:26 2008
@@ -30,6 +30,7 @@
#include <QSvgRenderer>
#include <QPainter>
#include <QStackedWidget>
+#include <QTimer>
#include
#include
#include
@@ -74,7 +75,9 @@
#define USE_ICON_ON_HELP_BUTTON 0
-YQWizard *YQWizard::main_wizard = 0;
+
+YQWizard * YQWizard::main_wizard = 0;
+
YQWizard::YQWizard( YWidget * parent,
const string & backButtonLabel,
@@ -142,9 +145,14 @@
if ( !main_wizard && _stepsEnabled )
{
main_wizard = this;
- } else if ( main_wizard )
+ }
+ else if ( main_wizard )
{
- YQMainWinDock::mainWinDock()->resizeVisibleChild();
+ // Calling this in the Qt main loop, not here in the constructor:
+ // This will indirectly call a lot of virtual methods that are not available yet
+ // while this object is being constructed.
+
+ QTimer::singleShot( 0, YQMainWinDock::mainWinDock(), SLOT( resizeVisibleChild() ) );
}
}
@@ -159,11 +167,13 @@
delete _helpDlg;
}
+
bool YQWizard::isSecondary() const
{
return this != main_wizard;
}
+
void YQWizard::layoutTitleBar( QWidget * parent )
{
QFrame * titleBar = new QFrame( parent );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org