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
|
Definition at line 88 of file kjanuswidget.h. |
Constructor & Destructor Documentation
|
Constructor where you specify the face.
Definition at line 87 of file kjanuswidget.cpp. References KListView::addColumn(), QListView::header(), IconList, KJanusWidget(), Plain, QWidget::QWidget(), QFont::setBold(), QLabel::setFont(), QFrame::setFrameStyle(), QTabWidget::setMargin(), QListView::setRootIsDecorated(), KListView::setSorting(), setSwallowedWidget(), Swallow, Tabbed, and TreeList. Referenced by KJanusWidget(). |
|
Destructor.
Definition at line 201 of file kjanuswidget.cpp. |
Member Function Documentation
|
Raises the page which was added by addPage().
Definition at line 576 of file kjanuswidget.cpp. References showPage(). Referenced by showPage(), and KDialogBase::showPage(). |
|
Returns the index of the page that are currently displayed.
Definition at line 642 of file kjanuswidget.cpp. References QTabWidget::currentPage(), IconList, QListView::selectedItem(), Tabbed, and TreeList. Referenced by KDialogBase::activePageIndex(). |
|
Use this to verify that no memory allocation failed.
Definition at line 207 of file kjanuswidget.cpp. Referenced by KDialogBase::KDialogBase(). |
|
Returns the face type.
Definition at line 219 of file kjanuswidget.cpp. |
|
Returns the minimum size that must be made available for the widget so that UIs can be displayed properly.
Reimplemented from QWidget. Definition at line 751 of file kjanuswidget.cpp. References QSize::height(), IconList, QWidget::minimumSize(), Plain, QSize::rheight(), QSize::rwidth(), QWidget::style(), Swallow, Tabbed, TreeList, and QSize::width(). Referenced by sizeHint(). |
|
Returns the recommended size for the widget in order to be displayed properly.
Reimplemented from QWidget. Definition at line 806 of file kjanuswidget.cpp. References minimumSizeHint(). |
|
Returns the empty widget that is available in Plain mode.
Definition at line 213 of file kjanuswidget.cpp. 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.
Definition at line 260 of file kjanuswidget.cpp. References addPage(). Referenced by addPage(), and 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.
Definition at line 287 of file kjanuswidget.cpp. References addVBoxPage(). Referenced by addVBoxPage(), and 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. References addVBoxPage(), endl(), and kdDebug(). |
|
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 312 of file kjanuswidget.cpp. References addHBoxPage(). Referenced by addHBoxPage(), and 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. References addHBoxPage(), endl(), kdDebug(), and QHBox::setSpacing(). |
|
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 340 of file kjanuswidget.cpp. References addGridPage(). Referenced by addGridPage(), and 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. References addGridPage(), endl(), kdDebug(), and QGrid::setSpacing(). |
|
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 1088 of file kjanuswidget.cpp. References QMap< QListBoxItem *, QWidget * >::begin(), QMap< QListViewItem *, QWidget * >::begin(), QMap< QListBoxItem *, QWidget * >::end(), QMap< QListViewItem *, QWidget * >::end(), IconList, QMap< QListBoxItem *, QWidget * >::remove(), QMap< QListViewItem *, QWidget * >::remove(), QTabWidget::removePage(), removePage(), QWidgetStack::removeWidget(), and TreeList. Referenced by removePage(). |
|
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 666 of file kjanuswidget.cpp. References IconList, pageIndex(), QWidget::parentWidget(), Tabbed, and TreeList. Referenced by pageIndex(), and KDialogBase::pageIndex(). |
|
Defines the widget to be swallowed. This method can be used several times. Only the latest defined widget will be shown.
Definition at line 495 of file kjanuswidget.cpp. References QGridLayout::addWidget(), QObject::isWidgetType(), QWidget::layout(), QWidget::minimumSize(), QWidget::reparent(), QWidget::setMinimumSize(), setSwallowedWidget(), and Swallow. Referenced by KJanusWidget(), KDialogBase::setMainWidget(), and setSwallowedWidget(). |
|
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 812 of file kjanuswidget.cpp. References setTreeListAutoResize(), and TreeList. Referenced by setTreeListAutoResize(), and 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.
Definition at line 832 of file kjanuswidget.cpp. References setShowIconsInTreeList(). Referenced by setShowIconsInTreeList(), and 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
Definition at line 837 of file kjanuswidget.cpp. References QListView::setRootIsDecorated(), setRootIsDecorated(), and TreeList. Referenced by setRootIsDecorated(), and 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
Definition at line 844 of file kjanuswidget.cpp. References QListView::firstChild(), QListViewItem::itemBelow(), QListViewItem::setOpen(), TreeList, and unfoldTreeList(). Referenced by unfoldTreeList(), and KDialogBase::unfoldTreeList(). |
|
Add a widget at the bottom of the TreeList/IconList.
Definition at line 858 of file kjanuswidget.cpp. References addWidgetBelowList(), IconList, QWidget::reparent(), and TreeList. Referenced by addWidgetBelowList(), and KDialogBase::addWidgetBelowList(). |
|
Add a button at the bottom of the TreeList/IconList.
Definition at line 866 of file kjanuswidget.cpp. References addButtonBelowList(), IconList, and TreeList. Referenced by addButtonBelowList(), and 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.
Definition at line 875 of file kjanuswidget.cpp. References addButtonBelowList(), IconList, and TreeList. |
|
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 824 of file kjanuswidget.cpp. References IconList, and setIconListAllVisible(). Referenced by setIconListAllVisible(), and KDialogBase::setIconListAllVisible(). |
|
Sets the icon used in TreeList Mode for the given path.
Definition at line 487 of file kjanuswidget.cpp. References QMap< QString, QPixmap >::insert(), QStringList::join(), and setFolderIcon(). Referenced by setFolderIcon(), and KDialogBase::setFolderIcon(). |
|
Returns the title string associated with a page index in TreeList or IconList mode.
Definition at line 1133 of file kjanuswidget.cpp. References pageTitle(). Referenced by pageTitle(). |
|
Returns the page widget associated with a page index or null if there is no such page.
Definition at line 1141 of file kjanuswidget.cpp. References pageWidget(). Referenced by pageWidget(). |
|
Give the keyboard input focus to the widget.
Reimplemented from QWidget. Definition at line 725 of file kjanuswidget.cpp. References IconList, Plain, QWidget::setFocus(), Swallow, Tabbed, and TreeList. |
|
Reimplemented to handle the splitter width when the the face is TreeList.
Reimplemented from QWidget. Definition at line 884 of file kjanuswidget.cpp. References showEvent(), and TreeList. Referenced by showEvent(). |
|
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 899 of file kjanuswidget.cpp. References eventFilter(), and QEvent::type(). Referenced by eventFilter(). |
The documentation for this class was generated from the following files: