Author: tgoettlicher
Date: Mon Dec 20 17:01:47 2010
New Revision: 63017
URL: http://svn.opensuse.org/viewcvs/yast?rev=63017&view=rev
Log:
- Added support for check boxes in tree widgets
Modified:
trunk/qt/VERSION.cmake
trunk/qt/package/yast2-qt.changes
trunk/qt/src/YQTree.cc
trunk/qt/src/YQTree.h
trunk/qt/src/YQWidgetFactory.cc
trunk/qt/src/YQWidgetFactory.h
trunk/qt/yast2-qt.spec.in
Modified: trunk/qt/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/VERSION.cmake?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/VERSION.cmake (original)
+++ trunk/qt/VERSION.cmake Mon Dec 20 17:01:47 2010
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "19")
-SET(VERSION_PATCH "4")
+SET(VERSION_PATCH "5")
Modified: trunk/qt/package/yast2-qt.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/package/yast2-qt.changes (original)
+++ trunk/qt/package/yast2-qt.changes Mon Dec 20 17:01:47 2010
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Dec 20 16:52:53 CET 2010 - tgoettlicher@suse.de
+
+- Added support for check boxes in tree widgets
+- V 2.19.5
+
+-------------------------------------------------------------------
Mon Nov 22 09:40:58 CET 2010 - tgoettlicher@suse.de
- disables native dialogs (bnc #642270)
Modified: trunk/qt/src/YQTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQTree.cc?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/src/YQTree.cc (original)
+++ trunk/qt/src/YQTree.cc Mon Dec 20 17:01:47 2010
@@ -63,9 +63,9 @@
#define VERBOSE_TREE_ITEMS 0
-YQTree::YQTree( YWidget * parent, const string & label )
+YQTree::YQTree( YWidget * parent, const string & label, bool multiSelectionMode )
: QFrame( (QWidget *) parent->widgetRep() )
- , YTree( parent, label )
+ , YTree( parent, label, multiSelectionMode )
{
QVBoxLayout* layout = new QVBoxLayout( this );
setLayout( layout );
@@ -98,6 +98,9 @@
connect( _qt_treeWidget, SIGNAL( itemSelectionChanged () ),
this, SLOT ( slotSelectionChanged () ) );
+ connect( _qt_treeWidget, SIGNAL( itemClicked ( QTreeWidgetItem *, int ) ),
+ this, SLOT ( slotSelectionChanged () ) );
+
connect( _qt_treeWidget, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ),
this, SLOT ( slotActivated ( QTreeWidgetItem * ) ) );
@@ -189,12 +192,16 @@
_qt_treeWidget->setCurrentItem( item );
item->setSelected( true );
+ if ( hasMultiSelection() )
+ item->setCheckState( 0, Qt::Checked );
+
if ( item->parent() )
openBranch( (YQTreeItem *) item->parent() );
YTree::selectItem( item->origItem(), true );
// yuiDebug() << "selected item: \"" << item->origItem()->label() << "\"" << endl;
+
}
}
@@ -250,14 +257,35 @@
void YQTree::slotSelectionChanged( )
{
- QList items = _qt_treeWidget->selectedItems ();
-
- if ( ! items.empty() )
+ if ( hasMultiSelection() )
{
- QTreeWidgetItem *qItem = items.first();
- selectItem( dynamic_cast (qItem) );
+ QTreeWidgetItemIterator it( _qt_treeWidget);
+ while (*it)
+ {
+ YQTreeItem * treeItem = dynamic_cast (*it);
+
+ if ( treeItem )
+ {
+ if ( treeItem->checkState(0) == Qt::Checked )
+ treeItem->origItem()->setSelected( true );
+ else
+ treeItem->origItem()->setSelected( false );
+ }
+ ++it;
+ }
+ }
+ else
+ {
+ QList items = _qt_treeWidget->selectedItems ();
+
+ if ( ! items.empty() )
+ {
+ QTreeWidgetItem *qItem = items.first();
+ selectItem( dynamic_cast (qItem) );
+ }
}
+
if ( notify() && ! YQUI::ui()->eventPendingFor( this ) )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::SelectionChanged ) );
}
@@ -337,6 +365,7 @@
#if VERBOSE_TREE_ITEMS
yuiDebug() << "Creating toplevel tree item \"" << orig->label() << "\"" << endl;
#endif
+
}
@@ -353,6 +382,9 @@
<< endl;
#endif
+
+
+
}
@@ -382,6 +414,9 @@
else
setData( 0, Qt::DecorationRole, icon );
}
+
+ if ( tree->hasMultiSelection() )
+ setCheckState(0,Qt::Unchecked);
}
Modified: trunk/qt/src/YQTree.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQTree.h?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/src/YQTree.h (original)
+++ trunk/qt/src/YQTree.h Mon Dec 20 17:01:47 2010
@@ -60,7 +60,7 @@
/**
* Constructor.
**/
- YQTree( YWidget * parent, const string & label );
+ YQTree( YWidget * parent, const string & label, bool multiSelection );
/**
* Destructor.
Modified: trunk/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWidgetFactory.cc?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/src/YQWidgetFactory.cc (original)
+++ trunk/qt/src/YQWidgetFactory.cc Mon Dec 20 17:01:47 2010
@@ -199,9 +199,9 @@
YQTree *
-YQWidgetFactory::createTree( YWidget * parent, const string & label )
+YQWidgetFactory::createTree( YWidget * parent, const string & label, bool multiselection )
{
- YQTree * tree = new YQTree( parent, label );
+ YQTree * tree = new YQTree( parent, label, multiselection );
YUI_CHECK_NEW( tree );
return tree;
Modified: trunk/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWidgetFactory.h?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/src/YQWidgetFactory.h (original)
+++ trunk/qt/src/YQWidgetFactory.h Mon Dec 20 17:01:47 2010
@@ -112,7 +112,7 @@
virtual YQRadioButton * createRadioButton ( YWidget * parent, const string & label, bool isChecked = false );
virtual YQComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false );
virtual YQSelectionBox * createSelectionBox ( YWidget * parent, const string & label );
- virtual YQTree * createTree ( YWidget * parent, const string & label );
+ virtual YQTree * createTree ( YWidget * parent, const string & label, bool multiselection = false );
virtual YQTable * createTable ( YWidget * parent, YTableHeader * header, bool multiSelection = false );
virtual YQProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 );
virtual YQRichText * createRichText ( YWidget * parent, const string & text = string(), bool plainTextMode = false );
Modified: trunk/qt/yast2-qt.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/yast2-qt.spec.in?rev=63017&r1=63016&r2=63017&view=diff
==============================================================================
--- trunk/qt/yast2-qt.spec.in (original)
+++ trunk/qt/yast2-qt.spec.in Mon Dec 20 17:01:47 2010
@@ -20,8 +20,8 @@
Summary: YaST2 - Graphical User Interface
BuildRequires: yast2-devtools >= 2.16.3
#YIconLoader
-BuildRequires: yast2-libyui-devel >= 2.18.8
-Requires: yast2-libyui >= 2.18.8
+BuildRequires: yast2-libyui-devel >= 2.19.2
+Requires: yast2-libyui >= 2.19.2
Requires: yast2_theme >= 2.16.1
Provides: yast2_ui
Provides: y2base:/usr/lib/YaST2/servers/qt
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org