Author: dmacvicar
Date: Fri Nov 30 12:03:22 2007
New Revision: 42539
URL: http://svn.opensuse.org/viewcvs/yast?rev=42539&view=rev
Log:
YQComboBox
Modified:
branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc
branches/tmp/coolo/qt4-port/src/YQComboBox.cc
Modified: branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc?rev=42539&r1=42538&r2=42539&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc Fri Nov 30 12:03:22 2007
@@ -103,10 +103,8 @@
*/
// Find the check box in the child hierarchy (as a direct child)
-
- _checkBox = dynamic_cast( QObject::child( 0, // objName
- "QCheckBox", // inheritsClass
- false ) ); // recursive
+ // NOTE findChild search recursively by default
+ _checkBox = QObject::findChild();
if ( ! _checkBox )
{
Modified: branches/tmp/coolo/qt4-port/src/YQComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQComboBox.cc?rev=42539&r1=42538&r2=42539&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQComboBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQComboBox.cc Fri Nov 30 12:03:22 2007
@@ -55,7 +55,8 @@
YUI_CHECK_NEW( _caption );
layout->addWidget( _caption );
- _qt_comboBox = new QComboBox( editable, this );
+ _qt_comboBox = new QComboBox(this);
+ _qt_comboBox->setEditable(editable);
YUI_CHECK_NEW( _caption );
layout->addWidget( _qt_comboBox );
@@ -93,7 +94,7 @@
if ( isValidText( text ) )
{
YQSignalBlocker sigBlocker( _qt_comboBox );
- _qt_comboBox->setCurrentText( text );
+ _qt_comboBox->setItemText(_qt_comboBox->currentIndex(), text );
}
else
{
@@ -106,21 +107,21 @@
void YQComboBox::addItem( YItem * item )
{
YComboBox::addItem( item );
- QPixmap icon;
+ QIcon icon;
if ( item->hasIconName() )
{
string iconName = iconFullPath( item );
- icon = QPixmap( iconName.c_str() );
+ icon = QIcon( iconName.c_str() );
if ( icon.isNull() )
y2warning( "Can't load icon %s", iconName.c_str() );
}
if ( icon.isNull() )
- _qt_comboBox->insertItem( fromUTF8( item->label() ) );
+ _qt_comboBox->insertItem( -1, fromUTF8( item->label() ) );
else
- _qt_comboBox->insertItem( icon, fromUTF8( item->label() ) );
+ _qt_comboBox->insertItem( -1, icon, fromUTF8( item->label() ) );
if ( item->selected() )
{
@@ -148,7 +149,7 @@
void YQComboBox::setValidChars( const string & newValidChars )
{
- if ( ! _qt_comboBox->editable() )
+ if ( ! _qt_comboBox->isEditable() )
{
y2warning( "Setting ValidChars is useless on a combo box that isn't editable! (%s)",
debugLabel().c_str() );
@@ -171,10 +172,10 @@
if ( ! isValidText( _qt_comboBox->currentText() ) )
{
y2error( "Old value \"%s\" of %s \"%s\" invalid according to ValidChars \"%s\" - deleting",
- (const char *) _qt_comboBox->currentText(),
+ qPrintable(_qt_comboBox->currentText()),
widgetClass(), debugLabel().c_str(),
newValidChars.c_str() );
- _qt_comboBox->setCurrentText( "" );
+ _qt_comboBox->setItemText(_qt_comboBox->currentIndex(), "");
}
YComboBox::setValidChars( newValidChars );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org