summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/big-screen/owidgetstack.cpp0
-rw-r--r--libopie2/opieui/ofontselector.cpp1
-rw-r--r--libopie2/opieui/olistview.cpp4
-rw-r--r--libopie2/opieui/oselector.cpp2
-rw-r--r--libopie2/opieui/owait.cpp1
5 files changed, 8 insertions, 0 deletions
diff --git a/libopie2/opieui/big-screen/owidgetstack.cpp b/libopie2/opieui/big-screen/owidgetstack.cpp
index de7f83f..9c9f7ec 100644
--- a/libopie2/opieui/big-screen/owidgetstack.cpp
+++ b/libopie2/opieui/big-screen/owidgetstack.cpp
diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp
index 6763ee6..4870cd9 100644
--- a/libopie2/opieui/ofontselector.cpp
+++ b/libopie2/opieui/ofontselector.cpp
@@ -164,64 +164,65 @@ OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *nam
}
else
d->m_preview = 0;
loadFonts ( d->m_font_family_list );
}
OFontSelector::~OFontSelector()
{
delete d;
}
/**
* This methods tries to set the font
* @param f The wishes font
* @return success or failure
*/
bool OFontSelector::setSelectedFont ( const QFont &f )
{
return setSelectedFont ( f. family(), d->m_fdb. styleString ( f ), f. pointSize(), QFont::encodingName ( f. charSet()));
}
/**
* This is an overloaded method @see setSelectedFont
* @param familyStr The family of the font
* @param styleStr The style of the font
* @param sizeVal The size of font
* @param charset The charset to be used. Will be deprecated by QT3
*/
bool OFontSelector::setSelectedFont( const QString &familyStr, const QString &styleStr, int sizeVal, const QString & charset )
{
+ Q_CONST_UNUSED( charset )
QString sizeStr = QString::number ( sizeVal );
QListBoxItem *family = d->m_font_family_list->findItem ( familyStr );
if ( !family )
family = d->m_font_family_list->findItem ( "Helvetica" );
if ( !family )
family = d->m_font_family_list->firstItem();
d->m_font_family_list->setCurrentItem ( family );
fontFamilyClicked ( d->m_font_family_list->index ( family ));
int style = findItemCB ( d->m_font_style_list, styleStr );
if ( style < 0 )
style = findItemCB ( d->m_font_style_list, "Regular" );
if ( style < 0 && d->m_font_style_list->count() > 0 )
style = 0;
d->m_font_style_list->setCurrentItem ( style );
fontStyleClicked ( style );
int size = findItemCB ( d->m_font_size_list, sizeStr );
if ( size < 0 )
size = findItemCB ( d->m_font_size_list, "10" );
if ( size < 0 && d->m_font_size_list->count() > 0 )
size = 0;
d->m_font_size_list->setCurrentItem ( size );
fontSizeClicked ( size );
return (( family ) && ( style >= 0 ) && ( size >= 0 ));
}
/**
* This method returns the name, style and size of the currently selected
* font or false if no font is selected
diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp
index b90c786..67b4b83 100644
--- a/libopie2/opieui/olistview.cpp
+++ b/libopie2/opieui/olistview.cpp
@@ -203,69 +203,71 @@ void OListView::serializeFrom( QDataStream& s )
odebug << "OListView loaded." << oendl;
}
void OListView::expand()
{
odebug << "OListView::expand" << oendl;
QListViewItemIterator it( this );
while ( it.current() ) {
it.current()->setOpen( true );
++it;
}
}
void OListView::collapse()
{
odebug << "OListView::collapse" << oendl;
QListViewItemIterator it( this );
while ( it.current() ) {
it.current()->setOpen( false );
++it;
}
}
QDataStream& operator<<( QDataStream& s, const OListView& lv )
{
lv.serializeTo( s );
+ return s;
}
QDataStream& operator>>( QDataStream& s, OListView& lv )
{
lv.serializeFrom( s );
+ return s;
}
#endif // QT_NO_DATASTREAM
/*======================================================================================
* OListViewItem
*======================================================================================*/
OListViewItem::OListViewItem(QListView *parent)
: QListViewItem(parent)
{
init();
}
OListViewItem::OListViewItem(QListViewItem *parent)
: QListViewItem(parent)
{
init();
}
OListViewItem::OListViewItem(QListView *parent, QListViewItem *after)
: QListViewItem(parent, after)
{
init();
}
OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after)
: QListViewItem(parent, after)
{
init();
@@ -434,70 +436,72 @@ void OListViewItem::serializeTo( QDataStream& s ) const
void OListViewItem::serializeFrom( QDataStream& s )
{
#warning Caution... the binary format is still under construction...
odebug << "loading OListViewItem..." << oendl;
for ( int i = 0; i < listView()->columns(); ++i )
{
QString coltext;
s >> coltext;
odebug << "read text '" << coltext << "' for column " << i << "" << oendl;
setText( i, coltext );
}
int items;
s >> items;
odebug << "read number of items = " << items << "" << oendl;
for ( int i = 0; i < items; ++i )
{
OListViewItem* item = childFactory();
s >> (*item);
}
odebug << "OListViewItem loaded." << oendl;
}
QDataStream& operator<<( QDataStream& s, const OListViewItem& lvi )
{
lvi.serializeTo( s );
+ return s;
}
QDataStream& operator>>( QDataStream& s, OListViewItem& lvi )
{
lvi.serializeFrom( s );
+ return s;
}
#endif // QT_NO_DATASTREAM
/*======================================================================================
* OCheckListItem
*======================================================================================*/
OCheckListItem::OCheckListItem( QCheckListItem* parent, const QString& text, Type t )
:QCheckListItem( parent, text, t )
{
init();
}
OCheckListItem::OCheckListItem( QListViewItem* parent, const QString& text, Type t)
:QCheckListItem( parent, text, t )
{
init();
}
OCheckListItem::OCheckListItem( QListView* parent, const QString& text, Type t )
:QCheckListItem( parent, text, t )
{
init();
}
OCheckListItem::OCheckListItem( QListViewItem* parent, const QString& text, const QPixmap& p )
:QCheckListItem( parent, text, p )
{
diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp
index 5f6f10f..05543c5 100644
--- a/libopie2/opieui/oselector.cpp
+++ b/libopie2/opieui/oselector.cpp
@@ -117,64 +117,66 @@ void OXYSelector::paintEvent( QPaintEvent *ev )
}
painter.end();
}
void OXYSelector::mousePressEvent( QMouseEvent *e )
{
int xVal, yVal;
valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal );
setValues( xVal, yVal );
emit valueChanged( xPos, yPos );
}
void OXYSelector::mouseMoveEvent( QMouseEvent *e )
{
int xVal, yVal;
valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal );
setValues( xVal, yVal );
emit valueChanged( xPos, yPos );
}
void OXYSelector::wheelEvent( QWheelEvent *e )
{
#if QT_VERSION > 290
if ( e->orientation() == Qt::Horizontal )
setValues( xValue() + e->delta()/120, yValue() );
else
setValues( xValue(), yValue() + e->delta()/120 );
emit valueChanged( xPos, yPos );
+ #else
+ Q_UNUSED( e )
#endif
}
void OXYSelector::valuesFromPosition( int x, int y, int &xVal, int &yVal ) const
{
xVal = ( (maxX-minX) * (x-2) ) / ( width()-4 );
yVal = maxY - ( ( (maxY-minY) * (y-2) ) / ( height()-4 ) );
if ( xVal > maxX )
xVal = maxX;
else if ( xVal < minX )
xVal = minX;
if ( yVal > maxY )
yVal = maxY;
else if ( yVal < minY )
yVal = minY;
}
void OXYSelector::setPosition( int xp, int yp )
{
if ( xp < 2 )
xp = 2;
else if ( xp > width() - 2 )
xp = width() - 2;
if ( yp < 2 )
yp = 2;
else if ( yp > height() - 2 )
yp = height() - 2;
QPainter painter;
diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp
index 9519888..ec1f25a 100644
--- a/libopie2/opieui/owait.cpp
+++ b/libopie2/opieui/owait.cpp
@@ -26,64 +26,65 @@
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "owait.h"
/* OPIE */
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
/* QT */
#include <qlayout.h>
#include <qpainter.h>
using namespace Opie::Ui;
static int frame = 0;
/**
* This will construct a modal dialog.
*
* The default timer length is 10.
*
* @param parent The parent of the widget
* @param msg The name of the object
* @param dispIcon Display Icon?
*/
OWait::OWait( QWidget *parent, const char* msg, bool dispIcon )
:QDialog( parent, msg, TRUE, WStyle_Customize )
{
+ Q_UNUSED( dispIcon )
QHBoxLayout * hbox = new QHBoxLayout( this );
m_lb = new QLabel( this );
m_lb->setBackgroundMode ( NoBackground );
hbox->addWidget( m_lb );
hbox->activate();
m_pix = Resource::loadPixmap( "BigBusy" );
m_aniSize = m_pix.height();
resize( m_aniSize, m_aniSize );
m_timerLength = 10;
m_waitTimer = new QTimer( this );
connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) );
}
void OWait::timerEvent( QTimerEvent * )
{
frame = ( ++frame ) % 4;
repaint();
}
void OWait::paintEvent( QPaintEvent * )
{
QPainter p( m_lb );
p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize );
}
void OWait::show()