mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
kstyles: remove Q3 support code from Oxygen
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
30f08ff29e
commit
c22c687fa6
4 changed files with 3 additions and 135 deletions
|
@ -268,8 +268,6 @@ namespace Oxygen
|
|||
|
||||
// grab viewport widget
|
||||
QWidget *viewport( FrameShadowBase::viewport() );
|
||||
if( !viewport && parentWidget() && parentWidget()->inherits( "Q3ListView" ) )
|
||||
{ viewport = parentWidget(); }
|
||||
|
||||
// set cursor from viewport
|
||||
if (viewport) setCursor(viewport->cursor());
|
||||
|
|
|
@ -209,7 +209,7 @@ namespace Oxygen
|
|||
|
||||
//_______________________________________________________
|
||||
bool ShadowHelper::isToolBar( QWidget* widget ) const
|
||||
{ return qobject_cast<QToolBar*>( widget ) || widget->inherits( "Q3ToolBar" ); }
|
||||
{ return qobject_cast<QToolBar*>( widget ); }
|
||||
|
||||
//_______________________________________________________
|
||||
bool ShadowHelper::acceptWidget( QWidget* widget ) const
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
#include <QtGui/QRadioButton>
|
||||
#include <QtGui/QScrollBar>
|
||||
#include <QtGui/QSpinBox>
|
||||
#include <QtGui/qsplitter.h>
|
||||
#include <QtGui/QSplitter>
|
||||
#include <QtGui/QStylePlugin>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtGui/QTextEdit>
|
||||
|
@ -214,11 +214,6 @@ namespace Oxygen
|
|||
|
||||
polishScrollArea( scrollArea );
|
||||
|
||||
} else if( widget->inherits( "Q3ListView" ) ) {
|
||||
|
||||
addEventFilter( widget );
|
||||
widget->setAttribute( Qt::WA_Hover );
|
||||
|
||||
}
|
||||
|
||||
// several widgets set autofill background to false, which effectively breaks the background
|
||||
|
@ -365,7 +360,7 @@ namespace Oxygen
|
|||
// with ( usually sunken ) neighbor frames
|
||||
widget->setContentsMargins( 1, 1, 1, 1 );
|
||||
|
||||
} else if( widget->inherits( "Q3ToolBar" ) || qobject_cast<QToolBar*>( widget ) ) {
|
||||
} else if( qobject_cast<QToolBar*>( widget ) ) {
|
||||
|
||||
widget->setBackgroundRole( QPalette::NoRole );
|
||||
addEventFilter( widget );
|
||||
|
@ -449,13 +444,6 @@ namespace Oxygen
|
|||
if( isKTextEditFrame( widget ) )
|
||||
{ widget->setAttribute( Qt::WA_Hover, false ); }
|
||||
|
||||
if( widget && widget->inherits( "Q3ListView" ) ) {
|
||||
|
||||
widget->removeEventFilter( this );
|
||||
widget->setAttribute( Qt::WA_Hover, false );
|
||||
|
||||
}
|
||||
|
||||
// event filters
|
||||
switch ( widget->windowFlags() & Qt::WindowType_Mask )
|
||||
{
|
||||
|
@ -505,7 +493,6 @@ namespace Oxygen
|
|||
}
|
||||
|
||||
if( qobject_cast<QMenuBar*>( widget )
|
||||
|| ( widget && widget->inherits( "Q3ToolBar" ) )
|
||||
|| qobject_cast<QToolBar*>( widget )
|
||||
|| ( widget && qobject_cast<QToolBar *>( widget->parent() ) )
|
||||
|| qobject_cast<QToolBox*>( widget ) )
|
||||
|
@ -1031,10 +1018,6 @@ namespace Oxygen
|
|||
case PE_PanelTipLabel: fcn = &Style::drawPanelTipLabelPrimitive; break;
|
||||
|
||||
case PE_IndicatorMenuCheckMark: fcn = &Style::drawIndicatorMenuCheckMarkPrimitive; break;
|
||||
#ifndef QT_KATIE
|
||||
case PE_Q3CheckListIndicator: fcn = &Style::drawQ3CheckListIndicatorPrimitive; break;
|
||||
case PE_Q3CheckListExclusiveIndicator: fcn = &Style::drawQ3CheckListExclusiveIndicatorPrimitive; break;
|
||||
#endif
|
||||
case PE_IndicatorBranch: fcn = &Style::drawIndicatorBranchPrimitive; break;
|
||||
case PE_IndicatorButtonDropDown: fcn = &Style::drawIndicatorButtonDropDownPrimitive; break;
|
||||
case PE_IndicatorCheckBox: fcn = &Style::drawIndicatorCheckBoxPrimitive; break;
|
||||
|
@ -1136,9 +1119,6 @@ namespace Oxygen
|
|||
case CC_ComboBox: fcn = &Style::drawComboBoxComplexControl; break;
|
||||
case CC_Dial: fcn = &Style::drawDialComplexControl; break;
|
||||
case CC_GroupBox: fcn = &Style::drawGroupBoxComplexControl; break;
|
||||
#ifndef QT_KATIE
|
||||
case CC_Q3ListView: fcn = &Style::drawQ3ListViewComplexControl; break;
|
||||
#endif
|
||||
case CC_Slider: fcn = &Style::drawSliderComplexControl; break;
|
||||
case CC_SpinBox: fcn = &Style::drawSpinBoxComplexControl; break;
|
||||
case CC_TitleBar: fcn = &Style::drawTitleBarComplexControl; break;
|
||||
|
@ -1187,7 +1167,6 @@ namespace Oxygen
|
|||
// cast to QWidget
|
||||
QWidget *widget = static_cast<QWidget*>( object );
|
||||
|
||||
if( widget->inherits( "Q3ListView" ) ) { return eventFilterQ3ListView( widget, event ); }
|
||||
if( widget->inherits( "QComboBoxPrivateContainer" ) ) { return eventFilterComboBoxContainer( widget, event ); }
|
||||
|
||||
return QCommonStyle::eventFilter( object, event );
|
||||
|
@ -1328,20 +1307,6 @@ namespace Oxygen
|
|||
|
||||
}
|
||||
|
||||
//__________________________________________________________________________________
|
||||
bool Style::eventFilterQ3ListView( QWidget* widget, QEvent* event )
|
||||
{
|
||||
// this apparently fixes a Qt bug with Q3ListView, consisting in
|
||||
// the fact that Focus events do not trigger repaint of these
|
||||
switch( event->type() )
|
||||
{
|
||||
case QEvent::FocusIn: widget->update(); return false;
|
||||
case QEvent::FocusOut: widget->update(); return false;
|
||||
default: return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//_________________________________________________________
|
||||
bool Style::eventFilterScrollBar( QWidget* widget, QEvent* event )
|
||||
{
|
||||
|
@ -3376,38 +3341,6 @@ namespace Oxygen
|
|||
|
||||
}
|
||||
|
||||
#ifndef QT_KATIE
|
||||
//___________________________________________________________________________________
|
||||
bool Style::drawQ3CheckListIndicatorPrimitive( const QStyleOption *option, QPainter *painter, const QWidget *widget ) const
|
||||
{
|
||||
const QStyleOptionQ3ListView* listViewOpt( qstyleoption_cast<const QStyleOptionQ3ListView*>( option ) );
|
||||
if( !listViewOpt || listViewOpt->items.isEmpty() ) return true;
|
||||
|
||||
QStyleOptionButton buttonOption;
|
||||
buttonOption.QStyleOption::operator=( *option );
|
||||
|
||||
QSize size( CheckBox_Size, CheckBox_Size );
|
||||
buttonOption.rect = centerRect( option->rect, size ).translated( 0, 4 );
|
||||
drawIndicatorCheckBoxPrimitive( &buttonOption, painter, widget );
|
||||
return true;
|
||||
}
|
||||
|
||||
//___________________________________________________________________________________
|
||||
bool Style::drawQ3CheckListExclusiveIndicatorPrimitive( const QStyleOption *option, QPainter *painter, const QWidget *widget ) const
|
||||
{
|
||||
const QStyleOptionQ3ListView* listViewOpt( qstyleoption_cast<const QStyleOptionQ3ListView*>( option ) );
|
||||
if( !listViewOpt || listViewOpt->items.isEmpty() ) return true;
|
||||
|
||||
QStyleOptionButton buttonOption;
|
||||
buttonOption.QStyleOption::operator=( *option );
|
||||
|
||||
QSize size( CheckBox_Size, CheckBox_Size );
|
||||
buttonOption.rect = centerRect( option->rect, size ).translated( 0, 4 );
|
||||
drawIndicatorRadioButtonPrimitive( &buttonOption, painter, widget );
|
||||
return true;
|
||||
}
|
||||
#endif // QT_KATIE
|
||||
|
||||
//___________________________________________________________________________________
|
||||
bool Style::drawIndicatorBranchPrimitive( const QStyleOption* option, QPainter* painter, const QWidget* ) const
|
||||
{
|
||||
|
@ -7102,65 +7035,6 @@ namespace Oxygen
|
|||
} else return false;
|
||||
}
|
||||
|
||||
#ifndef QT_KATIE
|
||||
//______________________________________________________________
|
||||
bool Style::drawQ3ListViewComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const
|
||||
{
|
||||
|
||||
const QStyleOptionQ3ListView* optListView( qstyleoption_cast<const QStyleOptionQ3ListView*>( option ) );
|
||||
if( !optListView ) return true;
|
||||
|
||||
// this is copied from skulpture code
|
||||
// Copyright ( c ) 2007-2010 Christoph Feck <christoph@maxiom.de>
|
||||
if( optListView->subControls & QStyle::SC_Q3ListView )
|
||||
{
|
||||
painter->fillRect(
|
||||
optListView->rect,
|
||||
optListView->viewportPalette.brush( optListView->viewportBGRole ) );
|
||||
}
|
||||
|
||||
if( optListView->subControls & QStyle::SC_Q3ListViewBranch )
|
||||
{
|
||||
|
||||
QStyleOption opt = *static_cast<const QStyleOption*>( option );
|
||||
int y = optListView->rect.y();
|
||||
|
||||
for ( int i = 1; i < optListView->items.size(); ++i )
|
||||
{
|
||||
QStyleOptionQ3ListViewItem item = optListView->items.at( i );
|
||||
if( y + item.totalHeight > 0 && y < optListView->rect.height() )
|
||||
{
|
||||
opt.state = QStyle::State_Item;
|
||||
if ( i + 1 < optListView->items.size() )
|
||||
{ opt.state |= QStyle::State_Sibling; }
|
||||
|
||||
if(
|
||||
item.features & QStyleOptionQ3ListViewItem::Expandable
|
||||
|| ( item.childCount > 0 && item.height > 0 ) )
|
||||
{ opt.state |= QStyle::State_Children | ( item.state & QStyle::State_Open ); }
|
||||
|
||||
opt.rect = QRect( optListView->rect.left(), y, optListView->rect.width(), item.height );
|
||||
drawIndicatorBranchPrimitive( &opt, painter, widget );
|
||||
|
||||
if( ( opt.state & QStyle::State_Sibling ) && item.height < item.totalHeight )
|
||||
{
|
||||
opt.state = QStyle::State_Sibling;
|
||||
opt.rect = QRect(
|
||||
optListView->rect.left(), y + item.height,
|
||||
optListView->rect.width(), item.totalHeight - item.height );
|
||||
drawIndicatorBranchPrimitive( &opt, painter, widget );
|
||||
}
|
||||
}
|
||||
|
||||
y += item.totalHeight;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
#endif // QT_KATIE
|
||||
|
||||
//______________________________________________________________
|
||||
bool Style::drawSliderComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const
|
||||
{
|
||||
|
|
|
@ -173,7 +173,6 @@ namespace Oxygen
|
|||
bool eventFilterComboBoxContainer( QWidget*, QEvent* );
|
||||
bool eventFilterDockWidget( QDockWidget*, QEvent* );
|
||||
bool eventFilterMdiSubWindow( QMdiSubWindow*, QEvent* );
|
||||
bool eventFilterQ3ListView( QWidget*, QEvent* );
|
||||
bool eventFilterScrollBar( QWidget*, QEvent* );
|
||||
bool eventFilterTabBar( QWidget*, QEvent* );
|
||||
bool eventFilterToolBar( QToolBar*, QEvent* );
|
||||
|
@ -515,8 +514,6 @@ namespace Oxygen
|
|||
bool drawPanelItemViewItemPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawPanelLineEditPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawIndicatorMenuCheckMarkPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawQ3CheckListIndicatorPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawQ3CheckListExclusiveIndicatorPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawIndicatorBranchPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawIndicatorButtonDropDownPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
bool drawIndicatorCheckBoxPrimitive( const QStyleOption*, QPainter*, const QWidget* ) const;
|
||||
|
@ -590,7 +587,6 @@ namespace Oxygen
|
|||
bool drawComboBoxComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
bool drawDialComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
bool drawGroupBoxComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
bool drawQ3ListViewComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
bool drawSliderComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
bool drawSpinBoxComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
bool drawTitleBarComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
|
||||
|
|
Loading…
Add table
Reference in a new issue