KJanusWidget Class Reference
Provides a number of ready to use layouts (faces). Easy to use widget with many layouts. More...
#include <kjanuswidget.h>
Inheritance diagram for KJanusWidget:

Public Types | |
enum | Face { TreeList = 0, Tabbed, Plain, Swallow, IconList } |
Public Slots | |
virtual void | setFocus () |
Signals | |
void | aboutToShowPage (QWidget *page) |
Public Member Functions | |
KJanusWidget (QWidget *parent=0, const char *name=0, int face=Plain) | |
~KJanusWidget () | |
virtual bool | showPage (int index) |
virtual int | activePageIndex () const |
virtual bool | isValid () const |
virtual int | face () const |
virtual QSize | minimumSizeHint () const |
virtual QSize | sizeHint () const |
virtual QFrame * | plainPage () |
virtual QFrame * | addPage (const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QFrame * | addPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QVBox * | addVBoxPage (const QString &item, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QVBox * | addVBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QHBox * | addHBoxPage (const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QHBox * | addHBoxPage (const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QGrid * | addGridPage (int n, Orientation dir, const QString &itemName, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
virtual QGrid * | addGridPage (int n, Orientation dir, const QStringList &items, const QString &header=QString::null, const QPixmap &pixmap=QPixmap()) |
void | removePage (QWidget *page) |
virtual int | pageIndex (QWidget *widget) const |
virtual bool | setSwallowedWidget (QWidget *widget) |
virtual void | setTreeListAutoResize (bool state) |
virtual void | setShowIconsInTreeList (bool state) |
virtual void | setRootIsDecorated (bool state) |
void | unfoldTreeList (bool persist=false) |
void | addWidgetBelowList (QWidget *widget) |
void | addButtonBelowList (const QString &text, QObject *recv, const char *slot) |
void | addButtonBelowList (const KGuiItem &guiitem, QObject *recv, const char *slot) |
virtual void | setIconListAllVisible (bool state) |
virtual void | setFolderIcon (const QStringList &path, const QPixmap &pixmap) |
QString | pageTitle (int index) const |
QWidget * | pageWidget (int index) const |
Protected Member Functions | |
virtual void | showEvent (QShowEvent *) |
virtual bool | eventFilter (QObject *o, QEvent *e) |
bool | showPage (QWidget *w) |
void | addPageWidget (QFrame *page, const QStringList &items, const QString &header, const QPixmap &pixmap) |
void | InsertTreeListItem (const QStringList &items, const QPixmap &pixmap, QFrame *page) |
QWidget * | FindParent () |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
Provides a number of ready to use layouts (faces). Easy to use widget with many layouts.It is used as an internal widget in KDialogBase, but can also used as a widget of its own.
This class provides KJanusWidget::TreeList, KJanusWidget::IconList, KJanusWidget::Tabbed, KJanusWidget::Plain and KJanusWidget::Swallow layouts.
For all modes it is important that you specify the QWidget::minimumSize() on the page, plain widget or the swallowed widget. If you use a QLayout on the page, plain widget or the swallowed widget this will be taken care of automatically. The size is used when the KJanusWidget determines its own minimum size. You get the minimum size by using the minimumSizeHint() or sizeHint() methods.
Pages that have been added in TreeList, IconList or Tabbed mode can be removed by simply deleting the page. However, it would be preferable to use the QObject::deleteLater() function on the page as the main event loop may have optimized UI update events of the page by scheduling them for later.
- Author:
- Espen Sand (espen@kde.org)
Definition at line 66 of file kjanuswidget.h.
Member Enumeration Documentation
|
|
Constructor & Destructor Documentation
|
Constructor where you specify the face.
References KListView::addColumn(), IconList, Plain, KListView::setSorting(), setSwallowedWidget(), Swallow, Tabbed, and TreeList. |
|
Destructor. Definition at line 201 of file kjanuswidget.cpp. |
Member Function Documentation
|
Raises the page which was added by addPage().
Referenced by KDialogBase::showPage(). |
|
Returns the index of the page that are currently displayed.
References IconList, Tabbed, and TreeList. Referenced by KDialogBase::activePageIndex(). |
|
Use this to verify that no memory allocation failed.
Referenced by KDialogBase::KDialogBase(). |
|
Returns the face type.
|
|
Returns the minimum size that must be made available for the widget so that UIs can be displayed properly.
References IconList, Plain, Swallow, Tabbed, and TreeList. Referenced by sizeHint(). |
|
Returns the recommended size for the widget in order to be displayed properly.
References minimumSizeHint(). |
|
Returns the empty widget that is available in Plain mode.
Referenced by KDialogBase::plainPage(). |
|
Add a new page when the class is used in TreeList, IconList or Tabbed mode. The returned widget is empty and you must add your widgets as children to this widget. In most cases you must create a layout manager and associate it with this widget as well. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later.
Referenced by KDialogBase::addPage(). |
|
This is like addPage just above, with the difference that the first element is a list of strings. These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the TreeList face. Later this may be added for the IconList face too. In other faces than the TreeList, all the strings except the last one is ignored. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later. Definition at line 234 of file kjanuswidget.cpp. |
|
Add a new page when the class is used in TreeList, IconList or Tabbed mode. The returned widget is empty and you must add your widgets as children to this widget. The returned widget is a QVBox so it contains a QVBoxLayout layout that lines up the child widgets are vertically. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later.
Referenced by KDialogBase::addVBoxPage(). |
|
This is like addVBoxPage just above, with the difference that the first element is a list of strings. These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the TreeList face. Later this may be added for the IconList face too. In other faces than the TreeList, all the strings except the last one is ignored. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later. Definition at line 270 of file kjanuswidget.cpp. |
|
Add a new page when the class is used in TreeList, IconList or Tabbed mode. The returned widget is empty and you must add your widgets as children to this widget. The returned widget is a QHBox so it contains a QHBoxLayout layout that lines up the child widgets are horizontally. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later.
Referenced by KDialogBase::addHBoxPage(). |
|
This is like addHBoxPage just above, with the difference that the first element is a list of strings. These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the TreeList face. Later this may be added for the IconList face too. In other faces than the TreeList, all the strings except the last one is ignored. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later. Definition at line 296 of file kjanuswidget.cpp. |
|
Add a new page when the class is used in either TreeList or Tabbed mode. The returned widget is empty and you must add your widgets as children to this widget. The returned widget is a QGrid so it contains a QGridLayout layout that places up the child widgets in a grid. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later.
Referenced by KDialogBase::addGridPage(). |
|
This is like addGridPage just above, with the difference that the first element is a list of strings. These strings are used to form a path of folders down to the given page. The initial elements are names for the folders, while the last element is the name of the page. Note: This does yet only work for the TreeList face. Later this may be added for the IconList face too. In other faces than the TreeList, all the strings except the last one is ignored. Deleting the returned frame will cause the listitem or tab to be removed (you can re-add a page with the same name later. Definition at line 321 of file kjanuswidget.cpp. |
|
Removes a page created with addPage, addVBoxPage, addHBoxPage or addGridPage. If the page has already been deleted or has already been removed, nothing happens. The widget itself is not deleted.
|
|
Returns the index of a page created with addPage , addVBoxPage , addHBoxPage or addGridPage . You can can compare this index with the value returned from activePageIndex if you need to do some page specific actions in your code. The returned index will never change so you can safely use this function once and save the value.
References IconList, Tabbed, and TreeList. Referenced by KDialogBase::pageIndex(). |
|
Defines the widget to be swallowed. This method can be used several times. Only the latest defined widget will be shown.
References Swallow. Referenced by KJanusWidget(), and KDialogBase::setMainWidget(). |
|
This function has only effect in TreeList mode. Defines how the tree list is resized when the widget is resized horizontally. By default the tree list keeps its width when the widget becomes wider.
References TreeList. Referenced by KDialogBase::setTreeListAutoResize(). |
|
This function has only effect in TreeList mode. This tells the widgets whether the icons given in the addPage, addVBoxPage, addHBoxPage, or addGridPage methods should be shown in the TreeList. Note: This method must be called before calling any of the methods which add icons to the page.
Referenced by KDialogBase::setShowIconsInTreeList(). |
|
This function has only effect in TreeList mode. This tells the widgets whether the root should be decorated. For details see QListView::setRootIsDecorated
References TreeList. Referenced by KDialogBase::setRootIsDecorated(). |
|
This function has only effect in TreeList mode. This tells the TreeList to unfold the whole tree so that all entries are visible.
If the list is empty when you call this method newly created entries will not automatically be opened. If the
References TreeList. Referenced by KDialogBase::unfoldTreeList(). |
|
Add a widget at the bottom of the TreeList/IconList.
References IconList, and TreeList. Referenced by KDialogBase::addWidgetBelowList(). |
|
Add a button at the bottom of the TreeList/IconList.
References IconList, and TreeList. Referenced by KDialogBase::addButtonBelowList(). |
|
The same as the above function, but with a KGuiItem providing the text and icon for the button at the bottom of the TreeList/IconList.
|
|
This function has only effect in IconList mode. Defines how the icon list widget is displayed. By default it is the widgets in the pages that decide the minimum height of the toplevel widget. A vertical scrollbar can be used in the icon list area.
References IconList. Referenced by KDialogBase::setIconListAllVisible(). |
|
Sets the icon used in TreeList Mode for the given path.
Referenced by KDialogBase::setFolderIcon(). |
|
Returns the title string associated with a page index in TreeList or IconList mode.
|
|
Returns the page widget associated with a page index or null if there is no such page.
|
|
Give the keyboard input focus to the widget. Definition at line 725 of file kjanuswidget.cpp. |
|
Reimplemented to handle the splitter width when the the face is TreeList. Definition at line 884 of file kjanuswidget.cpp. References TreeList. |
|
This function is used internally when in IconList mode. If you reimplement this class a make your own event filter, make sure to call this function from your filter.
|
The documentation for this class was generated from the following files: