Hello community, here is the log from the commit of package libyui-qt for openSUSE:Factory checked in at 2020-10-18 16:22:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui-qt (Old) and /work/SRC/openSUSE:Factory/.libyui-qt.new.3486 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui-qt" Sun Oct 18 16:22:01 2020 rev:73 rq:841244 version:2.56.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libyui-qt/libyui-qt.changes 2020-09-21 17:04:54.523002195 +0200 +++ /work/SRC/openSUSE:Factory/.libyui-qt.new.3486/libyui-qt.changes 2020-10-18 16:22:29.876519576 +0200 @@ -1,0 +2,11 @@ +Fri Oct 9 07:41:44 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Resolve hotkeys conflicts for widgets with multiple hotkeys + (related to bsc#1175489). +- Allow to show/hide menus and menu items (related to + manatools/libyui-mga#1). +- Allow nested items in tables (bsc#1176402). +- Bumped SO version to 14. +- 2.56.0 + +------------------------------------------------------------------- Old: ---- libyui-qt-2.55.0.tar.bz2 New: ---- libyui-qt-2.56.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-qt-doc.spec ++++++ --- /var/tmp/diff_new_pack.bvxseG/_old 2020-10-18 16:22:31.528520311 +0200 +++ /var/tmp/diff_new_pack.bvxseG/_new 2020-10-18 16:22:31.532520313 +0200 @@ -17,11 +17,11 @@ %define parent libyui-qt -%define so_version 13 +%define so_version 14 Name: %{parent}-doc # DO NOT manually bump the version here; instead, use rake version:bump -Version: 2.55.0 +Version: 2.56.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 ++++++ libyui-qt.spec ++++++ --- /var/tmp/diff_new_pack.bvxseG/_old 2020-10-18 16:22:31.556520324 +0200 +++ /var/tmp/diff_new_pack.bvxseG/_new 2020-10-18 16:22:31.556520324 +0200 @@ -18,11 +18,11 @@ Name: libyui-qt # DO NOT manually bump the version here; instead, use rake version:bump -Version: 2.55.0 +Version: 2.56.0 Release: 0 Source: %{name}-%{version}.tar.bz2 -%define so_version 13 +%define so_version 14 %define bin_name %{name}%{so_version} BuildRequires: boost-devel ++++++ libyui-qt-2.55.0.tar.bz2 -> libyui-qt-2.56.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/.editorconfig new/libyui-qt-2.56.0/.editorconfig --- old/libyui-qt-2.55.0/.editorconfig 1970-01-01 01:00:00.000000000 +0100 +++ new/libyui-qt-2.56.0/.editorconfig 2020-10-12 12:17:36.000000000 +0200 @@ -0,0 +1,18 @@ +# https://EditorConfig.org -*- ini -*- +# Copyright (c) 2020 SUSE LLC +# MIT license +# +# This is a unified way to tell all your editors +# about the proper indentation style in this repo. +# +# Emacs: https://github.com/editorconfig/editorconfig-emacs#readme +# Vim: https://github.com/editorconfig/editorconfig-vim#readme +# VS Code: https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig + +# don't continue looking in upper directories, this is the top level +root = true + +[*.{h,cc}] +indent_style = tab +indent_size = 4 +tab_width = 8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/VERSION.cmake new/libyui-qt-2.56.0/VERSION.cmake --- old/libyui-qt-2.55.0/VERSION.cmake 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/VERSION.cmake 2020-10-12 12:17:36.000000000 +0200 @@ -1,11 +1,11 @@ SET(VERSION_MAJOR "2") -SET(VERSION_MINOR "55") +SET(VERSION_MINOR "56") SET(VERSION_PATCH "0") SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" ) ##### This is needed for the libyui-qt core ONLY. ##### These will be overridden from exports in LibyuiConfig.cmake -SET( SONAME_MAJOR "13" ) +SET( SONAME_MAJOR "14" ) SET( SONAME_MINOR "0" ) SET( SONAME_PATCH "0" ) SET( SONAME "${SONAME_MAJOR}.${SONAME_MINOR}.${SONAME_PATCH}" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/package/libyui-qt-doc.spec new/libyui-qt-2.56.0/package/libyui-qt-doc.spec --- old/libyui-qt-2.55.0/package/libyui-qt-doc.spec 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/package/libyui-qt-doc.spec 2020-10-12 12:17:36.000000000 +0200 @@ -17,11 +17,11 @@ %define parent libyui-qt -%define so_version 13 +%define so_version 14 Name: %{parent}-doc # DO NOT manually bump the version here; instead, use rake version:bump -Version: 2.55.0 +Version: 2.56.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/package/libyui-qt.changes new/libyui-qt-2.56.0/package/libyui-qt.changes --- old/libyui-qt-2.55.0/package/libyui-qt.changes 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/package/libyui-qt.changes 2020-10-12 12:17:36.000000000 +0200 @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Fri Oct 9 07:41:44 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Resolve hotkeys conflicts for widgets with multiple hotkeys + (related to bsc#1175489). +- Allow to show/hide menus and menu items (related to + manatools/libyui-mga#1). +- Allow nested items in tables (bsc#1176402). +- Bumped SO version to 14. +- 2.56.0 + +------------------------------------------------------------------- Wed Sep 16 13:04:28 UTC 2020 - José Iván López González <jlo...@suse.com> - Hide heading of the dialog when no title is defined. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/package/libyui-qt.spec new/libyui-qt-2.56.0/package/libyui-qt.spec --- old/libyui-qt-2.55.0/package/libyui-qt.spec 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/package/libyui-qt.spec 2020-10-12 12:17:36.000000000 +0200 @@ -18,11 +18,11 @@ Name: libyui-qt # DO NOT manually bump the version here; instead, use rake version:bump -Version: 2.55.0 +Version: 2.56.0 Release: 0 Source: %{name}-%{version}.tar.bz2 -%define so_version 13 +%define so_version 14 %define bin_name %{name}%{so_version} BuildRequires: boost-devel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/QY2DiskUsageList.h new/libyui-qt-2.56.0/src/QY2DiskUsageList.h --- old/libyui-qt-2.55.0/src/QY2DiskUsageList.h 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/QY2DiskUsageList.h 2020-10-12 12:17:36.000000000 +0200 @@ -30,7 +30,7 @@ #include <QY2ListView.h> #include <yui/FSize.h> -#include <qcolor.h> +#include <QColor> class QY2DiskUsageListItem; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/QY2Styler.cc new/libyui-qt-2.56.0/src/QY2Styler.cc --- old/libyui-qt-2.55.0/src/QY2Styler.cc 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/QY2Styler.cc 2020-10-12 12:17:36.000000000 +0200 @@ -58,7 +58,7 @@ : QObject( parent ) { QPixmapCache::setCacheLimit( 5 * 1024 ); - yuiDebug() << "Styler created" << endl; + // yuiDebug() << "Styler created" << endl; setDefaultStyleSheet(defaultStyleSheet); setAlternateStyleSheet(alternateStyleSheet); @@ -73,7 +73,7 @@ if ( ! styler ) { - yuiDebug() << "Creating QY2Styler singleton" << endl; + // yuiDebug() << "Creating QY2Styler singleton" << endl; QString y2style = getenv("Y2STYLE"); QString y2altstyle = getenv("Y2ALTSTYLE"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/YQItemSelector.cc new/libyui-qt-2.56.0/src/YQItemSelector.cc --- old/libyui-qt-2.55.0/src/YQItemSelector.cc 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/YQItemSelector.cc 2020-10-12 12:17:36.000000000 +0200 @@ -298,6 +298,20 @@ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) ); } + +void YQItemSelector::shortcutChanged() +{ + // Any of the items might have its keyboard shortcut changed, but we don't + // know which one. So let's simply set all item labels again. + + for ( YItemConstIterator it = itemsBegin(); it != itemsEnd(); ++it ) + { + YItem * item = *it; + _itemWidgets[item]->setLabel( fromUTF8( item->label() ) ); + } +} + + //----------------------------------------------------------------------------- @@ -502,3 +516,9 @@ { emit selectionChanged( this, selected ); } + + +void YQSelectorItemWidget::setLabel( const QString & label ) +{ + _headingToggle->setText( label ); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/YQItemSelector.h new/libyui-qt-2.56.0/src/YQItemSelector.h --- old/libyui-qt-2.55.0/src/YQItemSelector.h 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/YQItemSelector.h 2020-10-12 12:17:36.000000000 +0200 @@ -152,6 +152,13 @@ **/ virtual void activateItem( YItem * item ); + /** + * Notification that some shortcut was changed. + * + * Reimplemented from YSelectionWidget. + **/ + virtual void shortcutChanged(); + protected slots: /** @@ -245,6 +252,13 @@ bool multiSelection() const { return ! singleSelection(); } /** + * Set a new label. + * + * This method is mainly used when fixing shortcuts conflicts. + **/ + void setLabel( const QString & label ); + + /** * Return the widget that handles the selection: Either a QRadioButton or a * QCheckBox. Both inherit QAbstractButton which has 'isChecked()' and * 'setChecked()'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/YQMenuBar.cc new/libyui-qt-2.56.0/src/YQMenuBar.cc --- old/libyui-qt-2.55.0/src/YQMenuBar.cc 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/YQMenuBar.cc 2020-10-12 12:17:36.000000000 +0200 @@ -73,19 +73,19 @@ for ( YItemIterator it = itemsBegin(); it != itemsEnd(); ++it ) { YMenuItem * item = dynamic_cast<YMenuItem *>( *it ); - YUI_CHECK_PTR( item ); + YUI_CHECK_PTR( item ); - if ( ! item->isMenu() ) - YUI_THROW( YUIException( "YQMenuBar: Only menus allowed on toplevel." ) ); + if ( ! item->isMenu() ) + YUI_THROW( YUIException( "YQMenuBar: Only menus allowed on toplevel." ) ); - QMenu * menu = QMenuBar::addMenu( fromUTF8( item->label() )); - item->setUiItem( menu ); + QMenu * menu = QMenuBar::addMenu( fromUTF8( item->label() )); + item->setUiItem( menu ); - connect( menu, &pclass(menu)::triggered, - this, &pclass(this)::menuEntryActivated ); + connect( menu, &pclass(menu)::triggered, + this, &pclass(this)::menuEntryActivated ); - // Recursively add menu content - rebuildMenuTree( menu, item->childrenBegin(), item->childrenEnd() ); + // Recursively add menu content + rebuildMenuTree( menu, item->childrenBegin(), item->childrenEnd() ); } } @@ -96,24 +96,24 @@ for ( YItemIterator it = begin; it != end; ++it ) { YMenuItem * item = dynamic_cast<YMenuItem *>( *it ); - YUI_CHECK_PTR( item ); + YUI_CHECK_PTR( item ); QIcon icon; if ( item->hasIconName() ) icon = YQUI::ui()->loadIcon( item->iconName() ); - if ( item->isSeparator() ) - { - parentMenu->addSeparator(); - } + if ( item->isSeparator() ) + { + parentMenu->addSeparator(); + } else if ( item->isMenu() ) { QMenu * subMenu = parentMenu->addMenu( fromUTF8( item->label() )); - item->setUiItem( subMenu ); + item->setUiItem( subMenu ); if ( ! icon.isNull() ) subMenu->setIcon( icon ); - + connect( subMenu, &pclass(subMenu)::triggered, this, &pclass(this)::menuEntryActivated ); @@ -121,12 +121,12 @@ } else // Plain menu item (leaf item) { - QAction * action = parentMenu->addAction( fromUTF8( item->label() ) ); - item->setUiItem( action ); - _actionMap[ action ] = item; + QAction * action = parentMenu->addAction( fromUTF8( item->label() ) ); + item->setUiItem( action ); + _actionMap[ action ] = item; - if ( ! icon.isNull() ) - action->setIcon( icon ); + if ( ! icon.isNull() ) + action->setIcon( icon ); } } } @@ -136,11 +136,11 @@ YQMenuBar::menuEntryActivated( QAction * action ) { if ( _actionMap.contains( action ) ) - _selectedItem = _actionMap[ action ]; + _selectedItem = _actionMap[ action ]; if ( _selectedItem ) { - // yuiDebug() << "Selected menu entry \"" << fromUTF8( _selectedItem->label() ) << "\"" << endl; + // yuiDebug() << "Selected menu entry \"" << fromUTF8( _selectedItem->label() ) << "\"" << endl; /* * Defer the real returnNow() until all popup related events have been @@ -180,17 +180,17 @@ if ( qObj ) { - QMenu * menu = qobject_cast<QMenu *>( qObj ); + QMenu * menu = qobject_cast<QMenu *>( qObj ); - if ( menu ) - menu->setEnabled( enabled ); - else - { - QAction * action = qobject_cast<QAction *>( qObj ); - - if ( action ) - action->setEnabled( enabled ); - } + if ( menu ) + menu->setEnabled( enabled ); + else + { + QAction * action = qobject_cast<QAction *>( qObj ); + + if ( action ) + action->setEnabled( enabled ); + } } YMenuWidget::setItemEnabled( item, enabled ); @@ -198,6 +198,30 @@ void +YQMenuBar::setItemVisible( YMenuItem * item, bool visible ) +{ + QObject * qObj = static_cast<QObject *>( item->uiItem() ); + + if ( qObj ) + { + QMenu * menu = qobject_cast<QMenu *>( qObj ); + + if ( menu ) + menu->menuAction()->setVisible( visible ); + else + { + QAction * action = qobject_cast<QAction *>( qObj ); + + if ( action ) + action->setVisible( visible ); + } + } + + YMenuWidget::setItemVisible( item, visible ); +} + + +void YQMenuBar::setEnabled( bool enabled ) { YWidget::setEnabled( enabled ); @@ -236,5 +260,19 @@ YQMenuBar::activateItem( YMenuItem * item ) { if ( item ) - YQUI::ui()->sendEvent( new YMenuEvent( item ) ); + YQUI::ui()->sendEvent( new YMenuEvent( item ) ); +} + + +void +YQMenuBar::shortcutChanged() +{ + // Any of the items might have its keyboard shortcut changed, but we don't + // know which one. So let's simply rebuild the menu bar again. + + // FIXME: This is called every time a menu shortcut is changed. Rebuilding + // the menu tree is an expensive operation. Try to avoid multiple rebuilds + // by calling this only after fixing all the shortcuts. + + rebuildMenuTree(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/YQMenuBar.h new/libyui-qt-2.56.0/src/YQMenuBar.h --- old/libyui-qt-2.55.0/src/YQMenuBar.h 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/YQMenuBar.h 2020-10-12 12:17:36.000000000 +0200 @@ -52,7 +52,7 @@ /** * Rebuild the displayed menu tree from the internally stored YMenuItems. * - * Implemented from YMenuBar. + * Implemented from YMenuWidget. **/ virtual void rebuildMenuTree(); @@ -97,11 +97,24 @@ virtual void setItemEnabled( YMenuItem * item, bool enabled ); /** + * Show or hide an item. + * + * Reimplemented from YMenuWidget. + **/ + virtual void setItemVisible( YMenuItem * item, bool visible ); + + /** * Activate the item selected in the tree. Can be used in tests to simulate * user input. **/ virtual void activateItem( YMenuItem * item ); + /** + * Notification that some shortcut was changed. + * + * Reimplemented from YSelectionWidget. + **/ + virtual void shortcutChanged(); protected slots: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/YQTable.cc new/libyui-qt-2.56.0/src/YQTable.cc --- old/libyui-qt-2.55.0/src/YQTable.cc 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/YQTable.cc 2020-10-12 12:17:36.000000000 +0200 @@ -22,11 +22,13 @@ /-*/ + +#define YUILogComponent "qt-ui" +#include <yui/YUILog.h> + #include <QHeaderView> #include <QVBoxLayout> #include <QString> -#define YUILogComponent "qt-ui" -#include <yui/YUILog.h> #include "utf8.h" #include "YQUI.h" @@ -129,8 +131,8 @@ YQTable::addItem( YItem * yitem ) { addItem( yitem, - false, // batchMode - true); // resizeColumnsToContent + false, // batchMode + true ); // resizeColumnsToContent } @@ -153,21 +155,10 @@ YQTable::selectItem( YSelectionWidget::selectedItem(), true ); } - - // - // Set column alignment - // - - for ( int col=0; col < columns(); col++ ) + if ( item->hasChildren() ) { - switch ( alignment( col ) ) - { - case YAlignBegin: clone->setTextAlignment( col, Qt::AlignLeft | Qt::AlignVCenter ); break; - case YAlignCenter: clone->setTextAlignment( col, Qt::AlignCenter | Qt::AlignVCenter ); break; - case YAlignEnd: clone->setTextAlignment( col, Qt::AlignRight | Qt::AlignVCenter ); break; - - case YAlignUnchanged: break; - } + cloneChildItems( item, clone ); + _qt_listView->setRootIsDecorated( true ); } if ( ! batchMode ) @@ -177,7 +168,27 @@ { for ( int i=0; i < columns(); i++ ) _qt_listView->resizeColumnToContents( i ); - /* NOTE: resizeColumnToContents(...) is performance-critical ! */ + // NOTE: resizeColumnToContents() is performance-critical! + } +} + + +void +YQTable::cloneChildItems( YTableItem * parentItem, YQTableListViewItem * parentItemClone ) +{ + for ( YItemIterator it = parentItem->childrenBegin(); + it != parentItem->childrenEnd(); + ++it ) + { + YTableItem * childItem = dynamic_cast<YTableItem *>( *it ); + + if ( childItem ) + { + YQTableListViewItem * childClone = new YQTableListViewItem( this, parentItemClone, childItem ); + YUI_CHECK_NEW( childClone ); + + cloneChildItems( childItem, childClone ); + } } } @@ -194,9 +205,8 @@ addItem( *it, true, // batchMode false ); // resizeColumnsToContent - /* NOTE: resizeToContents=true would cause a massive performance drop ! - => resize columns to content only one time at the end of this - function */ + // NOTE: resizeToContents = true would cause a massive performance drop! + // => resize columns to content only once at the end of this function } YItem * sel = YSelectionWidget::selectedItem(); @@ -358,7 +368,7 @@ YQTable::setEnabled( bool enabled ) { _qt_listView->setEnabled( enabled ); - //FIXME _qt_listView->triggerUpdate(); + // FIXME _qt_listView->triggerUpdate(); YWidget::setEnabled( enabled ); } @@ -422,11 +432,39 @@ , _table( table ) , _origItem( origItem ) { + init(); +} + + +YQTableListViewItem::YQTableListViewItem( YQTable * table, + YQTableListViewItem * parentItemClone, + YTableItem * origItem ) + : QY2ListViewItem( parentItemClone ) + , _table( table ) + , _origItem( origItem ) +{ + init(); +} + + +void +YQTableListViewItem::init() +{ YUI_CHECK_PTR( _table ); YUI_CHECK_PTR( _origItem ); _origItem->setData( this ); + updateCells(); + setColAlignment(); + + if ( _origItem->isOpen() && _origItem->hasChildren() ) + setExpanded( true ); +} + +void +YQTableListViewItem::updateCells() +{ for ( YTableCellIterator it = _origItem->cellsBegin(); it != _origItem->cellsEnd(); ++it ) @@ -473,12 +511,31 @@ } +void +YQTableListViewItem::setColAlignment() +{ + YUI_CHECK_PTR( _table ); + + for ( int col=0; col < _table->columns(); col++ ) + { + switch ( _table->alignment( col ) ) + { + case YAlignBegin: setTextAlignment( col, Qt::AlignLeft | Qt::AlignVCenter ); break; + case YAlignCenter: setTextAlignment( col, Qt::AlignCenter | Qt::AlignVCenter ); break; + case YAlignEnd: setTextAlignment( col, Qt::AlignRight | Qt::AlignVCenter ); break; + + case YAlignUnchanged: break; + } + } +} + + QString YQTableListViewItem::smartSortKey(int column) const { const YTableCell* tableCell = origItem()->cell(column); - if (tableCell->hasSortKey()) + if (tableCell && tableCell->hasSortKey()) return QString::fromUtf8(tableCell->sortKey().c_str()); else return text(column).trimmed(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.55.0/src/YQTable.h new/libyui-qt-2.56.0/src/YQTable.h --- old/libyui-qt-2.55.0/src/YQTable.h 2020-09-17 13:37:39.000000000 +0200 +++ new/libyui-qt-2.56.0/src/YQTable.h 2020-10-12 12:17:36.000000000 +0200 @@ -32,7 +32,8 @@ class QY2ListView; class QTreeWidgetItem; -class YQListViewItem; +class YQTableListViewItem; + class YQTable : public QFrame, public YTable { @@ -161,9 +162,9 @@ void slotActivated( QTreeWidgetItem * ); /** - * Propagate a context menu selection + * Propagate a context menu selection. * - * This will trigger an 'ContextMenuActivated' event if 'notifyContextMenu' is set. + * This will trigger a 'ContextMenuActivated' event if 'notifyContextMenu' is set. **/ void slotContextMenu ( const QPoint & pos ); @@ -183,6 +184,13 @@ **/ void addItem( YItem * item, bool batchMode, bool resizeColumnsToContent ); + /** + * Clone (create Qt item counterparts) for all child items of 'parentItem'. + * Set their Qt item parent to 'parentItemClone'. + **/ + void cloneChildItems( YTableItem * parentItem, + YQTableListViewItem * parentItemClone ); + // // Data members // @@ -200,11 +208,18 @@ public: /** - * Constructor. + * Constructor for toplevel items. **/ - YQTableListViewItem( YQTable * table, - QY2ListView * parent, - YTableItem * origItem ); + YQTableListViewItem( YQTable * table, + QY2ListView * parent, + YTableItem * origItem ); + + /** + * Constructor for nested items. + **/ + YQTableListViewItem( YQTable * table, + YQTableListViewItem * parentItemClone, + YTableItem * origItem ); /** * Return the parent table widget. @@ -222,12 +237,29 @@ void updateCell( const YTableCell * cell ); /** + * Update all columns of this item with the content of the original item. + **/ + void updateCells(); + + /** * The text of the table cell or the sort-key if available. **/ virtual QString smartSortKey(int column) const override; protected: + /** + * Common initializations for all constructors + **/ + void init(); + + /** + * Set the alignment for each column according to the YTable parent's + * alignment. + **/ + void setColAlignment(); + + YQTable * _table; YTableItem * _origItem; };