mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 11:40:07 +00:00
compile some more files
svn path=/branches/work/kde4/playground/graphics/okular/; revision=521912
This commit is contained in:
parent
cbb8e80154
commit
ec923ec701
|
@ -9,6 +9,7 @@
|
|||
***************************************************************************/
|
||||
|
||||
// qt / kde includes
|
||||
#include <qevent.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
|
@ -16,7 +17,7 @@
|
|||
#include <qvalidator.h>
|
||||
#include <qpainter.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kaccelmanager.h>
|
||||
#include <kacceleratormanager.h>
|
||||
#include <kdeversion.h>
|
||||
|
||||
// local includes
|
||||
|
@ -134,7 +135,7 @@ MiniBar::~MiniBar()
|
|||
m_document->removeObserver( this );
|
||||
}
|
||||
|
||||
void MiniBar::notifySetup( const QValueVector< KPDFPage * > & pageVector, bool changed )
|
||||
void MiniBar::notifySetup( const QVector< KPDFPage * > & pageVector, bool changed )
|
||||
{
|
||||
// only process data when document changes
|
||||
if ( !changed )
|
||||
|
@ -259,7 +260,7 @@ void MiniBar::slotEmitPrevPage()
|
|||
/** ProgressWidget **/
|
||||
|
||||
ProgressWidget::ProgressWidget( MiniBar * parent )
|
||||
: QWidget( parent, "progress", WNoAutoErase ),
|
||||
: QWidget( parent, "progress", Qt::WNoAutoErase ),
|
||||
m_miniBar( parent ), m_progressPercentage( -1 )
|
||||
{
|
||||
setFixedHeight( 4 );
|
||||
|
@ -328,7 +329,8 @@ PagesEdit::PagesEdit( MiniBar * parent )
|
|||
: QLineEdit( parent ), m_miniBar( parent ), m_eatClick( false )
|
||||
{
|
||||
// customize look
|
||||
setFrameShadow( QFrame::Raised );
|
||||
#warning don't know how to port setFrameShadow
|
||||
// setFrameShadow( QFrame::Raised );
|
||||
focusOutEvent( 0 );
|
||||
|
||||
// use an integer validator
|
||||
|
@ -358,10 +360,11 @@ void PagesEdit::focusInEvent( QFocusEvent * e )
|
|||
{
|
||||
// select all text
|
||||
selectAll();
|
||||
if ( e->reason() == QFocusEvent::Mouse )
|
||||
if ( e->reason() == Qt::MouseFocusReason )
|
||||
m_eatClick = true;
|
||||
// change background color to the default 'edit' color
|
||||
setLineWidth( 2 );
|
||||
#warning don't know how to port setLineWidth
|
||||
// setLineWidth( 2 );
|
||||
setPaletteBackgroundColor( Qt::white );
|
||||
// call default handler
|
||||
QLineEdit::focusInEvent( e );
|
||||
|
@ -370,7 +373,8 @@ void PagesEdit::focusInEvent( QFocusEvent * e )
|
|||
void PagesEdit::focusOutEvent( QFocusEvent * e )
|
||||
{
|
||||
// change background color to a dark tone
|
||||
setLineWidth( 1 );
|
||||
#warning don't know how to port setLineWidth
|
||||
// setLineWidth( 1 );
|
||||
setPaletteBackgroundColor( palette().active().background().light( 105 ) );
|
||||
// restore text
|
||||
QLineEdit::setText( backString );
|
||||
|
@ -427,8 +431,9 @@ void HoverButton::paintEvent( QPaintEvent * e )
|
|||
else
|
||||
{
|
||||
QPainter p( this );
|
||||
p.fillRect(e->rect(), parentWidget() ? parentWidget()->palette().brush(QPalette::Active, QColorGroup::Background) : paletteBackgroundColor());
|
||||
drawButtonLabel( &p );
|
||||
p.fillRect(e->rect(), parentWidget() ? parentWidget()->palette().brush(QPalette::Active, QColorGroup::Background) : QBrush(paletteBackgroundColor()));
|
||||
#warning don't know how to port drawButtonLabel
|
||||
// drawButtonLabel( &p );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class MiniBar : public QFrame, public DocumentObserver
|
|||
|
||||
// [INHERITED] from DocumentObserver
|
||||
uint observerId() const { return MINIBAR_ID; }
|
||||
void notifySetup( const QValueVector< KPDFPage * > & pages, bool );
|
||||
void notifySetup( const QVector< KPDFPage * > & pages, bool );
|
||||
void notifyViewportChanged( bool smoothMove );
|
||||
|
||||
signals:
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#define _KPDF_PAGEVIEW_H_
|
||||
|
||||
#include <qscrollview.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qvaluelist.h>
|
||||
#include <qvector.h>
|
||||
#include <qlinkedlist.h>
|
||||
#include "ui/pageviewutils.h"
|
||||
#include "core/observer.h"
|
||||
|
||||
|
@ -60,7 +60,7 @@ class PageView : public QScrollView, public DocumentObserver
|
|||
|
||||
// inherited from DocumentObserver
|
||||
uint observerId() const { return PAGEVIEW_ID; }
|
||||
void notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged );
|
||||
void notifySetup( const QVector< KPDFPage * > & pages, bool documentChanged );
|
||||
void notifyViewportChanged( bool smoothMove );
|
||||
void notifyPageChanged( int pageNumber, int changedFlags );
|
||||
void notifyContentsCleared( int changedFlags );
|
||||
|
@ -117,7 +117,7 @@ class PageView : public QScrollView, public DocumentObserver
|
|||
void updateZoom( ZoomMode newZm );
|
||||
// update the text on the label using global zoom value or current page's one
|
||||
void updateZoomText();
|
||||
void textSelection( QValueList<QRect> * , const QColor & );
|
||||
void textSelection( QLinkedList<QRect> * , const QColor & );
|
||||
void textSelectionClear();
|
||||
// updates cursor
|
||||
void updateCursor( const QPoint &p );
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
#include <qbitmap.h>
|
||||
#include <qimage.h>
|
||||
#include <qpainter.h>
|
||||
#include <qevent.h>
|
||||
#include <qtimer.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kacceleratormanager.h>
|
||||
#include <kapplication.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kimageeffect.h>
|
||||
#include <kaccelmanager.h>
|
||||
#include <kdeversion.h>
|
||||
#include <klocale.h>
|
||||
|
||||
// system includes
|
||||
|
@ -99,8 +99,8 @@ void PageViewItem::moveTo( int x, int y )
|
|||
PageViewMessage::PageViewMessage( QWidget * parent )
|
||||
: QWidget( parent, "pageViewMessage" ), m_timer( 0 )
|
||||
{
|
||||
setFocusPolicy( NoFocus );
|
||||
setBackgroundMode( NoBackground );
|
||||
setFocusPolicy( Qt::NoFocus );
|
||||
setBackgroundMode( Qt::NoBackground );
|
||||
setPaletteBackgroundColor(kapp->palette().color(QPalette::Active, QColorGroup::Background));
|
||||
move( 10, 10 );
|
||||
resize( 0, 0 );
|
||||
|
@ -245,14 +245,13 @@ ToolBarButton::ToolBarButton( QWidget * parent, const ToolBarItem & item, const
|
|||
setToggleButton( true );
|
||||
resize( buttonSize, buttonSize );
|
||||
setPixmap( DesktopIcon( item.pixmap, iconSize ) );
|
||||
setWFlags( Qt::WNoAutoErase );
|
||||
setWindowFlags( Qt::WNoAutoErase );
|
||||
// set shortcut if defined
|
||||
if ( !item.shortcut.isEmpty() )
|
||||
setAccel( item.shortcut );
|
||||
#if KDE_IS_VERSION(3,3,90)
|
||||
else
|
||||
KAcceleratorManager::setNoAccel( this );
|
||||
#endif
|
||||
|
||||
// if accel is set display it along name
|
||||
QString accelString = (QString)accel();
|
||||
if ( !accelString.isEmpty() )
|
||||
|
@ -286,7 +285,8 @@ void ToolBarButton::paintEvent( QPaintEvent * e )
|
|||
QRect backRect = e->rect();
|
||||
backRect.moveBy( x(), y() );
|
||||
p.drawPixmap( e->rect().topLeft(), m_background, backRect );
|
||||
drawButtonLabel( &p );
|
||||
#warning don't know how to port drawButtonLabel
|
||||
// drawButtonLabel( &p );
|
||||
}
|
||||
|
||||
/* PageViewToolBar */
|
||||
|
@ -308,7 +308,7 @@ struct ToolBarPrivate
|
|||
|
||||
// background pixmap and buttons
|
||||
QPixmap backgroundPixmap;
|
||||
QValueList< ToolBarButton * > buttons;
|
||||
QLinkedList< ToolBarButton * > buttons;
|
||||
};
|
||||
|
||||
PageViewToolBar::PageViewToolBar( QWidget * parent, QWidget * anchorWidget )
|
||||
|
@ -333,7 +333,7 @@ PageViewToolBar::~PageViewToolBar()
|
|||
delete d;
|
||||
}
|
||||
|
||||
void PageViewToolBar::showItems( Side side, const QValueList<ToolBarItem> & items )
|
||||
void PageViewToolBar::showItems( Side side, const QLinkedList<ToolBarItem> & items )
|
||||
{
|
||||
// set parameters for sliding in
|
||||
d->anchorSide = side;
|
||||
|
@ -342,14 +342,14 @@ void PageViewToolBar::showItems( Side side, const QValueList<ToolBarItem> & item
|
|||
// delete buttons if already present
|
||||
if ( !d->buttons.isEmpty() )
|
||||
{
|
||||
QValueList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
QLinkedList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
for ( ; it != end; ++it )
|
||||
delete *it;
|
||||
d->buttons.clear();
|
||||
}
|
||||
|
||||
// create new buttons for given items
|
||||
QValueList<ToolBarItem>::const_iterator it = items.begin(), end = items.end();
|
||||
QLinkedList<ToolBarItem>::const_iterator it = items.begin(), end = items.end();
|
||||
for ( ; it != end; ++it )
|
||||
{
|
||||
ToolBarButton * button = new ToolBarButton( this, *it, d->backgroundPixmap );
|
||||
|
@ -404,7 +404,7 @@ void PageViewToolBar::mousePressEvent( QMouseEvent * e )
|
|||
{
|
||||
// set 'dragging' cursor
|
||||
if ( e->button() == Qt::LeftButton )
|
||||
setCursor( sizeAllCursor );
|
||||
setCursor( Qt::sizeAllCursor );
|
||||
}
|
||||
|
||||
void PageViewToolBar::mouseMoveEvent( QMouseEvent * e )
|
||||
|
@ -435,7 +435,7 @@ void PageViewToolBar::mouseReleaseEvent( QMouseEvent * e )
|
|||
{
|
||||
// set normal cursor
|
||||
if ( e->button() == Qt::LeftButton )
|
||||
setCursor( arrowCursor );
|
||||
setCursor( Qt::arrowCursor );
|
||||
}
|
||||
|
||||
void PageViewToolBar::buildToolBar()
|
||||
|
@ -506,10 +506,10 @@ void PageViewToolBar::buildToolBar()
|
|||
// 5.1. draw horizontal/vertical gradient
|
||||
QColor fromColor = topLeft ? palette().active().button() : palette().active().light();
|
||||
QColor toColor = topLeft ? palette().active().light() : palette().active().button();
|
||||
QPixmap gradientPattern = KImageEffect::gradient(
|
||||
QImage gradientPattern = KImageEffect::gradient(
|
||||
vertical ? QSize( myWidth, 1) : QSize( 1, myHeight ), fromColor, toColor,
|
||||
vertical ? KImageEffect::HorizontalGradient : KImageEffect::VerticalGradient );
|
||||
bufferPainter.drawTiledPixmap( 0, 0, myWidth, myHeight, gradientPattern );
|
||||
bufferPainter.drawTiledPixmap( 0, 0, myWidth, myHeight, QPixmap::fromImage(gradientPattern) );
|
||||
// 5.2. draw rounded border
|
||||
bufferPainter.setPen( palette().active().dark() );
|
||||
if ( vertical )
|
||||
|
@ -540,7 +540,7 @@ void PageViewToolBar::buildToolBar()
|
|||
// 6. reposition buttons (in rows/col grid)
|
||||
int gridX = 0,
|
||||
gridY = 0;
|
||||
QValueList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
QLinkedList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
for ( ; it != end; ++it )
|
||||
{
|
||||
ToolBarButton * button = *it;
|
||||
|
@ -563,7 +563,7 @@ void PageViewToolBar::reposition()
|
|||
move( d->currentPosition );
|
||||
|
||||
// repaint all buttons (to update background)
|
||||
QValueList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
QLinkedList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
for ( ; it != end; ++it )
|
||||
(*it)->update();
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ void PageViewToolBar::slotButtonClicked()
|
|||
if ( button )
|
||||
{
|
||||
// deselect other buttons
|
||||
QValueList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
QLinkedList< ToolBarButton * >::iterator it = d->buttons.begin(), end = d->buttons.end();
|
||||
for ( ; it != end; ++it )
|
||||
if ( *it != button )
|
||||
(*it)->setOn( false );
|
||||
|
|
|
@ -97,7 +97,7 @@ class PageViewToolBar : public QWidget
|
|||
|
||||
// animated widget controls
|
||||
enum Side { Left = 0, Top = 1, Right = 2, Bottom = 3 };
|
||||
void showItems( Side side, const QValueList<ToolBarItem> & items );
|
||||
void showItems( Side side, const QLinkedList<ToolBarItem> & items );
|
||||
void hideAndDestroy();
|
||||
|
||||
// query properties
|
||||
|
|
|
@ -52,7 +52,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
|
|||
// create labels and layout them
|
||||
QLabel *key = new QLabel( i18n( "%1:" ).arg( titleString ), page );
|
||||
QLabel *value = new KSqueezedTextLabel( valueString, page );
|
||||
layout->addWidget( key, row, 0, AlignRight );
|
||||
layout->addWidget( key, row, 0, Qt::AlignRight );
|
||||
layout->addWidget( value, row, 1 );
|
||||
row++;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
***************************************************************************/
|
||||
|
||||
// qt/kde includes
|
||||
#include <qheader.h>
|
||||
#include <klocale.h>
|
||||
|
||||
// local includes
|
||||
|
@ -74,7 +73,7 @@ uint TOC::observerId() const
|
|||
return TOC_ID;
|
||||
}
|
||||
|
||||
void TOC::notifySetup( const QValueVector< KPDFPage * > & /*pages*/, bool documentChanged )
|
||||
void TOC::notifySetup( const QVector< KPDFPage * > & /*pages*/, bool documentChanged )
|
||||
{
|
||||
if ( !documentChanged )
|
||||
return;
|
||||
|
@ -120,7 +119,7 @@ void TOC::addChildren( const QDomNode & parentNode, KListViewItem * parentItem )
|
|||
}
|
||||
}
|
||||
|
||||
void TOC::slotExecuted( QListViewItem *i )
|
||||
void TOC::slotExecuted( Q3ListViewItem *i )
|
||||
{
|
||||
TOCItem* tocItem = dynamic_cast<TOCItem*>( i );
|
||||
// that filters clicks on [+] that for a strange reason don't seem to be TOCItem*
|
||||
|
|
4
ui/toc.h
4
ui/toc.h
|
@ -26,13 +26,13 @@ Q_OBJECT
|
|||
|
||||
// inherited from DocumentObserver
|
||||
uint observerId() const;
|
||||
void notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged );
|
||||
void notifySetup( const QVector< KPDFPage * > & pages, bool documentChanged );
|
||||
|
||||
signals:
|
||||
void hasTOC(bool has);
|
||||
|
||||
private slots:
|
||||
void slotExecuted(QListViewItem *i);
|
||||
void slotExecuted(Q3ListViewItem *i);
|
||||
|
||||
private:
|
||||
void addChildren( const QDomNode & parentNode, KListViewItem * parentItem = 0 );
|
||||
|
|
Loading…
Reference in a new issue