Author: sh-sh-sh
Date: Thu Jul 12 19:21:33 2007
New Revision: 39377
URL: http://svn.opensuse.org/viewcvs/yast?rev=39377&view=rev
Log:
honor caption
Modified:
branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc
branches/tmp/sh/mod-ui/qt/src/YQDate.cc
branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc
branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
branches/tmp/sh/mod-ui/qt/src/YQIntField.cc
branches/tmp/sh/mod-ui/qt/src/YQLogView.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc
branches/tmp/sh/mod-ui/qt/src/YQProgressBar.cc
branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
branches/tmp/sh/mod-ui/qt/src/YQSlider.cc
branches/tmp/sh/mod-ui/qt/src/YQTime.cc
branches/tmp/sh/mod-ui/qt/src/YQTree.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetCaption.cc
Modified: branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc Thu Jul 12 19:21:33 2007
@@ -49,7 +49,11 @@
setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
+ YUI_CHECK_NEW( _caption );
+
_qt_comboBox = new QComboBox( editable, this );
+ YUI_CHECK_NEW( _caption );
+
_caption->setBuddy( _qt_comboBox );
#if SEND_SELECTION_CHANGED_EVENT
Modified: branches/tmp/sh/mod-ui/qt/src/YQDate.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDate.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDate.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDate.cc Thu Jul 12 19:21:33 2007
@@ -39,7 +39,11 @@
setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label->value() );
+ YUI_CHECK_NEW( _caption );
+
_qt_dateedit = new QDateEdit( this );
+ YUI_CHECK_NEW( _qt_dateedit );
+
_qt_dateedit->setOrder( QDateEdit::DMY );
_qt_dateedit->setDate( QDate::fromString(date->value(), Qt::ISODate ));
Modified: branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDownloadProgress.cc Thu Jul 12 19:21:33 2007
@@ -41,9 +41,12 @@
setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label->value() );
+ YUI_CHECK_NEW( _caption );
+
_qt_progress = new QProgressBar( this );
+ YUI_CHECK_NEW( _qt_progress );
+
_qt_progress->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
_qt_progress->setTotalSteps( expectedSize );
_qt_progress->setProgress( currentFileSize() );
Modified: branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputField.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQInputField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.cc Thu Jul 12 19:21:33 2007
@@ -115,10 +115,7 @@
int YQInputField::preferredWidth()
{
int minSize = shrinkable() ? 20 : 200;
- int hintWidth = _caption->sizeHint().width();
-
- if ( ! _caption->isVisible() )
- hintWidth = 0;
+ int hintWidth = _caption->isShown() ? _caption->sizeHint().width() : 0;
return max( minSize, hintWidth );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQIntField.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQIntField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQIntField.cc Thu Jul 12 19:21:33 2007
@@ -44,9 +44,12 @@
setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label->value() );
+ YUI_CHECK_NEW( _caption );
+
_qt_spinbox = new QSpinBox( minValue, maxValue,
1, // step
this );
+ YUI_CHECK_NEW( _qt_spinbox );
_qt_spinbox->setValue( initialValue );
_caption->setBuddy( _qt_spinbox );
Modified: branches/tmp/sh/mod-ui/qt/src/YQLogView.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQLogView.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQLogView.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQLogView.cc Thu Jul 12 19:21:33 2007
@@ -45,7 +45,11 @@
setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label->value() );
+ YUI_CHECK_NEW( _caption );
+
_qt_text = new QMultiLineEdit( this );
+ YUI_CHECK_NEW( _qt_text );
+
_qt_text->setReadOnly( true );
_qt_text->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
@@ -68,12 +72,14 @@
int YQLogView::preferredHeight()
{
- int hintHeight = _caption->sizeHint().height();
- hintHeight += visibleLines() * _qt_text->fontMetrics().lineSpacing();
+ int hintHeight = visibleLines() * _qt_text->fontMetrics().lineSpacing();
hintHeight += _qt_text->style().scrollBarExtent().height();
hintHeight += _qt_text->frameWidth() * 2;
+
+ if ( _caption->isShown() )
+ hintHeight += _caption->sizeHint().height();
- return max( 10, hintHeight );
+ return max( 80, hintHeight );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc Thu Jul 12 19:21:33 2007
@@ -40,11 +40,15 @@
setSpacing( YQWidgetSpacing );
setMargin ( YQWidgetMargin );
- _caption = new YQWidgetCaption( this, label );
+ _caption = new YQWidgetCaption( this, label );
+ YUI_CHECK_NEW( _caption );
+
_qt_textEdit = new QTextEdit( this );
+ YUI_CHECK_NEW( _qt_textEdit );
+
_qt_textEdit->setTextFormat( Qt::PlainText );
_qt_textEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
-
+
_caption->setBuddy( _qt_textEdit );
connect( _qt_textEdit, SIGNAL( textChanged( void ) ),
@@ -169,7 +173,7 @@
int hintHeight = defaultVisibleLines() * _qt_textEdit->fontMetrics().lineSpacing();
hintHeight += _qt_textEdit->frameWidth() * 2 + YQWidgetMargin * 2;
- if ( _caption && _caption->isShown() )
+ if ( _caption->isShown() )
hintHeight += _caption->sizeHint().height() + YQWidgetSpacing;
return max( 10, hintHeight );
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc Thu Jul 12 19:21:33 2007
@@ -47,8 +47,12 @@
setSpacing( YQWidgetSpacing );
setMargin( YQWidgetMargin );
- _caption = new YQWidgetCaption( this, label );
+ _caption = new YQWidgetCaption( this, label );
+ YUI_CHECK_NEW( _caption );
+
_qt_listView = new QListView( this );
+ YUI_CHECK_NEW( _qt_listView );
+
_qt_listView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
_qt_listView->addColumn( "" ); // QListView doesn't have one single column by default!
_qt_listView->setSorting( 0, false );
@@ -176,7 +180,8 @@
int YQMultiSelectionBox::preferredWidth()
{
- int hintWidth = _caption->sizeHint().width() + frameWidth();
+ int hintWidth = _caption->isShown() ?
+ _caption->sizeHint().width() + frameWidth() : 0;
return max( 80, hintWidth );
}
@@ -184,7 +189,7 @@
int YQMultiSelectionBox::preferredHeight()
{
- int hintHeight = _caption->sizeHint().height();
+ int hintHeight = _caption->isShown() ? _caption->sizeHint().height() : 0;
int visibleLines = shrinkable() ? SHRINKABLE_VISIBLE_LINES : DEFAULT_VISIBLE_LINES;
hintHeight += visibleLines * _qt_listView->fontMetrics().lineSpacing();
hintHeight += _qt_listView->frameWidth() * 2;
Modified: branches/tmp/sh/mod-ui/qt/src/YQProgressBar.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQProgressBar.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQProgressBar.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQProgressBar.cc Thu Jul 12 19:21:33 2007
@@ -41,8 +41,12 @@
setSpacing( YQWidgetSpacing );
setMargin ( YQWidgetMargin );
- _caption = new YQWidgetCaption( this, label );
+ _caption = new YQWidgetCaption( this, label );
+ YUI_CHECK_NEW( _caption );
+
_qt_progressbar = new QProgressBar( maxValue, this );
+ YUI_CHECK_NEW( _qt_progressbar );
+
_caption->setBuddy( _qt_progressbar );
}
@@ -78,10 +82,8 @@
int YQProgressBar::preferredWidth()
{
- int hintWidth = _caption->sizeHint().width() + margin();
-
- if ( ! _caption->isVisible() )
- hintWidth = 0;
+ int hintWidth = _caption->isShown() ?
+ _caption->sizeHint().width() + margin() : 0;
return max( 200, hintWidth );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc Thu Jul 12 19:21:33 2007
@@ -52,10 +52,10 @@
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
+
_qt_listBox = new QListBox( this );
YUI_CHECK_NEW( _qt_listBox );
-
+
_qt_listBox->installEventFilter( this );
_qt_listBox->setVariableHeight( false );
_qt_listBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,
@@ -120,7 +120,7 @@
void YQSelectionBox::selectItem( YItem * item, bool selected )
{
YQSignalBlocker sigBlocker( _qt_listBox );
-
+
YSelectionBox::selectItem( item, selected );
_qt_listBox->setCurrentItem( selected ? item->index() : -1 );
}
@@ -170,7 +170,7 @@
void YQSelectionBox::deleteAllItems()
{
YQSignalBlocker sigBlocker( _qt_listBox );
-
+
_qt_listBox->clear();
YSelectionBox::deleteAllItems();
}
@@ -179,7 +179,8 @@
int YQSelectionBox::preferredWidth()
{
- int hintWidth = _caption->sizeHint().width() + frameWidth();
+ int hintWidth = _caption->isShown() ?
+ _caption->sizeHint().width() + frameWidth() : 0;
return max( 80, hintWidth );
}
@@ -187,7 +188,7 @@
int YQSelectionBox::preferredHeight()
{
- int hintHeight = _caption->sizeHint().height();
+ int hintHeight = _caption->isShown() ? _caption->sizeHint().height() : 0;
int visibleLines = shrinkable() ? SHRINKABLE_VISIBLE_LINES : DEFAULT_VISIBLE_LINES;
hintHeight += visibleLines * _qt_listBox->fontMetrics().lineSpacing();
hintHeight += _qt_listBox->frameWidth() * 2;
Modified: branches/tmp/sh/mod-ui/qt/src/YQSlider.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSlider.cc?rev=39377&r1=39376&r2=39377&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSlider.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSlider.cc Thu Jul 12 19:21:33 2007
@@ -19,6 +19,7 @@
#define y2log_component "qt-ui"
#include