libyui-qt-pkg
Loading...
Searching...
No Matches
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.

Constructor & Destructor Documentation

◆ YQPkgFilterTab()

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

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

◆ ~YQPkgFilterTab()

YQPkgFilterTab::~YQPkgFilterTab ( )
virtual

Destructor.

Member Function Documentation

◆ addPage()

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.

◆ closeAllPages

void YQPkgFilterTab::closeAllPages ( )
slot

Close all currently open pages.

◆ closeCurrentPage

void YQPkgFilterTab::closeCurrentPage ( )
slot

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

◆ contextClosePage

void YQPkgFilterTab::contextClosePage ( )
protectedslot

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

◆ contextMovePageLeft

void YQPkgFilterTab::contextMovePageLeft ( )
protectedslot

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

◆ contextMovePageRight

void YQPkgFilterTab::contextMovePageRight ( )
protectedslot

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

◆ currentChanged

void YQPkgFilterTab::currentChanged ( QWidget * newPageContent)
signal

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

◆ diskUsageList()

YQPkgDiskUsageList * YQPkgFilterTab::diskUsageList ( ) const

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

◆ eventFilter()

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.

◆ findPage() [1/3]

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

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

◆ findPage() [2/3]

YQPkgFilterPage * YQPkgFilterTab::findPage ( int tabIndex)

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

◆ findPage() [3/3]

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.

◆ loadSettings

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.

◆ postTabContextMenu()

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.

◆ rightPane()

QWidget * YQPkgFilterTab::rightPane ( ) const

Return the right pane.

◆ saveSettings

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.

◆ showPage [1/4]

void YQPkgFilterTab::showPage ( int tabIndex)
protectedslot

Show the page with the specified tab index.

◆ showPage [2/4]

void YQPkgFilterTab::showPage ( QAction * action)
protectedslot

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

◆ showPage [3/4]

void YQPkgFilterTab::showPage ( QWidget * page)
slot

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

◆ showPage() [4/4]

void YQPkgFilterTab::showPage ( YQPkgFilterPage * page)
protected

Show a page.

◆ swapTabs()

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

Swap two tabs and adjust their tab indices accordingly.

◆ tabCount()

int YQPkgFilterTab::tabCount ( ) const

Return the number of open tabs.


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