diff options
Diffstat (limited to 'filters/libdialogfilter')
-rw-r--r-- | filters/libdialogfilter/exportsizedia.cpp | 100 | ||||
-rw-r--r-- | filters/libdialogfilter/exportsizedia.h | 9 |
2 files changed, 55 insertions, 54 deletions
diff --git a/filters/libdialogfilter/exportsizedia.cpp b/filters/libdialogfilter/exportsizedia.cpp index adcd36c6..adce4a56 100644 --- a/filters/libdialogfilter/exportsizedia.cpp +++ b/filters/libdialogfilter/exportsizedia.cpp @@ -17,15 +17,15 @@ * Boston, MA 02110-1301, USA. */ -#include <qcheckbox.h> -#include <qimage.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qpaintdevice.h> -#include <qrect.h> -#include <qvbuttongroup.h> -#include <qwidget.h> +#include <tqcheckbox.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqpaintdevice.h> +#include <tqrect.h> +#include <tqvbuttongroup.h> +#include <tqwidget.h> #include <kapplication.h> #include <kdebug.h> @@ -37,8 +37,8 @@ ExportSizeDia::ExportSizeDia( int width, int height, - QWidget *parent, const char *name ) - : KDialogBase( parent, name, true, + TQWidget *tqparent, const char *name ) + : KDialogBase( tqparent, name, true, i18n("Export Filter Parameters" ), Ok|Cancel ) { kapp->restoreOverrideCursor(); @@ -53,8 +53,8 @@ ExportSizeDia::ExportSizeDia( int width, int height, m_percHeightEdit->setValue( 100 ); connectAll(); - connect( m_proportional, SIGNAL( clicked() ), - this, SLOT( proportionalClicked() ) ); + connect( m_proportional, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( proportionalClicked() ) ); } @@ -66,27 +66,27 @@ ExportSizeDia::~ExportSizeDia() void ExportSizeDia::setupGUI() { //resize( size() ); - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); #if 0 - QBoxLayout* mainLayout = new QVBoxLayout( page, + TQBoxLayout* mainLayout = new TQVBoxLayout( page, KDialog::marginHint(), KDialog::spacingHint() ); #else - QGridLayout *mainLayout = new QGridLayout( page, 5, 2, + TQGridLayout *mainLayout = new TQGridLayout( page, 5, 2, KDialog::marginHint(), KDialog::spacingHint() ); #endif - m_proportional = new QCheckBox( page, "proportional" ); + m_proportional = new TQCheckBox( page, "proportional" ); m_proportional->setText( i18n( "Keep ratio" ) ); m_proportional->setChecked( true ); mainLayout->addWidget( m_proportional, 0, 0 ); - QLabel* width = new QLabel( page, "width" ); + TQLabel* width = new TQLabel( page, "width" ); width->setText( i18n( "Width:" ) ); m_widthEdit = new KIntNumInput( page, "widthEdit" ); - QLabel* height = new QLabel( page, "height" ); + TQLabel* height = new TQLabel( page, "height" ); height->setText( i18n( "Height:" ) ); m_heightEdit = new KIntNumInput( page, "heightEdit" ); @@ -95,10 +95,10 @@ void ExportSizeDia::setupGUI() mainLayout->addWidget( height, 2, 0 ); mainLayout->addWidget( m_heightEdit, 2, 1 ); - QLabel* percentWidth = new QLabel( page, "PercentWidth" ); + TQLabel* percentWidth = new TQLabel( page, "PercentWidth" ); percentWidth->setText( i18n( "Width (%):" ) ); m_percWidthEdit = new KDoubleNumInput( page, "percWidthEdit" ); - QLabel* percentHeight = new QLabel( page, "PercentHeight" ); + TQLabel* percentHeight = new TQLabel( page, "PercentHeight" ); percentHeight->setText( i18n( "Height (%):" ) ); m_percHeightEdit = new KDoubleNumInput( page, "percHeightEdit" ); @@ -107,7 +107,7 @@ void ExportSizeDia::setupGUI() mainLayout->addWidget( percentHeight, 4, 0 ); mainLayout->addWidget( m_percWidthEdit, 4, 1 ); - /* Display the main layout */ + /* Display the main tqlayout */ //mainLayout->addStretch( 5 ); mainLayout->activate(); } @@ -135,8 +135,8 @@ int ExportSizeDia::height() const void ExportSizeDia::widthChanged( int width ) { disconnectAll(); - width = QMIN( width, m_realWidth * 10 ); - width = QMAX( width, m_realWidth / 10 ); + width = TQMIN( width, m_realWidth * 10 ); + width = TQMAX( width, m_realWidth / 10 ); double percent = (100.0 * static_cast<double>( width ) / static_cast<double>( m_realWidth )); m_percWidthEdit->setValue( percent ); @@ -152,8 +152,8 @@ void ExportSizeDia::widthChanged( int width ) void ExportSizeDia::heightChanged( int height ) { disconnectAll(); - height = QMIN( height, m_realHeight * 10 ); - height = QMAX( height, m_realHeight / 10 ); + height = TQMIN( height, m_realHeight * 10 ); + height = TQMAX( height, m_realHeight / 10 ); double percent = (100.0 * static_cast<double>( height ) / static_cast<double>( m_realHeight )); m_percHeightEdit->setValue( percent ); @@ -169,8 +169,8 @@ void ExportSizeDia::heightChanged( int height ) void ExportSizeDia::percentWidthChanged( double percent ) { disconnectAll(); - percent = QMIN( percent, 1000 ); - percent = QMAX( percent, 10 ); + percent = TQMIN( percent, 1000 ); + percent = TQMAX( percent, 10 ); int width = static_cast<int>( m_realWidth * percent / 100. ); m_widthEdit->setValue( width ); if ( m_proportional->isChecked() ) { @@ -185,8 +185,8 @@ void ExportSizeDia::percentWidthChanged( double percent ) void ExportSizeDia::percentHeightChanged( double percent ) { disconnectAll(); - percent = QMIN( percent, 1000 ); - percent = QMAX( percent, 10 ); + percent = TQMIN( percent, 1000 ); + percent = TQMAX( percent, 10 ); if ( m_proportional->isChecked() ) { int width = static_cast<int>( m_realWidth * percent / 100. ); m_widthEdit->setValue( width ); @@ -203,8 +203,8 @@ void ExportSizeDia::proportionalClicked() if ( m_proportional->isChecked() ) { disconnectAll(); int width = m_widthEdit->value( ); - width = QMIN( width, m_realWidth * 10 ); - width = QMAX( width, m_realWidth / 10 ); + width = TQMIN( width, m_realWidth * 10 ); + width = TQMAX( width, m_realWidth / 10 ); double percent = (100.0 * static_cast<double>( width ) / static_cast<double>( m_realWidth )); m_percHeightEdit->setValue( percent ); @@ -221,27 +221,27 @@ void ExportSizeDia::proportionalClicked() void ExportSizeDia::connectAll() { - connect( m_widthEdit, SIGNAL( valueChanged(int) ), - this, SLOT( widthChanged( int ) ) ); - connect( m_heightEdit, SIGNAL( valueChanged(int) ), - this, SLOT( heightChanged( int ) ) ); - connect( m_percWidthEdit, SIGNAL( valueChanged(double) ), - this, SLOT( percentWidthChanged( double ) ) ); - connect( m_percHeightEdit, SIGNAL( valueChanged(double) ), - this, SLOT( percentHeightChanged(double ) ) ); + connect( m_widthEdit, TQT_SIGNAL( valueChanged(int) ), + this, TQT_SLOT( widthChanged( int ) ) ); + connect( m_heightEdit, TQT_SIGNAL( valueChanged(int) ), + this, TQT_SLOT( heightChanged( int ) ) ); + connect( m_percWidthEdit, TQT_SIGNAL( valueChanged(double) ), + this, TQT_SLOT( percentWidthChanged( double ) ) ); + connect( m_percHeightEdit, TQT_SIGNAL( valueChanged(double) ), + this, TQT_SLOT( percentHeightChanged(double ) ) ); } void ExportSizeDia::disconnectAll() { - disconnect( m_widthEdit, SIGNAL( valueChanged(int) ), - this, SLOT( widthChanged( int ) ) ); - disconnect( m_heightEdit, SIGNAL( valueChanged(int) ), - this, SLOT( heightChanged( int ) ) ); - disconnect( m_percWidthEdit, SIGNAL( valueChanged(double) ), - this, SLOT( percentWidthChanged( double ) ) ); - disconnect( m_percHeightEdit, SIGNAL( valueChanged(double) ), - this, SLOT( percentHeightChanged(double ) ) ); + disconnect( m_widthEdit, TQT_SIGNAL( valueChanged(int) ), + this, TQT_SLOT( widthChanged( int ) ) ); + disconnect( m_heightEdit, TQT_SIGNAL( valueChanged(int) ), + this, TQT_SLOT( heightChanged( int ) ) ); + disconnect( m_percWidthEdit, TQT_SIGNAL( valueChanged(double) ), + this, TQT_SLOT( percentWidthChanged( double ) ) ); + disconnect( m_percHeightEdit, TQT_SIGNAL( valueChanged(double) ), + this, TQT_SLOT( percentHeightChanged(double ) ) ); } @@ -250,7 +250,7 @@ void ExportSizeDia::slotOk() { hide(); //doc->setZoomAndResolution( 100, 600, 600 ); - //doc->setZoomAndResolution( 1000, QPaintDevice::x11AppDpiX(), QPaintDevice::x11AppDpiY() ); + //doc->setZoomAndResolution( 1000, TQPaintDevice::x11AppDpiX(), TQPaintDevice::x11AppDpiY() ); //doc->newZoomAndResolution( false, false ); int width = widthEdit->value(); int height = heightEdit->value(); @@ -259,7 +259,7 @@ void ExportSizeDia::slotOk() // << endl; // width = realWidth; // height = realHeight; - QImage image = formula->drawImage( width, height ); + TQImage image = formula->drawImage( width, height ); if ( !image.save( _fileOut, "PNG" ) ) { KMessageBox::error( 0, i18n( "Failed to write file." ), i18n( "PNG Export Error" ) ); } diff --git a/filters/libdialogfilter/exportsizedia.h b/filters/libdialogfilter/exportsizedia.h index f3cc8ad4..2eba6ccb 100644 --- a/filters/libdialogfilter/exportsizedia.h +++ b/filters/libdialogfilter/exportsizedia.h @@ -21,8 +21,8 @@ #define EXPORTSIZEDIA_H -class QCheckBox; -class QString; +class TQCheckBox; +class TQString; class KIntNumInput; class KDoubleNumInput; @@ -33,10 +33,11 @@ class KDoubleNumInput; class ExportSizeDia : public KDialogBase { Q_OBJECT + TQ_OBJECT public: ExportSizeDia( int width, int height, - QWidget *parent=0L, const char *name=0L ); + TQWidget *tqparent=0L, const char *name=0L ); ~ExportSizeDia(); int width() const; @@ -65,7 +66,7 @@ private: int m_realWidth; int m_realHeight; - QCheckBox *m_proportional; + TQCheckBox *m_proportional; KIntNumInput *m_widthEdit; KIntNumInput *m_heightEdit; KDoubleNumInput *m_percWidthEdit; |