diff options
Diffstat (limited to 'kexi/plugins/importexport/csv/kexicsvwidgets.cpp')
-rw-r--r-- | kexi/plugins/importexport/csv/kexicsvwidgets.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/kexi/plugins/importexport/csv/kexicsvwidgets.cpp b/kexi/plugins/importexport/csv/kexicsvwidgets.cpp index 8e3cf4c2..f490795b 100644 --- a/kexi/plugins/importexport/csv/kexicsvwidgets.cpp +++ b/kexi/plugins/importexport/csv/kexicsvwidgets.cpp @@ -19,9 +19,9 @@ #include "kexicsvwidgets.h" -#include <qdir.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqdir.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <klocale.h> #include <klineedit.h> @@ -32,15 +32,15 @@ #define KEXICSV_OTHER_DELIMITER_INDEX 4 -KexiCSVDelimiterWidget::KexiCSVDelimiterWidget( bool lineEditOnBottom, QWidget * parent ) - : QWidget(parent, "KexiCSVDelimiterWidget") +KexiCSVDelimiterWidget::KexiCSVDelimiterWidget( bool lineEditOnBottom, TQWidget * tqparent ) + : TQWidget(tqparent, "KexiCSVDelimiterWidget") , m_availableDelimiters(KEXICSV_OTHER_DELIMITER_INDEX) { - QBoxLayout *lyr = + TQBoxLayout *lyr = lineEditOnBottom ? - (QBoxLayout *)new QVBoxLayout( this, 0, KDialogBase::spacingHint() ) - : (QBoxLayout *)new QHBoxLayout( this, 0, KDialogBase::spacingHint() ); + (TQBoxLayout *)new TQVBoxLayout( this, 0, KDialogBase::spacingHint() ) + : (TQBoxLayout *)new TQHBoxLayout( this, 0, KDialogBase::spacingHint() ); m_availableDelimiters[0]=KEXICSV_DEFAULT_FILE_DELIMITER; m_availableDelimiters[1]=";"; @@ -57,20 +57,20 @@ KexiCSVDelimiterWidget::KexiCSVDelimiterWidget( bool lineEditOnBottom, QWidget * setFocusProxy(m_combo); m_delimiterEdit = new KLineEdit( this, "m_delimiterEdit" ); -// m_delimiterEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, m_delimiterEdit->sizePolicy().hasHeightForWidth() ) ); - m_delimiterEdit->setMaximumSize( QSize( 30, 32767 ) ); +// m_delimiterEdit->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, m_delimiterEdit->sizePolicy().hasHeightForWidth() ) ); + m_delimiterEdit->setMaximumSize( TQSize( 30, 32767 ) ); m_delimiterEdit->setMaxLength(1); lyr->addWidget( m_delimiterEdit ); if (!lineEditOnBottom) lyr->addStretch(2); slotDelimiterChangedInternal(KEXICSV_DEFAULT_FILE_DELIMITER_INDEX); //this will init m_delimiter - connect(m_combo, SIGNAL(activated(int)), - this, SLOT(slotDelimiterChanged(int))); - connect(m_delimiterEdit, SIGNAL(returnPressed()), - this, SLOT(slotDelimiterLineEditReturnPressed())); - connect(m_delimiterEdit, SIGNAL(textChanged( const QString & )), - this, SLOT(slotDelimiterLineEditTextChanged( const QString & ) )); + connect(m_combo, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotDelimiterChanged(int))); + connect(m_delimiterEdit, TQT_SIGNAL(returnPressed()), + this, TQT_SLOT(slotDelimiterLineEditReturnPressed())); + connect(m_delimiterEdit, TQT_SIGNAL(textChanged( const TQString & )), + this, TQT_SLOT(slotDelimiterLineEditTextChanged( const TQString & ) )); } void KexiCSVDelimiterWidget::slotDelimiterChanged(int index) @@ -105,14 +105,14 @@ void KexiCSVDelimiterWidget::slotDelimiterLineEditReturnPressed() slotDelimiterChangedInternal(KEXICSV_OTHER_DELIMITER_INDEX); } -void KexiCSVDelimiterWidget::slotDelimiterLineEditTextChanged( const QString & ) +void KexiCSVDelimiterWidget::slotDelimiterLineEditTextChanged( const TQString & ) { slotDelimiterChangedInternal(KEXICSV_OTHER_DELIMITER_INDEX); } -void KexiCSVDelimiterWidget::setDelimiter(const QString& delimiter) +void KexiCSVDelimiterWidget::setDelimiter(const TQString& delimiter) { - QValueVector<QString>::ConstIterator it = m_availableDelimiters.constBegin(); + TQValueVector<TQString>::ConstIterator it = m_availableDelimiters.constBegin(); int index = 0; for (; it != m_availableDelimiters.constEnd(); ++it, index++) { if (*it == delimiter) { @@ -129,22 +129,22 @@ void KexiCSVDelimiterWidget::setDelimiter(const QString& delimiter) //---------------------------------------------------- -KexiCSVTextQuoteComboBox::KexiCSVTextQuoteComboBox( QWidget * parent ) - : KComboBox(parent, "KexiCSVTextQuoteComboBox") +KexiCSVTextQuoteComboBox::KexiCSVTextQuoteComboBox( TQWidget * tqparent ) + : KComboBox(tqparent, "KexiCSVTextQuoteComboBox") { insertItem( "\"" ); insertItem( "'" ); insertItem( i18n( "None" ) ); } -QString KexiCSVTextQuoteComboBox::textQuote() const +TQString KexiCSVTextQuoteComboBox::textQuote() const { if (currentItem()==2) - return QString::null; + return TQString(); return currentText(); } -void KexiCSVTextQuoteComboBox::setTextQuote(const QString& textQuote) +void KexiCSVTextQuoteComboBox::setTextQuote(const TQString& textQuote) { if (textQuote=="\"" || textQuote=="'") setCurrentText(textQuote); @@ -154,78 +154,78 @@ void KexiCSVTextQuoteComboBox::setTextQuote(const QString& textQuote) //---------------------------------------------------- -KexiCSVInfoLabel::KexiCSVInfoLabel( const QString& labelText, QWidget* parent ) - : QWidget(parent, "KexiCSVInfoLabel") +KexiCSVInfoLabel::KexiCSVInfoLabel( const TQString& labelText, TQWidget* tqparent ) + : TQWidget(tqparent, "KexiCSVInfoLabel") { - QVBoxLayout *vbox = new QVBoxLayout( this, 0, KDialogBase::spacingHint() ); - QHBoxLayout *hbox = new QHBoxLayout( this ); + TQVBoxLayout *vbox = new TQVBoxLayout( this, 0, KDialogBase::spacingHint() ); + TQHBoxLayout *hbox = new TQHBoxLayout( this ); vbox->addLayout(hbox); - m_leftLabel = new QLabel(labelText, this); + m_leftLabel = new TQLabel(labelText, this); m_leftLabel->setMinimumWidth(130); - m_leftLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); - m_leftLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft | Qt::WordBreak); + m_leftLabel->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); + m_leftLabel->tqsetAlignment(TQt::AlignVCenter | TQt::AlignLeft | TQt::WordBreak); hbox->addWidget(m_leftLabel); - m_iconLbl = new QLabel(this); - m_iconLbl->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); - m_iconLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); + m_iconLbl = new TQLabel(this); + m_iconLbl->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); + m_iconLbl->tqsetAlignment(TQt::AlignVCenter | TQt::AlignLeft); m_fnameLbl = new KActiveLabel(this); - m_fnameLbl->setFocusPolicy(NoFocus); - m_fnameLbl->setTextFormat(Qt::PlainText); - m_fnameLbl->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding,1,0)); + m_fnameLbl->setFocusPolicy(TQ_NoFocus); + m_fnameLbl->setTextFormat(TQt::PlainText); + m_fnameLbl->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding,1,0)); m_fnameLbl->setLineWidth(1); - m_fnameLbl->setFrameStyle(QFrame::Box); - m_fnameLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft | Qt::WordBreak); + m_fnameLbl->setFrameStyle(TQFrame::Box); + m_fnameLbl->tqsetAlignment(TQt::AlignVCenter | TQt::AlignLeft | TQt::WordBreak); hbox->addSpacing(5); hbox->addWidget(m_iconLbl); - hbox->addWidget(m_fnameLbl, 1, Qt::AlignVCenter | Qt::AlignLeft | Qt::WordBreak); + hbox->addWidget(m_fnameLbl, 1, TQt::AlignVCenter | TQt::AlignLeft | TQt::WordBreak); hbox->addSpacing(10); m_commentLbl = new KActiveLabel(this); - m_commentLbl->setFocusPolicy(NoFocus); - m_commentLbl->setTextFormat(Qt::PlainText); - m_commentLbl->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_commentLbl->setFocusPolicy(TQ_NoFocus); + m_commentLbl->setTextFormat(TQt::PlainText); + m_commentLbl->tqsetSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding); m_commentLbl->setLineWidth(1); - m_commentLbl->setFrameStyle(QFrame::Box); - m_commentLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft | Qt::WordBreak); - hbox->addWidget(m_commentLbl, 0, Qt::AlignVCenter | Qt::AlignRight | Qt::WordBreak); + m_commentLbl->setFrameStyle(TQFrame::Box); + m_commentLbl->tqsetAlignment(TQt::AlignVCenter | TQt::AlignLeft | TQt::WordBreak); + hbox->addWidget(m_commentLbl, 0, TQt::AlignVCenter | TQt::AlignRight | TQt::WordBreak); - m_separator = new QFrame(this); - m_separator->setFrameShape(QFrame::HLine); - m_separator->setFrameShadow(QFrame::Sunken); + m_separator = new TQFrame(this); + m_separator->setFrameShape(TQFrame::HLine); + m_separator->setFrameShadow(TQFrame::Sunken); vbox->addWidget(m_separator); } -void KexiCSVInfoLabel::setFileName( const QString& fileName ) +void KexiCSVInfoLabel::setFileName( const TQString& fileName ) { - m_fnameLbl->setText( QDir::convertSeparators(fileName) ); + m_fnameLbl->setText( TQDir::convertSeparators(fileName) ); if (!fileName.isEmpty()) { m_iconLbl->setPixmap( KMimeType::pixmapForURL(KURL::fromPathOrURL(fileName), 0, KIcon::Desktop) ); } } -void KexiCSVInfoLabel::setLabelText( const QString& text ) +void KexiCSVInfoLabel::setLabelText( const TQString& text ) { m_fnameLbl->setText( text ); // int lines = m_fnameLbl->lines(); // m_fnameLbl->setFixedHeight( -// QFontMetrics(m_fnameLbl->currentFont()).height() * lines ); +// TQFontMetrics(m_fnameLbl->currentFont()).height() * lines ); } -void KexiCSVInfoLabel::setIcon(const QString& iconName) +void KexiCSVInfoLabel::setIcon(const TQString& iconName) { m_iconLbl->setPixmap( DesktopIcon(iconName) ); } -void KexiCSVInfoLabel::setCommentText( const QString& text ) +void KexiCSVInfoLabel::setCommentText( const TQString& text ) { m_commentLbl->setText(text); } //---------------------------------------------------- -QStringList csvMimeTypes() +TQStringList csvMimeTypes() { - QStringList mimetypes; + TQStringList mimetypes; mimetypes << "text/x-csv" << "text/plain" << "all/allfiles"; return mimetypes; } |