diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-18 06:46:40 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-18 06:46:40 +0000 |
commit | 7c19562ad065b6729bac8eb9b40dfe0452a72272 (patch) | |
tree | 33325d1e02ecc9ca614c7209296f8f796a1c3478 /kipi-plugins/acquireimages/screenshotdialog.cpp | |
parent | a65baa328fac0a1ce12971fef8d998ce7bfbe237 (diff) | |
download | kipi-plugins-7c19562ad065b6729bac8eb9b40dfe0452a72272.tar.gz kipi-plugins-7c19562ad065b6729bac8eb9b40dfe0452a72272.zip |
TQt4 port kipi-plugins
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/kipi-plugins@1232561 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kipi-plugins/acquireimages/screenshotdialog.cpp')
-rw-r--r-- | kipi-plugins/acquireimages/screenshotdialog.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/kipi-plugins/acquireimages/screenshotdialog.cpp b/kipi-plugins/acquireimages/screenshotdialog.cpp index 5374a90..780d17b 100644 --- a/kipi-plugins/acquireimages/screenshotdialog.cpp +++ b/kipi-plugins/acquireimages/screenshotdialog.cpp @@ -30,17 +30,17 @@ extern "C" #include <unistd.h> } -// Include files for Qt - -#include <qlayout.h> -#include <qlabel.h> -#include <qfileinfo.h> -#include <qapplication.h> -#include <qwhatsthis.h> -#include <qcheckbox.h> -#include <qpushbutton.h> -#include <qframe.h> -#include <qwidgetlist.h> +// Include files for TQt + +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqfileinfo.h> +#include <tqapplication.h> +#include <tqwhatsthis.h> +#include <tqcheckbox.h> +#include <tqpushbutton.h> +#include <tqframe.h> +#include <tqwidgetlist.h> // Include files for KDE @@ -67,64 +67,64 @@ extern "C" namespace KIPIAcquireImagesPlugin { -ScreenGrabDialog::ScreenGrabDialog( KIPI::Interface* interface, QWidget *parent, const char *name) - : KDialogBase(parent, name, false, i18n("Screenshot"), +ScreenGrabDialog::ScreenGrabDialog( KIPI::Interface* interface, TQWidget *tqparent, const char *name) + : KDialogBase(tqparent, name, false, i18n("Screenshot"), Help|User1|Close, Close, false, i18n("&New Snapshot")), m_interface( interface ) { m_inSelect = false; - QWidget* box = new QWidget( this ); + TQWidget* box = new TQWidget( this ); setMainWidget(box); - QVBoxLayout *layout = new QVBoxLayout(box); + TQVBoxLayout *tqlayout = new TQVBoxLayout(box); //--------------------------------------------- - QLabel *label1 = new QLabel(i18n("This dialog will grab either your desktop or a single\n" + TQLabel *label1 = new TQLabel(i18n("This dialog will grab either your desktop or a single\n" "application window. If you grab a single window your mouse\n" "cursor will change into crosshairs; then, simply select the\n" "window with your mouse."), box); - layout->addWidget(label1); + tqlayout->addWidget(label1); //--------------------------------------------- - m_desktopCB = new QCheckBox(i18n("Grab the entire desktop"), box); - QWhatsThis::add( m_desktopCB, i18n( "<p>If you enable this option, the entire desktop will be grabbed; " + m_desktopCB = new TQCheckBox(i18n("Grab the entire desktop"), box); + TQWhatsThis::add( m_desktopCB, i18n( "<p>If you enable this option, the entire desktop will be grabbed; " "otherwise, only the active windows." ) ); - layout->addWidget(m_desktopCB); + tqlayout->addWidget(m_desktopCB); //--------------------------------------------- - m_hideCB = new QCheckBox(i18n("Hide all host application windows"), box); - QWhatsThis::add( m_hideCB, i18n( "<p>If you enable this option, all host application windows will be hidden " + m_hideCB = new TQCheckBox(i18n("Hide all host application windows"), box); + TQWhatsThis::add( m_hideCB, i18n( "<p>If you enable this option, all host application windows will be hidden " "during the grab operation." ) ); - layout->addWidget(m_hideCB); + tqlayout->addWidget(m_hideCB); //--------------------------------------------- - QLabel *label2 = new QLabel(i18n("Delay:"), box); - layout->addWidget(label2); + TQLabel *label2 = new TQLabel(i18n("Delay:"), box); + tqlayout->addWidget(label2); m_delay = new KIntNumInput(box); - QWhatsThis::add( m_delay, i18n( "<p>The delay in seconds before the grab operation is started.") ); + TQWhatsThis::add( m_delay, i18n( "<p>The delay in seconds before the grab operation is started.") ); m_delay->setRange(0, 60); - layout->addWidget(m_delay); - layout->addStretch(1); + tqlayout->addWidget(m_delay); + tqlayout->addStretch(1); //--------------------------------------------- - m_grabber = new QWidget( 0, 0, WStyle_Customize | WX11BypassWM ); + m_grabber = new TQWidget( 0, 0, WStyle_Customize | WX11BypassWM ); m_grabber->move( -4000, -4000 ); m_grabber->installEventFilter( this ); //--------------------------------------------- - connect(this, SIGNAL(user1Clicked()), - this, SLOT(slotGrab())); + connect(this, TQT_SIGNAL(user1Clicked()), + this, TQT_SLOT(slotGrab())); - connect(this, SIGNAL(closeClicked()), - this, SLOT(slotClose())); + connect(this, TQT_SIGNAL(closeClicked()), + this, TQT_SLOT(slotClose())); - connect( &m_grabTimer, SIGNAL(timeout()), - this, SLOT(slotPerformGrab())); + connect( &m_grabTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(slotPerformGrab())); //--------------------------------------------- @@ -164,7 +164,7 @@ ScreenGrabDialog::ScreenGrabDialog( KIPI::Interface* interface, QWidget *parent, m_helpButton = actionButton( Help ); KHelpMenu* helpMenu = new KHelpMenu(this, about, false); helpMenu->menu()->removeItemAt(0); - helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, SLOT(slotHelp()), 0, -1, 0); + helpMenu->menu()->insertItem(i18n("Plugin Handbook"), this, TQT_SLOT(slotHelp()), 0, -1, 0); m_helpButton->setPopup( helpMenu->menu() ); } @@ -201,9 +201,9 @@ void ScreenGrabDialog::slotGrab() m_hiddenWindows.clear(); if (m_hideCB->isChecked()) { - QWidgetList *list = QApplication::topLevelWidgets(); - QWidgetListIt it( *list ); - QWidget * w; + TQWidgetList *list = TQApplication::tqtopLevelWidgets(); + TQWidgetListIt it( *list ); + TQWidget * w; while ( (w=it.current()) != 0 ) { ++it; @@ -217,7 +217,7 @@ void ScreenGrabDialog::slotGrab() } kapp->processEvents(); - QApplication::syncX(); + TQApplication::syncX(); if ( m_delay->value() != 0 ) m_grabTimer.start( m_delay->value() * 1000, true ); @@ -238,11 +238,11 @@ void ScreenGrabDialog::slotPerformGrab() { Window root; Window child; - uint mask; + uint tqmask; int rootX, rootY, winX, winY; XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, &rootX, &rootY, &winX, &winY, - &mask); + &tqmask); int x, y; unsigned int w, h; @@ -251,10 +251,10 @@ void ScreenGrabDialog::slotPerformGrab() XGetGeometry( qt_xdisplay(), child, &root, &x, &y, &w, &h, &border, &depth ); - m_snapshot = QPixmap::grabWindow( qt_xrootwin(), x, y, w, h ); + m_snapshot = TQPixmap::grabWindow( qt_xrootwin(), x, y, w, h ); } else - m_snapshot = QPixmap::grabWindow( qt_xrootwin() ); + m_snapshot = TQPixmap::grabWindow( qt_xrootwin() ); if (m_snapshot.isNull()) { @@ -265,7 +265,7 @@ void ScreenGrabDialog::slotPerformGrab() return; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); KNotifyClient::beep(); m_screenshotImage = m_snapshot.convertToImage(); @@ -282,26 +282,26 @@ void ScreenGrabDialog::endGrab(void) if (m_hideCB->isChecked()) { - for( QValueList< QWidget* >::ConstIterator it = m_hiddenWindows.begin(); + for( TQValueList< TQWidget* >::ConstIterator it = m_hiddenWindows.begin(); it != m_hiddenWindows.end(); ++it ) (*it)->show(); - QApplication::syncX(); + TQApplication::syncX(); } show(); } -bool ScreenGrabDialog::eventFilter( QObject* o, QEvent* e) +bool ScreenGrabDialog::eventFilter( TQObject* o, TQEvent* e) { - if ( o == m_grabber && e->type() == QEvent::MouseButtonPress ) + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_grabber) && e->type() == TQEvent::MouseButtonPress ) { - QMouseEvent* me = (QMouseEvent*) e; + TQMouseEvent* me = (TQMouseEvent*) e; - if ( QWidget::mouseGrabber() != m_grabber ) + if ( TQWidget::mouseGrabber() != m_grabber ) return false; - if ( me->button() == LeftButton ) + if ( me->button() == Qt::LeftButton ) slotPerformGrab(); } |