myState( true ),
myEmpty( false )
{
-/*
- if ( myCont->mainWindow() )
- myState = myCont->mainWindow()->appropriate( myCont );
-*/
myCont->installEventFilter( this );
myVisible = myCont->isVisibleTo( myCont->parentWidget() );
bool vis = false;
- const QObjectList& objList = myCont->children();
- for ( QObjectList::const_iterator it = objList.begin(); it != objList.end() && !vis; ++it )
- {
- QObject* obj = *it;
- if ( !obj->isWidgetType() || !qstrcmp( "qt_dockwidget_internal", obj->objectName().toLatin1() ) )
- continue;
+ QList<QAction*> actList = myCont->actions();
- if ( obj->inherits( "QToolBarHandle" ) || obj->inherits( "QToolBarExtension" ) )
+ for ( QList<QAction*>::const_iterator it = actList.begin(); it != actList.end() && !vis; ++it )
+ {
+ if ( (*it)->isSeparator() )
continue;
- QWidget* wid = (QWidget*)*it;
- vis = wid->isVisibleTo( wid->parentWidget() );
+ vis = (*it)->isVisible();
}
QMainWindow* mw = myCont->mainWindow();
{
if ( watch )
myWatcher = new Watcher( this );
- setObjectName( label );
+
+ if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+ mw->addToolBar( this );
}
/*!
myWatcher( 0 ),
myStretch( false )
{
- setObjectName( label );
+ if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+ mw->addToolBar( this );
}
/*!
{
if ( watch )
myWatcher = new Watcher( this );
+
+ if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+ mw->addToolBar( this );
}
/*!
myWatcher( 0 ),
myStretch( false )
{
+ if ( QMainWindow* mw = ::qobject_cast<QMainWindow*>( parent ) )
+ mw->addToolBar( this );
}
/*!
{
}
-/*!
- \brief Get the recommended size for the widget.
- \return recommended toolbar size
-*/
-QSize QtxToolBar::sizeHint() const
-{
- QSize sz = QToolBar::sizeHint();
-/*
- if ( place() == InDock && isStretchable() && area() )
- {
- if ( orientation() == Horizontal )
- sz.setWidth( area()->width() );
- else
- sz.setHeight( area()->height() );
- }
-*/
- return sz;
-}
-
-/*!
- \brief Get the recommended minimum size for the widget.
- \return recommended toolbar minimum size
-*/
-QSize QtxToolBar::minimumSizeHint() const
-{
- QSize sz = QToolBar::minimumSizeHint();
-/*
- if ( place() == InDock && isStretchable() && area() )
- {
- if ( orientation() == Horizontal )
- sz.setWidth( area()->width() );
- else
- sz.setHeight( area()->height() );
- }
-*/
- return sz;
-}
-
/*!
\brief Show/hide the toolbar.
\param on new visibility state
}
return mw;
}
+
+bool QtxToolBar::event( QEvent* e )
+{
+ if ( e->type() == QEvent::WindowTitleChange && objectName().isEmpty() )
+ setObjectName( windowTitle() );
+
+ return QToolBar::event( e );
+}