author | mickeyl <mickeyl> | 2005-02-07 15:00:36 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-07 15:00:36 (UTC) |
commit | 0bc169b13ad563819b6483beef775be26016832b (patch) (side-by-side diff) | |
tree | 004ef63126b46ce1b9a18bf5403fe9ce9c256465 /libopie2/opieui | |
parent | 896d2e77ebafd09ee58d6148e31365f47a3668b4 (diff) | |
download | opie-0bc169b13ad563819b6483beef775be26016832b.zip opie-0bc169b13ad563819b6483beef775be26016832b.tar.gz opie-0bc169b13ad563819b6483beef775be26016832b.tar.bz2 |
work around qt_version() bug in Qt/Embedded 2.3.10
-rw-r--r-- | libopie2/opieui/ofontselector.cpp | 2 | ||||
-rw-r--r-- | libopie2/opieui/opieui.pro | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index 6c24f14..8b679c8 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp @@ -91,129 +91,129 @@ public: private: QStringList m_styles; QValueList<int> m_sizes; QString m_name; }; } } } using namespace Opie::Ui; using namespace Opie::Ui::Internal; static int findItemCB( QComboBox *box, const QString &str ) { for ( int i = 0; i < box->count(); i++ ) { if ( box->text ( i ) == str ) return i; } return -1; } /* static same as anon. namespace */ static int qt_version() { const char *qver = qVersion(); return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); } /** * Constructs the Selector object * @param withpreview If a font preview should be given * @param parent The parent of the Font Selector * @param name The name of the object * @param fl WidgetFlags */ OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl ) { d = new OFontSelectorPrivate(); QGridLayout *gridLayout = new QGridLayout( this, 0, 0, 4, 4 ); gridLayout->setRowStretch( 4, 10 ); d->m_font_family_list = new QListBox( this, "FontListBox" ); gridLayout->addMultiCellWidget( d->m_font_family_list, 0, 4, 0, 0 ); connect( d->m_font_family_list, SIGNAL( highlighted(int) ), this, SLOT( fontFamilyClicked(int) ) ); QLabel *label = new QLabel( tr( "Style" ), this ); gridLayout->addWidget( label, 0, 1 ); d->m_font_style_list = new QComboBox( this, "StyleListBox" ); connect( d->m_font_style_list, SIGNAL( activated(int) ), this, SLOT( fontStyleClicked(int) ) ); gridLayout->addWidget( d->m_font_style_list, 1, 1 ); label = new QLabel( tr( "Size" ), this ); gridLayout->addWidget( label, 2, 1 ); d->m_font_size_list = new QComboBox( this, "SizeListBox" ); connect( d->m_font_size_list, SIGNAL( activated(int) ), this, SLOT( fontSizeClicked(int) ) ); gridLayout->addWidget( d->m_font_size_list, 3, 1 ); - d->m_pointbug = ( qt_version() <= 233 ); + d->m_pointbug = ( qt_version() == 232 || qt_version() == 233 ); // SharpROM uses 2.3.2 if ( withpreview ) { d->m_preview = new QMultiLineEdit ( this, "Preview" ); d->m_preview->setAlignment ( AlignCenter ); d->m_preview->setWordWrap ( QMultiLineEdit::WidgetWidth ); d->m_preview->setMargin ( 3 ); d->m_preview->setText ( tr( "The Quick Brown Fox Jumps Over The Lazy Dog" )); gridLayout->addRowSpacing ( 5, 4 ); gridLayout->addMultiCellWidget ( d->m_preview, 6, 6, 0, 1 ); gridLayout->setRowStretch ( 6, 5 ); } 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 ) diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro index ffa8b83..5525ea2 100644 --- a/libopie2/opieui/opieui.pro +++ b/libopie2/opieui/opieui.pro @@ -1,65 +1,65 @@ TEMPLATE = lib CONFIG += qt warn_on DESTDIR = $(OPIEDIR)/lib HEADERS = oclickablelabel.h \ odialog.h \ ofontselector.h \ oimageeffect.h \ okeyconfigwidget.h \ oledbox.h \ olistview.h \ opixmapeffect.h \ opopupmenu.h \ opixmapprovider.h \ oselector.h \ oseparator.h \ otabinfo.h \ otabbar.h \ otabwidget.h \ otaskbarapplet.h \ otimepicker.h \ oversatileview.h \ oversatileviewitem.h \ owait.h SOURCES = oclickablelabel.cpp \ odialog.cpp \ ofontselector.cpp \ oimageeffect.cpp \ okeyconfigwidget.cpp \ oledbox.cpp \ olistview.cpp \ opixmapeffect.cpp \ opopupmenu.cpp \ opixmapprovider.cpp \ oselector.cpp \ oseparator.cpp \ otabbar.cpp \ otabwidget.cpp \ otaskbarapplet.cpp \ otimepicker.cpp \ oversatileview.cpp \ oversatileviewitem.cpp \ owait.cpp include( big-screen/big-screen.pro ) include( fileselector/fileselector.pro ) INTERFACES = otimepickerbase.ui TARGET = opieui2 -VERSION = 1.9.0 +VERSION = 1.9.1 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lopiecore2 !contains( platform, x11 ) { include( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } |