libyui-qt-pkg  2.42.5
 All Classes Functions Variables Enumerations
YQPkgFilterTab Class Reference

#include <YQPkgFilterTab.h>

Inheritance diagram for YQPkgFilterTab:
Collaboration diagram for YQPkgFilterTab:

Public Slots

void showPage (QWidget *page)
 
void showPage (const QString &internalName)
 
void closeCurrentPage ()
 
void loadSettings ()
 
void saveSettings ()
 
void closeAllPages ()
 

Signals

void currentChanged (QWidget *newPageContent)
 

Public Member Functions

 YQPkgFilterTab (QWidget *parent, const QString &settingsName)
 
virtual ~YQPkgFilterTab ()
 
void addPage (const QString &pageLabel, QWidget *pageContent, const QString &internalName)
 
QWidget * rightPane () const
 
YQPkgDiskUsageListdiskUsageList () const
 
YQPkgFilterPagefindPage (QWidget *pageContent)
 
YQPkgFilterPagefindPage (const QString &internalName)
 
YQPkgFilterPagefindPage (int tabIndex)
 
int tabCount () const
 
virtual bool eventFilter (QObject *watchedObj, QEvent *event)
 

Protected Slots

void showPage (int tabIndex)
 
void showPage (QAction *action)
 
void contextMovePageLeft ()
 
void contextMovePageRight ()
 
void contextClosePage ()
 

Protected Member Functions

void showPage (YQPkgFilterPage *page)
 
bool postTabContextMenu (const QPoint &pos)
 
void swapTabs (YQPkgFilterPage *page1, YQPkgFilterPage *page2)
 

Detailed Description

Widget for "tabbed browsing" in packages:

          /------\/------\/------\
[View v]  | Tab1 || Tab2 || Tab3 |               [Close]
+-----------------+------------------------------------+
|                 |                                    |
| QStackedWidget: |    Right pane                      |
|                 |                                    |
| Filter pages    |    (application defined)           |
|                 |                                    |
|                 |                                    |
|                 |                                    |
.                 .                                    .
.                 .                                    .
.                 .                                    .
|                 |                                    |
+-----------------+------------------------------------+

Each filter page corresponds to one tab and a number of widgets in a QStackedWidget in the left filter pane. When tabs are switched, the corresponding filter page is raised to the top of the widget stack. The right pane, however, remains unchanged.

Only a small numbers of filter pages is displayed as open tabs right away. Each of the other filter pages is shown in a new tabs when the user requests it via the pop-up menu on [View] button. Similarly, the tabs for all but the last filter pages can be closed with the [Close] button.

The left (filter page) and right panes are separated with a user-moveable splitter.

Definition at line 86 of file YQPkgFilterTab.h.

Constructor & Destructor Documentation

YQPkgFilterTab::YQPkgFilterTab ( QWidget *  parent,
const QString &  settingsName 
)

Constructor. 'settingsName' is the name to use to save and load settings.

Definition at line 120 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

YQPkgFilterTab::~YQPkgFilterTab ( )
virtual

Destructor.

Definition at line 281 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

Member Function Documentation

void YQPkgFilterTab::addPage ( const QString &  pageLabel,
QWidget *  pageContent,
const QString &  internalName 
)

Add a page with a user-visible "pageLabel", a widget with the page content and an internal name (or ID). 'pageContent' will be reparented to a subwidget of this class.

Definition at line 311 of file YQPkgFilterTab.cc.

void YQPkgFilterTab::closeAllPages ( )
slot

Close all currently open pages.

Definition at line 403 of file YQPkgFilterTab.cc.

void YQPkgFilterTab::closeCurrentPage ( )
slot

Close the current page unless this is the last visible page.

Definition at line 422 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::contextClosePage ( )
protectedslot

Close the current tab page (from the context menu).

Definition at line 653 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::contextMovePageLeft ( )
protectedslot

Move the current tab page (from the context menu) one position to the left.

Definition at line 593 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::contextMovePageRight ( )
protectedslot

Move the current tab page (from the context menu) one position to the right.

Definition at line 609 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::currentChanged ( QWidget *  newPageContent)
signal

Emitted when the current page changes. NOT emitted initially for the very first page that is shown.

YQPkgDiskUsageList * YQPkgFilterTab::diskUsageList ( ) const

Return the disk usage list widget or 0 if there is none.

Definition at line 304 of file YQPkgFilterTab.cc.

bool YQPkgFilterTab::eventFilter ( QObject *  watchedObj,
QEvent *  event 
)
virtual

Event filter to catch mouse right clicks on open tabs for the tab context menu. Returns 'true' if the event is processed and consumed, 'false' if processed should be continued by the watched object itself.

Reimplemented from QObject.

Definition at line 509 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

YQPkgFilterPage * YQPkgFilterTab::findPage ( QWidget *  pageContent)

Find a filter page by its content widget (the widget that was passed to addPage() ). Return 0 if there is no such page.

Definition at line 454 of file YQPkgFilterTab.cc.

YQPkgFilterPage * YQPkgFilterTab::findPage ( const QString &  internalName)

Find a filter page by its internal name. Return 0 if there is no such page.

Definition at line 469 of file YQPkgFilterTab.cc.

YQPkgFilterPage * YQPkgFilterTab::findPage ( int  tabIndex)

Find a filter page by its tab index. Return 0 if there is no such page.

Definition at line 484 of file YQPkgFilterTab.cc.

void YQPkgFilterTab::loadSettings ( )
slot

Load settings, including which tabs are to be opened and in which order. Return 'true' if settings could be loaded, 'false' if not.

Applications should call this after all pages have been added so the open tabs can be restored the same way as the user left the program. If tabCount() is still 0 afterwards, there were no settings, so it might make sense to open a number of default pages.

Definition at line 682 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

bool YQPkgFilterTab::postTabContextMenu ( const QPoint &  pos)
protected

Open the tab context menu for the tab at the specified position. Return 'true' upon success (i.e., there is a tab at that position), 'false' upon failure.

Definition at line 527 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

QWidget * YQPkgFilterTab::rightPane ( ) const

Return the right pane.

Definition at line 297 of file YQPkgFilterTab.cc.

void YQPkgFilterTab::saveSettings ( )
slot

Save the current settings, including which tabs are currently open and in which order. This is implicitly done in the destructor.

Definition at line 714 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::showPage ( QWidget *  page)
slot

Show a page. Create a tab for that page if it doesn't already exist.

Definition at line 341 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::showPage ( int  tabIndex)
protectedslot

Show the page with the specified tab index.

Definition at line 361 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::showPage ( QAction *  action)
protectedslot

Show the page with the widget of this action's data().

Definition at line 371 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::showPage ( YQPkgFilterPage page)
protected

Show a page.

Definition at line 382 of file YQPkgFilterTab.cc.

Here is the call graph for this function:

void YQPkgFilterTab::swapTabs ( YQPkgFilterPage page1,
YQPkgFilterPage page2 
)
protected

Swap two tabs and adjust their tab indices accordingly.

Definition at line 625 of file YQPkgFilterTab.cc.

int YQPkgFilterTab::tabCount ( ) const

Return the number of open tabs.

Definition at line 502 of file YQPkgFilterTab.cc.


The documentation for this class was generated from the following files: