summaryrefslogtreecommitdiffstats
path: root/src/view.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/view.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz
ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/view.cpp')
-rw-r--r--src/view.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/view.cpp b/src/view.cpp
index 07e81ec..8785321 100644
--- a/src/view.cpp
+++ b/src/view.cpp
@@ -19,7 +19,7 @@
#include <kiconloader.h>
#include <klocale.h>
#include <ksqueezedtextlabel.h>
-#include <qpainter.h>
+#include <tqpainter.h>
//BEGIN KVSSBSep
// Taken from kdebase-3.4.0/kate/app/kateviewspace.cpp, Copyright Anders Lund <[email protected]>
@@ -27,31 +27,31 @@
"KateViewSpaceStatusBarSeparator"
A 2 px line to separate the statusbar from the view.
It is here to compensate for the lack of a frame in the view,
- I think Kate looks very nice this way, as QScrollView with frame
+ I think Kate looks very nice this way, as TQScrollView with frame
looks slightly clumsy...
- Slight 3D effect. I looked for suitable QStyle props or methods,
- but found none, though maybe it should use QStyle::PM_DefaultFrameWidth
+ Slight 3D effect. I looked for suitable TQStyle props or methods,
+ but found none, though maybe it should use TQStyle::PM_DefaultFrameWidth
for height (TRY!).
It does look a bit funny with flat styles (Light, .Net) as is,
but there are on methods to paint panel lines separately. And,
those styles tends to look funny on their own, as a light line
in a 3D frame next to a light contents widget is not functional.
- Also, QStatusBar is up to now completely ignorant to style.
+ Also, TQStatusBar is up to now completely ignorant to style.
-anders
*/
-class KVSSBSep : public QWidget {
+class KVSSBSep : public TQWidget {
public:
- KVSSBSep( View * parent=0) : QWidget(parent)
+ KVSSBSep( View * tqparent=0) : TQWidget(tqparent)
{
setFixedHeight( 2 );
}
protected:
- void paintEvent( QPaintEvent *e )
+ void paintEvent( TQPaintEvent *e )
{
- QPainter p( this );
- p.setPen( colorGroup().shadow() );
+ TQPainter p( this );
+ p.setPen( tqcolorGroup().shadow() );
p.drawLine( e->rect().left(), 0, e->rect().right(), 0 );
- p.setPen( ((View*)parentWidget())->isFocused() ? colorGroup().light() : colorGroup().midlight() );
+ p.setPen( ((View*)tqparentWidget())->isFocused() ? tqcolorGroup().light() : tqcolorGroup().midlight() );
p.drawLine( e->rect().left(), 1, e->rect().right(), 1 );
}
};
@@ -61,7 +61,7 @@ class KVSSBSep : public QWidget {
//BEGIN class View
View::View( Document *document, ViewContainer *viewContainer, uint viewAreaId, const char *name )
- : QWidget( viewContainer->viewArea(viewAreaId), name ? name : (const char *)("view_" + QString::number(viewAreaId)) ),
+ : TQWidget( viewContainer->viewArea(viewAreaId), name ? name : (const char *)("view_" + TQString::number(viewAreaId)) ),
KXMLGUIClient()
{
m_dcopID = 0;
@@ -79,7 +79,7 @@ View::View( Document *document, ViewContainer *viewContainer, uint viewAreaId, c
b_isFocused = false;
- m_layout = new QVBoxLayout(this);
+ m_layout = new TQVBoxLayout(this);
// Don't bother creating statusbar if no ktechlab as we are not a main ktechlab tab
if (p_ktechlab)
@@ -89,7 +89,7 @@ View::View( Document *document, ViewContainer *viewContainer, uint viewAreaId, c
m_layout->addWidget( new KVSSBSep(this) );
m_layout->addWidget( m_statusBar );
- connect( p_ktechlab, SIGNAL(configurationChanged()), this, SLOT(slotUpdateConfiguration()) );
+ connect( p_ktechlab, TQT_SIGNAL(configurationChanged()), this, TQT_SLOT(slotUpdateConfiguration()) );
}
}
@@ -101,7 +101,7 @@ View::~View()
}
-KAction * View::action( const QString & name ) const
+KAction * View::action( const TQString & name ) const
{
KAction * action = actionCollection()->action(name);
if ( !action )
@@ -159,10 +159,10 @@ void View::setDCOPID( unsigned id )
m_dcopID = id;
if ( m_pViewIface )
{
- QCString docID;
+ TQCString docID;
docID.setNum( document()->dcopID() );
- QCString viewID;
+ TQCString viewID;
viewID.setNum( dcopID() );
m_pViewIface->setObjId( "View#" + docID + "." + viewID );
@@ -178,7 +178,7 @@ ViewStatusBar::ViewStatusBar( View *view )
{
p_view = view;
- m_modifiedLabel = new QLabel(this);
+ m_modifiedLabel = new TQLabel(this);
addWidget( m_modifiedLabel, 0, false );
m_fileNameLabel = new KSqueezedTextLabel(this);
addWidget( m_fileNameLabel, 1, false );
@@ -186,11 +186,11 @@ ViewStatusBar::ViewStatusBar( View *view )
m_modifiedPixmap = KGlobal::iconLoader()->loadIcon( "filesave", KIcon::Small );
m_unmodifiedPixmap = KGlobal::iconLoader()->loadIcon( "null", KIcon::Small );
- connect( view->document(), SIGNAL(modifiedStateChanged()), this, SLOT(slotModifiedStateChanged()) );
- connect( view->document(), SIGNAL(fileNameChanged(const KURL& )), this, SLOT(slotFileNameChanged(const KURL& )) );
+ connect( view->document(), TQT_SIGNAL(modifiedStateChanged()), this, TQT_SLOT(slotModifiedStateChanged()) );
+ connect( view->document(), TQT_SIGNAL(fileNameChanged(const KURL& )), this, TQT_SLOT(slotFileNameChanged(const KURL& )) );
- connect( view, SIGNAL(viewFocused(View* )), this, SLOT(slotViewFocused(View* )) );
- connect( view, SIGNAL(viewUnfocused()), this, SLOT(slotViewUnfocused()) );
+ connect( view, TQT_SIGNAL(viewFocused(View* )), this, TQT_SLOT(slotViewFocused(View* )) );
+ connect( view, TQT_SIGNAL(viewUnfocused()), this, TQT_SLOT(slotViewUnfocused()) );
slotModifiedStateChanged();
slotFileNameChanged( view->document()->url() );
@@ -217,9 +217,9 @@ void ViewStatusBar::slotViewFocused( View * )
void ViewStatusBar::slotViewUnfocused()
{
- QPalette pal( p_view->palette() );
- pal.setColor( QColorGroup::Background, pal.active().mid() );
- pal.setColor( QColorGroup::Light, pal.active().midlight() );
+ TQPalette pal( p_view->palette() );
+ pal.setColor( TQColorGroup::Background, pal.active().mid() );
+ pal.setColor( TQColorGroup::Light, pal.active().midlight() );
setPalette(pal);
}
//END class ViewStatusBar