KJanusWidget Class Reference
#include <kjanuswidget.h>
Inheritance diagram for KJanusWidget:

Detailed Description
Easy to use widget with many layouts.Provides a number of ready to use layouts (faces). 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 67 of file kjanuswidget.h.
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) |
Member Enumeration Documentation
|
Definition at line 89 of file kjanuswidget.h. |
Constructor & Destructor Documentation
|
Constructor where you specify the face.
Definition at line 87 of file kjanuswidget.cpp. |
|
Destructor.
Definition at line 202 of file kjanuswidget.cpp. |
Member Function Documentation
|
This signal is emitted whenever the current page changes.
|
|
Returns the index of the page that are currently displayed.
Definition at line 641 of file kjanuswidget.cpp. |
|
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.
Definition at line 874 of file kjanuswidget.cpp. |
|
Add a button at the bottom of the TreeList/IconList.
Definition at line 865 of file kjanuswidget.cpp. |
|
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 322 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.
Definition at line 341 of file kjanuswidget.cpp. |
|
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 297 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.
Definition at line 313 of file kjanuswidget.cpp. |
|
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 235 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. 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.
Definition at line 261 of file kjanuswidget.cpp. |
|
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 271 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.
Definition at line 288 of file kjanuswidget.cpp. |
|
Add a widget at the bottom of the TreeList/IconList.
Definition at line 857 of file kjanuswidget.cpp. |
|
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.
Definition at line 898 of file kjanuswidget.cpp. |
|
Returns the face type.
Definition at line 220 of file kjanuswidget.cpp. |
|
Use this to verify that no memory allocation failed.
Definition at line 208 of file kjanuswidget.cpp. |
|
Returns the minimum size that must be made available for the widget so that UIs can be displayed properly.
Definition at line 750 of file kjanuswidget.cpp. |
|
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.
Definition at line 665 of file kjanuswidget.cpp. |
|
Returns the title string associated with a page index in TreeList or IconList mode.
Definition at line 1132 of file kjanuswidget.cpp. |
|
Returns the page widget associated with a page index or null if there is no such page.
Definition at line 1140 of file kjanuswidget.cpp. |
|
Returns the empty widget that is available in Plain mode.
Definition at line 214 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.
Definition at line 1087 of file kjanuswidget.cpp. |
|
Give the keyboard input focus to the widget.
Reimplemented from QWidget. Definition at line 724 of file kjanuswidget.cpp. |
|
Sets the icon used in TreeList Mode for the given path.
Definition at line 488 of file kjanuswidget.cpp. |
|
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.
Definition at line 823 of file kjanuswidget.cpp. |
|
This function has only effect in TreeList mode. This tells the widgets whether the root should be decorated. For details see QListView::setRootIsDecorated
Definition at line 836 of file kjanuswidget.cpp. |
|
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.
Definition at line 831 of file kjanuswidget.cpp. |
|
Defines the widget to be swallowed. This method can be used several times. Only the latest defined widget will be shown.
Definition at line 496 of file kjanuswidget.cpp. |
|
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.
Definition at line 811 of file kjanuswidget.cpp. |
|
Reimplemented to handle the splitter width when the the face is TreeList.
Reimplemented from QWidget. Definition at line 883 of file kjanuswidget.cpp. |
|
Raises the page which was added by addPage().
Definition at line 575 of file kjanuswidget.cpp. |
|
Returns the recommended size for the widget in order to be displayed properly.
Reimplemented from QWidget. Definition at line 805 of file kjanuswidget.cpp. |
|
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
Definition at line 843 of file kjanuswidget.cpp. |
The documentation for this class was generated from the following files: