Initial TQt conversion

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
r14.0.x
Slávek Banko 9 years ago
parent 4870c0c8c5
commit 91d2d7482c

@ -19,7 +19,7 @@
***************************************************************************/
#include "buttonwithindexsignal.h"
ButtonWithIndexSignal::ButtonWithIndexSignal(const QString & text, int index, QWidget *parent, const char *name) : QPushButton(text, parent, name) {
ButtonWithIndexSignal::ButtonWithIndexSignal(const TQString & text, int index, TQWidget *parent, const char *name) : TQPushButton(text, parent, name) {
i = index;
connect(this, SIGNAL(clicked()), this, SLOT(emitClickedWithIndex()));
}

@ -20,13 +20,13 @@
#ifndef BUTTONWITHINDEXSIGNAL_H
#define BUTTONWITHINDEXSIGNAL_H
#include <qpushbutton.h>
#include <tqpushbutton.h>
class ButtonWithIndexSignal : public QPushButton {
class ButtonWithIndexSignal : public TQPushButton {
Q_OBJECT
public:
ButtonWithIndexSignal(const QString & text, int index, QWidget *parent = 0, const char *name = 0);
ButtonWithIndexSignal(const TQString & text, int index, TQWidget *parent = 0, const char *name = 0);
virtual ~ButtonWithIndexSignal();
int i;
public slots:

File diff suppressed because it is too large Load Diff

@ -21,12 +21,12 @@
#ifndef KQALCULATE_H
#define KQALCULATE_H
#include <qvariant.h>
#include <tqvariant.h>
#include <kmainwindow.h>
#include <qvaluevector.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qstylesheet.h>
#include <tqvaluevector.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include <tqstylesheet.h>
#include <ktextbrowser.h>
#include <klistview.h>
#include <kdialogbase.h>
@ -52,15 +52,15 @@ class QalculateConvertUnitsDialog;
class KAction;
class KRadioAction;
class KToggleAction;
class QToolBar;
class QPopupMenu;
class TQToolBar;
class TQPopupMenu;
class KPushButton;
class QalculateExpressionEdit;
class QalculateResultDisplay;
class QFrame;
class QWidgetStack;
class QWidget;
class QComboBox;
class TQFrame;
class TQWidgetStack;
class TQWidget;
class TQComboBox;
class QalculateHistoryBrowser;
class QalculateConvertNumberBasesDialog;
class QalculatePeriodicTableDialog;
@ -74,14 +74,14 @@ class QalculatePreferencesDialog;
class QalculateInsertMatrixVectorDialog;
class KSystemTray;
class QalculateParseLabel;
class QButtonGroup;
class QRadioButton;
class TQButtonGroup;
class TQRadioButton;
class QalculateButton;
class QVBoxLayout;
class TQVBoxLayout;
class KSeparator;
class KUniqueApplication;
class KConfig;
class QListViewItem;
class TQListViewItem;
class QalculateRPNStackListView;
class KGlobalAccel;
class KKeyButton;
@ -95,7 +95,7 @@ enum {
};
class ModeObject : public QObject {
class ModeObject : public TQObject {
Q_OBJECT
@ -123,7 +123,7 @@ public:
void setAssumptionsMenu();
void setModeActions();
void execute_expression(bool force = true);
void setResult(Prefix *prefix = NULL, bool update_history = true, bool update_parse = false, bool force = false, QString transformation = "", size_t stack_index = 0, bool register_moved = false);
void setResult(Prefix *prefix = NULL, bool update_history = true, bool update_parse = false, bool force = false, TQString transformation = "", size_t stack_index = 0, bool register_moved = false);
void executeCommand(int command_type);
void result_display_updated();
void result_format_updated();
@ -131,7 +131,7 @@ public:
void result_prefix_changed(Prefix *prefix = NULL);
void expression_calculation_updated();
void expression_format_updated(bool recalculate = false);
void display_errors(QString *new_text = NULL, int *inhistory_index = NULL);
void display_errors(TQString *new_text = NULL, int *inhistory_index = NULL);
void update_status_text();
void display_function_hint(MathFunction *f, int arg_index = 1);
void clearresult();
@ -148,7 +148,7 @@ public:
void unit_inserted(Unit *object);
void updateStatusLabelFonts();
void set_unicode_buttons();
void insertButtonFunction(QString text, bool append_space = true);
void insertButtonFunction(TQString text, bool append_space = true);
void insertButtonFunction(MathFunction *f);
const MathStructure *getResultPart(int);
void insertMatrixVector(const MathStructure *m = NULL, bool do_vector = false, bool is_text_struct = false, bool is_result = false);
@ -156,9 +156,9 @@ public:
void calculateRPN(int op);
void calculateRPN(MathFunction *f);
void RPNStackEnter(Variable *v);
void RPNRegisterAdded(const QString &text, size_t index = 0);
void RPNRegisterAdded(const TQString &text, size_t index = 0);
void RPNRegisterRemoved(size_t index);
void RPNRegisterChanged(const QString &text, size_t index = 0);
void RPNRegisterChanged(const TQString &text, size_t index = 0);
QalculateInsertMatrixVectorDialog *insert_matrix_dialog;
QalculatePrecisionDialog *precisionDialog;
@ -181,42 +181,42 @@ public:
QalculatePlotDialog *plot_dialog;
QalculateSetBaseDialog *set_base_dialog;
QalculatePreferencesDialog *preferences_dialog;
QMap <int, Variable*> menu_variables_ids;
QMap <int, MathFunction*> menu_functions_ids;
QMap <int, Unit*> menu_units_ids, menu_to_unit_ids;
QMap <int, Prefix*> menu_units_prefixes_ids, menu_set_prefix_ids;
QValueVector<int> recent_function_ids;
QValueVector<int> recent_variable_ids;
QValueVector<int> recent_unit_ids;
TQMap <int, Variable*> menu_variables_ids;
TQMap <int, MathFunction*> menu_functions_ids;
TQMap <int, Unit*> menu_units_ids, menu_to_unit_ids;
TQMap <int, Prefix*> menu_units_prefixes_ids, menu_set_prefix_ids;
TQValueVector<int> recent_function_ids;
TQValueVector<int> recent_variable_ids;
TQValueVector<int> recent_unit_ids;
QalculateRPNStackListView *stackList;
QVBoxLayout *stackPageButtonsLayout;
TQVBoxLayout *stackPageButtonsLayout;
QalculateButton *registerUpButton, *registerDownButton, *deleteRegisterButton, *editRegisterButton, *clearStackButton;
QPopupMenu *stackMenu;
TQPopupMenu *stackMenu;
KUniqueApplication *m_parent;
KSystemTray *trayicon;
QalculateButton *executeButton, *storeButton, *convertButton;
QalculateButton *functionsButton;
QVBoxLayout *leftButtonsLayout;
TQVBoxLayout *leftButtonsLayout;
KSeparator *leftButtonsSeparator;
QalculateExpressionEdit* expressionEdit;
QLabel *statusLabel_r;
TQLabel *statusLabel_r;
QalculateParseLabel *statusLabel_l;
QalculateResultDisplay* resultLabel;
QWidgetStack* mainStack;
QFrame *bottomLine;
QWidget *keypadPage, *historyPage, *stackPage;
QComboBox* kpNumericCombo, *kpBaseCombo;
QRadioButton *kpDegreesButton, *kpRadiansButton, *kpGradiansButton, *kpNoAngleUnitButton;
QButtonGroup *kpAngleGroup;
QPushButton *kpExact, *kpFraction;
TQWidgetStack* mainStack;
TQFrame *bottomLine;
TQWidget *keypadPage, *historyPage, *stackPage;
TQComboBox* kpNumericCombo, *kpBaseCombo;
TQRadioButton *kpDegreesButton, *kpRadiansButton, *kpGradiansButton, *kpNoAngleUnitButton;
TQButtonGroup *kpAngleGroup;
TQPushButton *kpExact, *kpFraction;
QalculateButton *kpSquare, *kpLog, *kpHyp, *kpSqrt, *kpCos, *kpRaise, *kpInv, *kpSin;
QalculateButton *kpTan, *kpLn, *kpFactorial, *kpMod, *kpAns, *kp8, *kp0, *kp7, *kpDel, *kpDot, *kp5, *kpEquals, *kpClear;
QalculateButton *kp3, *kp1, *kp4, *kp9, *kpDivision, *kpExp, *kp6, *kp2, *kpMinus, *kpTimes, *kpPlus;
QalculateHistoryBrowser *historyBrowser;
QPushButton *historyButton, *keypadButton, *stackButton;
TQPushButton *historyButton, *keypadButton, *stackButton;
KMenuBar *menubar;
QPopupMenu *menu_functions, *menu_variables, *menu_units, *menu_to_unit, *menu_set_prefix, *menu_modes;
TQPopupMenu *menu_functions, *menu_variables, *menu_units, *menu_to_unit, *menu_set_prefix, *menu_modes;
KToggleAction *ActionAbbreviateNames, *ActionReadPrecision, *ActionNonZeroDenominators, *ActionWarnAboutDenominatorsAssumedNonZero;
KToggleAction *ActionLimitImplicitMultiplication, *ActionRPNMode, *ActionRPNSyntax, *ActionIndicateInfiniteSeries, *ActionNegativeExponents, *ActionSortMinusLast;
KToggleAction *ActionShowEndingZeroes, *ActionRoundHalfwayNumbersToEven, *ActionEnablePrefixes;
@ -250,8 +250,8 @@ public:
KGlobalAccel *globalAccel;
QValueVector<int>::size_type current_history_index;
QValueVector<ModeObject*> mode_objects;
TQValueVector<int>::size_type current_history_index;
TQValueVector<ModeObject*> mode_objects;
public slots:
@ -266,13 +266,13 @@ public slots:
void update_vmenu();
void update_umenus();
void insertVariable(Variable*);
void insertFunction(MathFunction*, QWidget *parent);
void applyFunction(MathFunction*, QWidget *parent);
void insertFunction(MathFunction*, TQWidget *parent);
void applyFunction(MathFunction*, TQWidget *parent);
void onExpressionChanged();
void onErrorTimeout();
bool fetch_exchange_rates(int);
void update_completion();
void insert_text(QString);
void insert_text(TQString);
void aboutToQuit();
void onVariableMenuItemActivated(int);
void onFunctionMenuItemActivated(int);
@ -449,10 +449,10 @@ public slots:
void deleteRegister();
void editRegister();
void updateRPNIndexes();
QListViewItem *getRPNRegister(size_t index);
TQListViewItem *getRPNRegister(size_t index);
void stackRegisterMoved();
void stackRegisterSet(QListViewItem*);
void popupStackMenu(KListView*, QListViewItem*, const QPoint&);
void stackRegisterSet(TQListViewItem*);
void popupStackMenu(KListView*, TQListViewItem*, const TQPoint&);
void registerSelected();
void editHistoryExpression();
void editHistoryParse();
@ -464,13 +464,13 @@ protected:
void updateButtonWidths();
void applySetUnknowns(bool okclicked);
bool b_unknowns_changed;
QValueVector<bool> unknown_changed;
TQValueVector<bool> unknown_changed;
MathStructure *mstruct_before_unknowns, *unknowns_mstruct;
QValueVector<KLineEdit*> unknowns_entries;
TQValueVector<KLineEdit*> unknowns_entries;
bool queryClose();
QString parsed_expression;
void keyPressEvent(QKeyEvent *e);
void fontChange(const QFont &old_font);
TQString parsed_expression;
void keyPressEvent(TQKeyEvent *e);
void fontChange(const TQFont &old_font);
void saveProperties(KConfig *cfg);
void readProperties(KConfig *cfg);
@ -488,48 +488,48 @@ class QalculateHistoryBrowser : public KTextBrowser {
public:
QalculateHistoryBrowser(QWidget *parent, const char *name);
QalculateHistoryBrowser(TQWidget *parent, const char *name);
~QalculateHistoryBrowser();
protected:
QPopupMenu *createPopupMenu(const QPoint &pos);
TQPopupMenu *createPopupMenu(const TQPoint &pos);
};
class QalculateParseLabel : public QLabel {
class QalculateParseLabel : public TQLabel {
Q_OBJECT
public:
QalculateParseLabel(QWidget *parent = 0, const char *name = 0);
QalculateParseLabel(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateParseLabel();
void setText(QString text, bool break_begin, bool error_color, bool warning_color);
void setText(TQString text, bool break_begin, bool error_color, bool warning_color);
protected:
QString parsetext;
TQString parsetext;
bool bb, ec, wc;
void drawContents(QPainter *p);
void drawContents(TQPainter *p);
};
class QalculateButton : public QPushButton {
class QalculateButton : public TQPushButton {
Q_OBJECT
public:
QalculateButton(QWidget *parent = 0, const char *name = 0);
QalculateButton(const QString &text, QWidget *parent = 0, const char *name = 0);
QalculateButton(const QIconSet &icon, const QString &text, QWidget *parent = 0, const char *name = 0);
QalculateButton(TQWidget *parent = 0, const char *name = 0);
QalculateButton(const TQString &text, TQWidget *parent = 0, const char *name = 0);
QalculateButton(const TQIconSet &icon, const TQString &text, TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateButton();
void setUseMinThreeCharWidth(bool b);
void setMarkup(const QString &str);
QSize sizeHint() const;
void setMarkup(const TQString &str);
TQSize sizeHint() const;
private:
@ -537,16 +537,16 @@ private:
};
class QalculateStyleSheet : public QStyleSheet {
class QalculateStyleSheet : public TQStyleSheet {
Q_OBJECT
public:
QalculateStyleSheet(QObject *parent = 0, const char *name = 0);
QalculateStyleSheet(TQObject *parent = 0, const char *name = 0);
virtual ~QalculateStyleSheet();
void scaleFont(QFont &font, int logicalSize) const;
void scaleFont(TQFont &font, int logicalSize) const;
};
@ -556,12 +556,12 @@ class QalculateRPNStackListView : public KListView {
public:
QalculateRPNStackListView(QWidget *parent = 0, const char *name = 0);
QalculateRPNStackListView(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateRPNStackListView();
protected:
void keyPressEvent(QKeyEvent *e);
void keyPressEvent(TQKeyEvent *e);
};
@ -576,10 +576,10 @@ class QalculateModeDialog : public KDialogBase {
public:
QalculateModeDialog(QWidget *parent);
QalculateModeDialog(TQWidget *parent);
virtual ~QalculateModeDialog();
QString modeName();
TQString modeName();
const KShortcut &modeShortcut();
public slots:

@ -30,13 +30,13 @@
#include <kcmdlineargs.h>
#include <klocale.h>
#include <unistd.h>
#include <qtextcodec.h>
#include <qobject.h>
#include <tqtextcodec.h>
#include <tqobject.h>
#include <kmessagebox.h>
#include <qtimer.h>
#include <tqtimer.h>
#include <klineedit.h>
#include <qtooltip.h>
#include <qclipboard.h>
#include <tqtooltip.h>
#include <tqclipboard.h>
#include "qalculateexpressionedit.h"
#include "qalculateresultdisplay.h"
@ -55,9 +55,9 @@ static KCmdLineOptions options[] = {
extern KnownVariable *vans[5];
extern MathStructure *mstruct, *matrix_mstruct, *parsed_mstruct, *parsed_tostruct;
extern QString result_text, result_history_text, parsed_text;
extern QWidget *expressionWidget, *resultWidget, *statusWidget_l;
extern QWidget *topWidget;
extern TQString result_text, result_history_text, parsed_text;
extern TQWidget *expressionWidget, *resultWidget, *statusWidget_l;
extern TQWidget *topWidget;
extern KQalculate *mainWin;
extern bool load_global_defs, fetch_exchange_rates_at_startup, first_time, first_qalculate_run;
@ -70,15 +70,15 @@ extern pthread_t view_thread, command_thread;
extern pthread_attr_t view_thread_attr, command_thread_attr;
extern bool command_thread_started;
extern QValueVector<QString> recent_functions_pre;
extern QValueVector<QString> recent_variables_pre;
extern QValueVector<QString> recent_units_pre;
extern TQValueVector<TQString> recent_functions_pre;
extern TQValueVector<TQString> recent_variables_pre;
extern TQValueVector<TQString> recent_units_pre;
QTimer *error_timer;
TQTimer *error_timer;
void create_qalculate_window(KUniqueApplication *parent) {
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf8"));
TQTextCodec::setCodecForCStrings(TQTextCodec::codecForName("utf8"));
b_busy = false;
@ -99,18 +99,18 @@ void create_qalculate_window(KUniqueApplication *parent) {
mainWin = new KQalculate(parent);
topWidget = mainWin;
expressionWidget = (QWidget*) mainWin->expressionEdit;
resultWidget = (QWidget*) mainWin->resultLabel;
statusWidget_l = (QWidget*) mainWin->statusLabel_l;
expressionWidget = (TQWidget*) mainWin->expressionEdit;
resultWidget = (TQWidget*) mainWin->resultLabel;
statusWidget_l = (TQWidget*) mainWin->statusLabel_l;
}
QString parse_expression_arguments(KCmdLineArgs *args) {
QString calc_arg;
TQString parse_expression_arguments(KCmdLineArgs *args) {
TQString calc_arg;
if(args->isSet("clipboard")) {
calc_arg = qApp->clipboard()->text(QClipboard::Selection);
calc_arg = tqApp->clipboard()->text(TQClipboard::Selection);
if(calc_arg.isEmpty()) {
calc_arg = qApp->clipboard()->text(QClipboard::Clipboard);
calc_arg = tqApp->clipboard()->text(TQClipboard::Clipboard);
}
} else {
for(int i = 0; i < args->count(); i++) {
@ -126,7 +126,7 @@ QString parse_expression_arguments(KCmdLineArgs *args) {
void start_qalculate() {
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
QString calc_arg = parse_expression_arguments(args);
TQString calc_arg = parse_expression_arguments(args);
args->clear();
if(!calc_arg.isEmpty()) {
mainWin->expressionEdit->setText(calc_arg);
@ -136,18 +136,18 @@ void start_qalculate() {
mainWin->resultLabel->setText("<div align=\"right\"><font size=2>&nbsp;<br></font><font size=6>= 0</font></div>");
}
qApp->processEvents();
tqApp->processEvents();
//exchange rates
if(first_qalculate_run) {
if(KMessageBox::questionYesNo(mainWin, i18n("You need to download exchange rates to be able to convert between different currencies. You can later get current exchange rates by selecting \"Update Exchange Rates\" under the File menu.\n\nDo you want to fetch exchange rates now from the Internet?"), i18n("Update exchange rates?")) == KMessageBox::Yes) {
qApp->processEvents();
tqApp->processEvents();
mainWin->fetch_exchange_rates(5);
}
qApp->processEvents();
tqApp->processEvents();
} else if(fetch_exchange_rates_at_startup) {
mainWin->fetch_exchange_rates(5);
qApp->processEvents();
tqApp->processEvents();
}
CALCULATOR->loadExchangeRates();
@ -164,15 +164,15 @@ void start_qalculate() {
//load global definitions
if(load_global_defs && !CALCULATOR->loadGlobalDefinitions()) {
KMessageBox::error(mainWin, i18n("Failed to load global definitions!"), i18n("Error"));
qApp->processEvents();
tqApp->processEvents();
}
//load local definitions
CALCULATOR->loadLocalDefinitions();
//check for calculation errros regularly
error_timer = new QTimer(mainWin);
QObject::connect(error_timer, SIGNAL(timeout()), mainWin, SLOT(onErrorTimeout()));
error_timer = new TQTimer(mainWin);
TQObject::connect(error_timer, SIGNAL(timeout()), mainWin, SLOT(onErrorTimeout()));
generate_units_tree_struct();
generate_functions_tree_struct();
@ -211,8 +211,8 @@ void start_qalculate() {
pthread_attr_init(&command_thread_attr);
command_thread_started = false;
QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()));
QObject::connect(qApp, SIGNAL(aboutToQuit()), mainWin, SLOT(aboutToQuit()));
TQObject::connect(tqApp, SIGNAL(lastWindowClosed()), tqApp, SLOT(quit()));
TQObject::connect(tqApp, SIGNAL(aboutToQuit()), mainWin, SLOT(aboutToQuit()));
error_timer->start(100);
@ -235,7 +235,7 @@ public:
if(mainWin && started) {
KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
QString calc_arg = parse_expression_arguments(args);
TQString calc_arg = parse_expression_arguments(args);
args->clear();
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2

@ -31,11 +31,11 @@
#include <dirent.h>
#include <stdio.h>
#include <klocale.h>
#include <qstringlist.h>
#include <tqstringlist.h>
#include <ktextbrowser.h>
#include <qwidgetstack.h>
#include <qpushbutton.h>
#include <qvaluevector.h>
#include <tqwidgetstack.h>
#include <tqpushbutton.h>
#include <tqvaluevector.h>
PrintOptions printops;
EvaluationOptions evalops;
@ -44,8 +44,8 @@ bool rpn_keypad_only;
bool load_global_defs, fetch_exchange_rates_at_startup, first_time, first_qalculate_run, save_mode_on_exit, save_defs_on_exit;
bool use_custom_result_font, use_custom_expression_font, use_custom_status_font;
int use_icon_buttons;
QString custom_result_font, custom_expression_font, custom_status_font;
QColor status_warning_color, status_error_color;
TQString custom_result_font, custom_expression_font, custom_status_font;
TQColor status_warning_color, status_error_color;
bool display_expression_status;
bool close_to_systray;
@ -54,41 +54,41 @@ bool enable_expression_completion;
PlotLegendPlacement default_plot_legend_placement;
bool default_plot_display_grid;
bool default_plot_full_border;
QString default_plot_min;
QString default_plot_max;
QString default_plot_step;
TQString default_plot_min;
TQString default_plot_max;
TQString default_plot_step;
int default_plot_sampling_rate;
bool default_plot_use_sampling_rate;
bool default_plot_rows;
int default_plot_type;
PlotStyle default_plot_style;
PlotSmoothing default_plot_smoothing;
QString default_plot_variable;
TQString default_plot_variable;
bool default_plot_color;
bool enable_plot_expression_completion;
bool canplot;
QString initial_history;
TQString initial_history;
extern vector<MathFunction*> recent_functions;
extern vector<Variable*> recent_variables;
extern vector<Unit*> recent_units;
QValueVector<QString> recent_functions_pre;
QValueVector<QString> recent_variables_pre;
QValueVector<QString> recent_units_pre;
TQValueVector<TQString> recent_functions_pre;
TQValueVector<TQString> recent_variables_pre;
TQValueVector<TQString> recent_units_pre;
extern QWidget *expressionWidget;
extern TQWidget *expressionWidget;
extern KQalculate *mainWin;
QStringList expression_history;
TQStringList expression_history;
bool show_keypad, show_history, show_stack;
vector<mode_struct> modes;
QValueVector<QString> inhistory;
QValueVector<int> inhistory_type;
QValueVector<int> inhistory_id;
TQValueVector<TQString> inhistory;
TQValueVector<int> inhistory_type;
TQValueVector<int> inhistory_id;
int inhistory_current_id;
/*
@ -111,7 +111,7 @@ void set_saved_mode() {
modes[1].rpn_mode = rpn_mode;
}
size_t save_mode_as(QString name, bool *new_mode) {
size_t save_mode_as(TQString name, bool *new_mode) {
name = name.stripWhiteSpace();
size_t index = 0;
for(; index < modes.size(); index++) {
@ -250,7 +250,7 @@ void load_preferences() {
file = fopen(filename.c_str(), "r");
if(file) {
char line[10000];
QString stmp, svalue, svar;
TQString stmp, svalue, svar;
int i;
int v;
while(true) {
@ -633,7 +633,7 @@ void load_preferences() {
if(stmp == "Mode") {
mode_index = 1;
} else if(stmp.length() > 5) {
QString svar = stmp;
TQString svar = stmp;
svar.truncate(4);
if(svar == "Mode") {
stmp.remove(0, 5);
@ -645,7 +645,7 @@ void load_preferences() {
inhistory_current_id = (int) inhistory.size();
int id = inhistory_current_id;
id--;
for(QValueVector<QString>::size_type i = 0; i < inhistory.size(); i++) {
for(TQValueVector<TQString>::size_type i = 0; i < inhistory.size(); i++) {
inhistory_id.push_back(id);
id--;
}
@ -695,17 +695,17 @@ void save_preferences(bool mode) {
fprintf(file, "custom_result_font=%s\n", custom_result_font.ascii());
fprintf(file, "custom_expression_font=%s\n", custom_expression_font.ascii());
fprintf(file, "custom_status_font=%s\n", custom_status_font.ascii());
if(status_error_color != QColor("red")) fprintf(file, "status_error_color=%s\n", status_error_color.name().ascii());
if(status_warning_color != QColor("blue")) fprintf(file, "status_warning_color=%s\n", status_warning_color.name().ascii());
if(status_error_color != TQColor("red")) fprintf(file, "status_error_color=%s\n", status_error_color.name().ascii());
if(status_warning_color != TQColor("blue")) fprintf(file, "status_warning_color=%s\n", status_warning_color.name().ascii());
fprintf(file, "multiplication_sign=%i\n", printops.multiplication_sign);
fprintf(file, "division_sign=%i\n", printops.division_sign);
for (QStringList::Iterator it = ((QalculateExpressionEdit*) expressionWidget)->expression_history.begin(); it != ((QalculateExpressionEdit*) expressionWidget)->expression_history.end(); ++it) {
for (TQStringList::Iterator it = ((QalculateExpressionEdit*) expressionWidget)->expression_history.begin(); it != ((QalculateExpressionEdit*) expressionWidget)->expression_history.end(); ++it) {
fprintf(file, "expression_history=%s\n", (*it).ascii());
}
int lines = 50;
bool end_after_result = false;
bool doend = false;
for(QValueVector<QString>::size_type i = 0; i < inhistory.size() && !doend; i++) {
for(TQValueVector<TQString>::size_type i = 0; i < inhistory.size() && !doend; i++) {
switch(inhistory_type[i]) {
case QALCULATE_HISTORY_EXPRESSION: {
fprintf(file, "history_expression=");
@ -763,8 +763,8 @@ void save_preferences(bool mode) {
if(inhistory[i].find("<br>") < 0) {
fprintf(file, "%s\n", inhistory[i].ascii());
} else {
QStringList slist = QStringList::split("<br>", inhistory[i], true);
for(QStringList::size_type i2 = 0; i2 < slist.size(); i2++) {
TQStringList slist = TQStringList::split("<br>", inhistory[i], true);
for(TQStringList::size_type i2 = 0; i2 < slist.size(); i2++) {
if(i2 == 0) fprintf(file, "%s\n", slist[i2].ascii());
else fprintf(file, "history_continued=%s\n", slist[i2].ascii());
}

@ -19,12 +19,12 @@
***************************************************************************/
#include "qalculate_tde_utils.h"
#include <qwidget.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qstring.h>
#include <qfont.h>
#include <qfontmetrics.h>
#include <tqwidget.h>
#include <tqlabel.h>
#include <tqlineedit.h>
#include <tqstring.h>
#include <tqfont.h>
#include <tqfontmetrics.h>
#include "kqalculate.h"
tree_struct function_cats, unit_cats, variable_cats;
@ -34,10 +34,10 @@ vector<Variable*> recent_variables;
vector<Unit*> recent_units;
extern PrintOptions printops;
extern KnownVariable *vans[5];
extern QWidget *topWidget;
extern TQWidget *topWidget;
extern KQalculate *mainWin;
void insert_text_in_expression(const QString &str) {
void insert_text_in_expression(const TQString &str) {
mainWin->insert_text(str);
}
@ -45,20 +45,20 @@ bool is_answer_variable(Variable *v) {
return v == vans[0] || v == vans[1] || v == vans[2] || v == vans[3] || v == vans[4];
}
QString get_value_string(const MathStructure &mstruct_, bool rlabel, Prefix *prefix) {
TQString get_value_string(const MathStructure &mstruct_, bool rlabel, Prefix *prefix) {
printops.allow_non_usable = rlabel;
printops.prefix = prefix;
QString str = CALCULATOR->printMathStructureTimeOut(mstruct_, 100, printops).c_str();
TQString str = CALCULATOR->printMathStructureTimeOut(mstruct_, 100, printops).c_str();
printops.allow_non_usable = false;
printops.prefix = NULL;
return str;
}
void set_name_label_and_entry(ExpressionItem *item, QLineEdit *entry, QLabel *label) {
void set_name_label_and_entry(ExpressionItem *item, TQLineEdit *entry, TQLabel *label) {
const ExpressionName *ename = &item->getName(1);
entry->setText(ename->name.c_str());
if(item->countNames() > 1) {
QString str = "+ ";
TQString str = "+ ";
for(size_t i = 2; i <= item->countNames(); i++) {
if(i > 2) str += ", ";
str += item->getName(i).name.c_str();
@ -69,9 +69,9 @@ void set_name_label_and_entry(ExpressionItem *item, QLineEdit *entry, QLabel *la
bool can_display_unicode_string_function(const char *str, void *arg) {
if(!arg) arg = (void*) topWidget;
QFontMetrics fm(((QWidget*) arg)->fontMetrics());
QString qstr(str);
const QChar *qchars = qstr.unicode();
TQFontMetrics fm(((TQWidget*) arg)->fontMetrics());
TQString qstr(str);
const TQChar *qchars = qstr.unicode();
for(uint i = 0; i < qstr.length(); i++) {
if(!fm.inFont(qchars[i])) return false;
}

@ -27,11 +27,11 @@
#undef setItem
#undef getItem
#include <qstring.h>
#include <tqstring.h>
#include <kshortcut.h>
class QLabel;
class QLineEdit;
class TQLabel;
class TQLineEdit;
struct tree_struct {
string item;
@ -56,19 +56,19 @@ struct mode_struct {
AssumptionType at;
AssumptionSign as;
int precision;
QString name;
TQString name;
bool rpn_mode;
KShortcut shortcut;
};
void insert_text_in_expression(const QString &str);
void insert_text_in_expression(const TQString &str);
bool is_answer_variable(Variable *v);
QString get_value_string(const MathStructure &mstruct_, bool rlabel = false, Prefix *prefix = NULL);
void set_name_label_and_entry(ExpressionItem *item, QLineEdit *entry, QLabel *label);
TQString get_value_string(const MathStructure &mstruct_, bool rlabel = false, Prefix *prefix = NULL);
void set_name_label_and_entry(ExpressionItem *item, TQLineEdit *entry, TQLabel *label);
bool can_display_unicode_string_function(const char *str, void *arg);
void generate_units_tree_struct();
void generate_functions_tree_struct();
void generate_variables_tree_struct();
size_t save_mode_as(QString name, bool *new_mode = NULL);
size_t save_mode_as(TQString name, bool *new_mode = NULL);
#endif

@ -19,13 +19,13 @@
***************************************************************************/
#include "qalculatebuttonwithdata.h"
QalculateButtonWithData::QalculateButtonWithData(void *data, const QString & text, QWidget *parent, const char *name) : QPushButton(text, parent, name) {
QalculateButtonWithData::QalculateButtonWithData(void *data, const TQString & text, TQWidget *parent, const char *name) : TQPushButton(text, parent, name) {
user_data = data;
QObject::connect(this, SIGNAL(clicked()), this, SLOT(emitClickedWithData()));
TQObject::connect(this, SIGNAL(clicked()), this, SLOT(emitClickedWithData()));
}
QalculateButtonWithData::QalculateButtonWithData(void *data, const QIconSet & icon, const QString & text, QWidget * parent, const char * name) : QPushButton(icon, text, parent, name) {
QalculateButtonWithData::QalculateButtonWithData(void *data, const TQIconSet & icon, const TQString & text, TQWidget * parent, const char * name) : TQPushButton(icon, text, parent, name) {
user_data = data;
QObject::connect(this, SIGNAL(clicked()), this, SLOT(emitClickedWithData()));
TQObject::connect(this, SIGNAL(clicked()), this, SLOT(emitClickedWithData()));
}
QalculateButtonWithData::~QalculateButtonWithData() {}
void QalculateButtonWithData::emitClickedWithData() {

@ -20,18 +20,18 @@
#ifndef QALCULATEBUTTONWITHDATA_H
#define QALCULATEBUTTONWITHDATA_H
#include <qpushbutton.h>
#include <tqpushbutton.h>
/**
@author Niklas Knutsson
*/
class QalculateButtonWithData : public QPushButton {
class QalculateButtonWithData : public TQPushButton {
Q_OBJECT
public:
QalculateButtonWithData(void *data, const QString & text, QWidget *parent, const char *name = 0);
QalculateButtonWithData(void *data, const QIconSet & icon, const QString & text, QWidget * parent, const char * name = 0);
QalculateButtonWithData(void *data, const TQString & text, TQWidget *parent, const char *name = 0);
QalculateButtonWithData(void *data, const TQIconSet & icon, const TQString & text, TQWidget * parent, const char * name = 0);
virtual ~QalculateButtonWithData();
void *user_data;

@ -20,36 +20,36 @@
#include "qalculateconvertnumberbasesdialog.h"
#include "qalculate_tde_utils.h"
#include <klocale.h>
#include <qgrid.h>
#include <qlabel.h>
#include <tqgrid.h>
#include <tqlabel.h>
#include <klineedit.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
extern EvaluationOptions evalops;
QalculateConvertNumberBasesDialog::QalculateConvertNumberBasesDialog(QWidget *parent, const char *name)
QalculateConvertNumberBasesDialog::QalculateConvertNumberBasesDialog(TQWidget *parent, const char *name)
: KDialogBase(parent, name, false, i18n("Number Bases"), Close, Close) {
actionButton(Close)->setAutoDefault(false);
actionButton(Close)->setDefault(false);
QGrid *grid = makeGridMainWidget(2, Qt::Horizontal);
new QLabel(i18n("Decimal:"), grid);
TQGrid *grid = makeGridMainWidget(2, TQt::Horizontal);
new TQLabel(i18n("Decimal:"), grid);
decimalEdit = new KLineEdit(grid);
decimalEdit->setAlignment(Qt::AlignRight);
QObject::connect(decimalEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setDecimalValue(const QString&)));
new QLabel(i18n("Binary:"), grid);
decimalEdit->setAlignment(TQt::AlignRight);
TQObject::connect(decimalEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(setDecimalValue(const TQString&)));
new TQLabel(i18n("Binary:"), grid);
binaryEdit = new KLineEdit(grid);
binaryEdit->setAlignment(Qt::AlignRight);
QObject::connect(binaryEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setBinaryValue(const QString&)));
new QLabel(i18n("Octal:"), grid);
binaryEdit->setAlignment(TQt::AlignRight);
TQObject::connect(binaryEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(setBinaryValue(const TQString&)));
new TQLabel(i18n("Octal:"), grid);
octalEdit = new KLineEdit(grid);
octalEdit->setAlignment(Qt::AlignRight);
QObject::connect(octalEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setOctalValue(const QString&)));
new QLabel(i18n("Hexadecimal:"), grid);
octalEdit->setAlignment(TQt::AlignRight);
TQObject::connect(octalEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(setOctalValue(const TQString&)));
new TQLabel(i18n("Hexadecimal:"), grid);
hexadecimalEdit = new KLineEdit(grid);
hexadecimalEdit->setAlignment(Qt::AlignRight);
QObject::connect(hexadecimalEdit, SIGNAL(textChanged(const QString&)), this, SLOT(setHexadecimalValue(const QString&)));
hexadecimalEdit->setAlignment(TQt::AlignRight);
TQObject::connect(hexadecimalEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(setHexadecimalValue(const TQString&)));
decimalEdit->setFocus();
@ -58,7 +58,7 @@ QalculateConvertNumberBasesDialog::QalculateConvertNumberBasesDialog(QWidget *pa
QalculateConvertNumberBasesDialog::~QalculateConvertNumberBasesDialog() {}
void QalculateConvertNumberBasesDialog::setDecimalValue(const QString &qstr) {
void QalculateConvertNumberBasesDialog::setDecimalValue(const TQString &qstr) {
string str = qstr.ascii();
remove_blank_ends(str);
if(str.empty()) return;
@ -68,7 +68,7 @@ void QalculateConvertNumberBasesDialog::setDecimalValue(const QString &qstr) {
MathStructure value = CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(str, evalops.parse_options), eo);
updateEntries(&value, 10);
}
void QalculateConvertNumberBasesDialog::setBinaryValue(const QString &qstr) {
void QalculateConvertNumberBasesDialog::setBinaryValue(const TQString &qstr) {
string str = qstr.ascii();
remove_blank_ends(str);
if(str.empty()) return;
@ -79,7 +79,7 @@ void QalculateConvertNumberBasesDialog::setBinaryValue(const QString &qstr) {
MathStructure value = CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(str, evalops.parse_options), eo);
updateEntries(&value, 2);
}
void QalculateConvertNumberBasesDialog::setOctalValue(const QString &qstr) {
void QalculateConvertNumberBasesDialog::setOctalValue(const TQString &qstr) {
string str = qstr.ascii();
remove_blank_ends(str);
if(str.empty()) return;
@ -90,7 +90,7 @@ void QalculateConvertNumberBasesDialog::setOctalValue(const QString &qstr) {
MathStructure value = CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(str, evalops.parse_options), eo);
updateEntries(&value, 8);
}
void QalculateConvertNumberBasesDialog::setHexadecimalValue(const QString &qstr) {
void QalculateConvertNumberBasesDialog::setHexadecimalValue(const TQString &qstr) {
string str = qstr.ascii();
remove_blank_ends(str);
if(str.empty()) return;

@ -31,7 +31,7 @@ class MathStructure;
class QalculateConvertNumberBasesDialog : public KDialogBase {
Q_OBJECT
public:
QalculateConvertNumberBasesDialog(QWidget *parent = 0, const char *name = 0);
QalculateConvertNumberBasesDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateConvertNumberBasesDialog();
@ -39,10 +39,10 @@ public:
public slots:
void setDecimalValue(const QString&);
void setBinaryValue(const QString&);
void setOctalValue(const QString&);
void setHexadecimalValue(const QString&);
void setDecimalValue(const TQString&);
void setBinaryValue(const TQString&);
void setOctalValue(const TQString&);
void setHexadecimalValue(const TQString&);
protected:

@ -20,18 +20,18 @@
#include "qalculateconvertunitsdialog.h"
#include "qalculate_tde_utils.h"
#include <qlabel.h>
#include <tqlabel.h>
#include <klineedit.h>
#include <klocale.h>
#include <qhbox.h>
#include <tqhbox.h>
#include <klistview.h>
#include <klocale.h>
#include <qvbox.h>
#include <tqvbox.h>
#include <klistview.h>
#include <kmessagebox.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qsplitter.h>
#include <tqlayout.h>
#include <tqpushbutton.h>
#include <tqsplitter.h>
extern tree_struct unit_cats;
extern vector<void*> ia_units;
@ -39,23 +39,23 @@ extern PrintOptions printops;
extern EvaluationOptions evalops;
QalculateConvertUnitsDialog::QalculateConvertUnitsDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Convert"), Ok | Apply | Cancel | Details, Ok, true) {
QalculateConvertUnitsDialog::QalculateConvertUnitsDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Convert"), Ok | Apply | Cancel | Details, Ok, true) {
setButtonText(Details, i18n("Selector"));
selected_category = "";
block_unit_convert = true;
QVBox *box = makeVBoxMainWidget();
new QLabel(i18n("Unit expression:"), box);
TQVBox *box = makeVBoxMainWidget();
new TQLabel(i18n("Unit expression:"), box);
unitExpressionEdit = new KLineEdit(box);
QVBox *box_d = new QVBox(this);
TQVBox *box_d = new TQVBox(this);
box_d->setSpacing(spacingHint());
new QWidget(box_d);
new TQWidget(box_d);
QSplitter *splitter = new QSplitter(Qt::Vertical, box_d);
splitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
TQSplitter *splitter = new TQSplitter(TQt::Vertical, box_d);
splitter->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
setDetailsWidget(box_d);
@ -82,10 +82,10 @@ void QalculateConvertUnitsDialog::updateUnitTree() {
unitItems.clear();
categoryItems.clear();
categoryView->clear();
QListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
TQListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
categoryItems[i] = i18n("All");
i->setOpen(true);
QString str;
TQString str;
tree_struct *item, *item2;
unit_cats.it = unit_cats.items.begin();
if(unit_cats.it != unit_cats.items.end()) {
@ -139,14 +139,14 @@ void QalculateConvertUnitsDialog::updateUnitTree() {
if(!categoryView->selectedItem()) {
//if no category has been selected (previously selected has been renamed/deleted), select "All"
selected_category = i18n("All");
QListViewItemIterator it(categoryView);
TQListViewItemIterator it(categoryView);
if(it.current())
categoryView->setSelected(it.current(), true);
}
}
void QalculateConvertUnitsDialog::unitSelected() {
QListViewItem *selected = unitView->selectedItem();
TQListViewItem *selected = unitView->selectedItem();
if(selected) {
Unit *u = unitItems[selected];
if(!CALCULATOR->stillHasUnit(u)) {
@ -161,14 +161,14 @@ void QalculateConvertUnitsDialog::unitSelected() {
}
void QalculateConvertUnitsDialog::addUnitTreeItem(Unit *u) {
QListViewItem *i = new KListViewItem(unitView, u->title(true).c_str());
TQListViewItem *i = new KListViewItem(unitView, u->title(true).c_str());
unitItems[i] = u;
}
void QalculateConvertUnitsDialog::categorySelected() {
block_unit_convert = true;
QListViewItem *selected = categoryView->selectedItem();
TQListViewItem *selected = categoryView->selectedItem();
bool no_cat = false, b_all = false;
unitView->clear();
unitItems.clear();

@ -21,12 +21,12 @@
#define QALCULATECONVERTUNITSDIALOG_H
#include <kdialogbase.h>
#include <qmap.h>
#include <tqmap.h>
class KLineEdit;
class Unit;
class KListView;
class QListViewItem;
class TQListViewItem;
/**
@author Niklas Knutsson
@ -37,19 +37,19 @@ class QalculateConvertUnitsDialog : public KDialogBase {
public:
QalculateConvertUnitsDialog(QWidget *parent = 0, const char *name = 0);
QalculateConvertUnitsDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateConvertUnitsDialog();
KLineEdit *unitExpressionEdit;
void addUnitTreeItem(Unit *f);
QMap<QListViewItem*, Unit*> unitItems;
QMap<QListViewItem*, QString> categoryItems;
TQMap<TQListViewItem*, Unit*> unitItems;
TQMap<TQListViewItem*, TQString> categoryItems;
KListView *categoryView;
KListView *unitView;
QString selected_category;
TQString selected_category;
bool block_unit_convert;
public slots:

@ -24,100 +24,100 @@
#include "qalculate_tde_utils.h"
#include "qalculatebuttonwithdata.h"
#include <kpushbutton.h>
#include <qsplitter.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qgrid.h>
#include <tqsplitter.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqgrid.h>
#include <klistview.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <qlayout.h>
#include <qgroupbox.h>
#include <qscrollview.h>
#include <tqlayout.h>
#include <tqgroupbox.h>
#include <tqscrollview.h>
#include <ktextbrowser.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <kactivelabel.h>
#include <kiconloader.h>
#include <klineedit.h>
extern PrintOptions printops;
extern QWidget *expressionWidget;
extern TQWidget *expressionWidget;
QalculateDataSetsDialog::QalculateDataSetsDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Data Sets"), Close, Close, false) {
QalculateDataSetsDialog::QalculateDataSetsDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Data Sets"), Close, Close, false) {
dataset_edit_dialog = NULL;
object_edit_dialog = NULL;
QVBox *box = makeVBoxMainWidget();
QSplitter *splitter = new QSplitter(Qt::Vertical, box);
TQVBox *box = makeVBoxMainWidget();
TQSplitter *splitter = new TQSplitter(TQt::Vertical, box);
QVBox *group1 = new QVBox(splitter);
QVBox *group2 = new QVBox(splitter);
TQVBox *group1 = new TQVBox(splitter);
TQVBox *group2 = new TQVBox(splitter);
splitter = new QSplitter(Qt::Horizontal, group1);
QWidget *widget = new QWidget(splitter);
widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
QVBoxLayout *vbox = new QVBoxLayout(widget, spacingHint(), spacingHint());
vbox->addWidget(new QLabel(i18n("Data Sets:"), widget));
splitter = new TQSplitter(TQt::Horizontal, group1);
TQWidget *widget = new TQWidget(splitter);
widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding);
TQVBoxLayout *vbox = new TQVBoxLayout(widget, spacingHint(), spacingHint());
vbox->addWidget(new TQLabel(i18n("Data Sets:"), widget));
dataSetsView = new KListView(widget);
vbox->addWidget(dataSetsView);
dataSetsView->addColumn(i18n("Data Set"));
dataSetsView->setRootIsDecorated(false);
QHBoxLayout *hbox = new QHBoxLayout(vbox);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
newDataSetButton = new QPushButton(i18n("New"), widget);
TQHBoxLayout *hbox = new TQHBoxLayout(vbox);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
newDataSetButton = new TQPushButton(i18n("New"), widget);
hbox->addWidget(newDataSetButton);
editDataSetButton = new QPushButton(i18n("Edit"), widget);
editDataSetButton = new TQPushButton(i18n("Edit"), widget);
hbox->addWidget(editDataSetButton);
deleteDataSetButton = new QPushButton(i18n("Delete"), widget);
deleteDataSetButton = new TQPushButton(i18n("Delete"), widget);
hbox->addWidget(deleteDataSetButton);
QVBox *vbox2 = new QVBox(splitter);
TQVBox *vbox2 = new TQVBox(splitter);
vbox2->setMargin(spacingHint());
vbox2->setSpacing(spacingHint());
new QLabel(i18n("Description:"), vbox2);
new TQLabel(i18n("Description:"), vbox2);
descriptionBrowser = new KTextBrowser(vbox2);
splitter = new QSplitter(Qt::Horizontal, group2);
widget = new QWidget(splitter);
widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
vbox = new QVBoxLayout(widget, spacingHint(), spacingHint());
vbox->addWidget(new QLabel(i18n("Objects:"), widget));
splitter = new TQSplitter(TQt::Horizontal, group2);
widget = new TQWidget(splitter);
widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding);
vbox = new TQVBoxLayout(widget, spacingHint(), spacingHint());
vbox->addWidget(new TQLabel(i18n("Objects:"), widget));
objectsView = new KListView(widget);
vbox->addWidget(objectsView);
objectsView->addColumn(i18n("Object"));
objectsView->setRootIsDecorated(false);
hbox = new QHBoxLayout(vbox);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
newObjectButton = new QPushButton(i18n("New"), widget);
hbox = new TQHBoxLayout(vbox);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
newObjectButton = new TQPushButton(i18n("New"), widget);
hbox->addWidget(newObjectButton);
editObjectButton = new QPushButton(i18n("Edit"), widget);
editObjectButton = new TQPushButton(i18n("Edit"), widget);
hbox->addWidget(editObjectButton);
deleteObjectButton = new QPushButton(i18n("Delete"), widget);
deleteObjectButton = new TQPushButton(i18n("Delete"), widget);
hbox->addWidget(deleteObjectButton);
vbox2 = new QVBox(splitter);
vbox2 = new TQVBox(splitter);
vbox2->setMargin(spacingHint());
vbox2->setSpacing(spacingHint());
new QLabel(i18n("Attributes:"), vbox2);
attributesView = new QScrollView(vbox2);
attributesView->setResizePolicy(QScrollView::AutoOneFit);
attributesView->setFrameStyle(QFrame::NoFrame);
attributesGrid = new QGrid(3, Qt::Horizontal, attributesView->viewport());
new TQLabel(i18n("Attributes:"), vbox2);
attributesView = new TQScrollView(vbox2);
attributesView->setResizePolicy(TQScrollView::AutoOneFit);
attributesView->setFrameStyle(TQFrame::NoFrame);
attributesGrid = new TQGrid(3, TQt::Horizontal, attributesView->viewport());
attributesGrid->setSpacing(spacingHint());
attributesView->addChild(attributesGrid);
resize(QSize(675, 525).expandedTo(size()));
resize(TQSize(675, 525).expandedTo(size()));
connect(newDataSetButton, SIGNAL(clicked()), this, SLOT(newDataSet()));
connect(editDataSetButton, SIGNAL(clicked()), this, SLOT(editDataSet()));
connect(deleteDataSetButton, SIGNAL(clicked()), this, SLOT(deleteDataSet()));
connect(dataSetsView, SIGNAL(selectionChanged()), this, SLOT(dataSetSelected()));
connect(dataSetsView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(dataSetDoubleClicked(QListViewItem*)));
connect(dataSetsView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(dataSetDoubleClicked(TQListViewItem*)));
connect(newObjectButton, SIGNAL(clicked()), this, SLOT(newObject()));
connect(editObjectButton, SIGNAL(clicked()), this, SLOT(editObject()));
connect(deleteObjectButton, SIGNAL(clicked()), this, SLOT(deleteObject()));
connect(objectsView, SIGNAL(selectionChanged()), this, SLOT(objectSelected()));
connect(objectsView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(objectDoubleClicked(QListViewItem*)));
connect(objectsView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(objectDoubleClicked(TQListViewItem*)));
}
@ -129,7 +129,7 @@ void QalculateDataSetsDialog::updateDataSetTree() {
objectItems.clear();
dataSetsView->clear();
DataSet *ds;
QListViewItem *i;
TQListViewItem *i;
bool b = false;
dataSetsView->blockSignals(true);
for(size_t index = 1; ; index++) {
@ -152,8 +152,8 @@ void QalculateDataSetsDialog::updateDataSetTree() {
}
#define UPDATE_SELECTED_DATASET QListViewItem *i3 = dataSetsView->selectedItem(); if(!i3) return; selected_dataset = dataSetItems[i3]; if(!selected_dataset) return;
#define UPDATE_SELECTED_OBJECT QListViewItem *i2 = objectsView->selectedItem(); if(!i2) return; selected_object = objectItems[i2]; if(!selected_object) return;
#define UPDATE_SELECTED_DATASET TQListViewItem *i3 = dataSetsView->selectedItem(); if(!i3) return; selected_dataset = dataSetItems[i3]; if(!selected_dataset) return;
#define UPDATE_SELECTED_OBJECT TQListViewItem *i2 = objectsView->selectedItem(); if(!i2) return; selected_object = objectItems[i2]; if(!selected_object) return;
#define CHECK_IF_DATASET_STILL_THERE if(!CALCULATOR->stillHasFunction(selected_dataset)) {KMessageBox::error(this, i18n("Data set does not exist anymore.")); emit dataSetsChanged(); return;}
void QalculateDataSetsDialog::deleteDataSet() {
@ -193,7 +193,7 @@ void QalculateDataSetsDialog::newDataSet() {
}
}
void QalculateDataSetsDialog::dataSetDoubleClicked(QListViewItem*i) {
void QalculateDataSetsDialog::dataSetDoubleClicked(TQListViewItem*i) {
selected_dataset = dataSetItems[i];
if(!selected_dataset)
return;
@ -210,7 +210,7 @@ void QalculateDataSetsDialog::dataSetDoubleClicked(QListViewItem*i) {
void QalculateDataSetsDialog::dataSetSelected() {
QListViewItem *selected = dataSetsView->selectedItem();
TQListViewItem *selected = dataSetsView->selectedItem();
objectsView->clear();
if(selected) {
DataSet *ds = dataSetItems[selected];
@ -232,7 +232,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
DataProperty *dp;
DataObject *o = ds->getFirstObject(&it);
bool b = false, b2 = false;
QListViewItem *i;
TQListViewItem *i;
while(o) {
i = new KListViewItem(objectsView);
objectItems[i] = o;
@ -257,7 +257,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
o = ds->getNextObject(&it);
}
if(!b) {
QListViewItemIterator qit(objectsView);
TQListViewItemIterator qit(objectsView);
if(qit.current()) {
objectsView->setSelected(qit.current(), true);
}
@ -268,7 +268,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
deleteDataSetButton->setEnabled(ds->isLocal());
newObjectButton->setEnabled(true);
QString str, str2;
TQString str, str2;
if(!ds->description().empty()) {
str2 = ds->description().c_str();
@ -341,7 +341,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
} else {
str += i18n("argument");
str += " ";
str += QString::number(i2);
str += TQString::number(i2);
}
if(i2 > ds->minargs()) {
str += "]";
@ -387,7 +387,7 @@ void QalculateDataSetsDialog::insertObjectData(void *data) {
DataProperty *dp = (DataProperty*) data;
DataSet *ds = dp->parentSet();
if(ds && selected_object) {
QString str = ds->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str();
TQString str = ds->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str();
str += "(";
str += selected_object->getProperty(ds->getPrimaryKeyProperty()).c_str();
str += CALCULATOR->getComma().c_str();
@ -400,7 +400,7 @@ void QalculateDataSetsDialog::insertObjectData(void *data) {
void QalculateDataSetsDialog::objectSelected() {
QListViewItem *selected = objectsView->selectedItem();
TQListViewItem *selected = objectsView->selectedItem();
DataObject *o = NULL;
if(selected) o = objectItems[selected];
@ -412,10 +412,10 @@ void QalculateDataSetsDialog::objectSelected() {
if(!ds) return;
DataPropertyIter it;
DataProperty *dp = ds->getFirstProperty(&it);
QString sval;
QString str;
TQString sval;
TQString str;
delete attributesGrid;
attributesGrid = new QGrid(3, Qt::Horizontal, attributesView->viewport());
attributesGrid = new TQGrid(3, TQt::Horizontal, attributesView->viewport());
attributesGrid->setSpacing(spacingHint());
attributesView->addChild(attributesGrid);
while(dp) {
@ -423,22 +423,22 @@ void QalculateDataSetsDialog::objectSelected() {
sval = o->getPropertyDisplayString(dp).c_str();
if(!sval.isEmpty()) {
str = "<b>"; str += dp->title().c_str(); str += ":"; str += "</b>";
new QLabel(str, attributesGrid);
new TQLabel(str, attributesGrid);
KLineEdit *le = new KLineEdit(sval, attributesGrid);
le->setReadOnly(true);
le->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
QalculateButtonWithData *button = new QalculateButtonWithData((void*) dp, QIconSet(SmallIcon("editpaste")), "", attributesGrid);
QObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertObjectData(void*)));
le->setFrameStyle(TQFrame::NoFrame | TQFrame::Plain);
QalculateButtonWithData *button = new QalculateButtonWithData((void*) dp, TQIconSet(SmallIcon("editpaste")), "", attributesGrid);
TQObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertObjectData(void*)));
}
}
dp = ds->getNextProperty(&it);
}
QWidget *widget = new QWidget(attributesGrid);
widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
TQWidget *widget = new TQWidget(attributesGrid);
widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding);
attributesGrid->show();
} else {
delete attributesGrid;
attributesGrid = new QGrid(3, Qt::Horizontal, attributesView->viewport());
attributesGrid = new TQGrid(3, TQt::Horizontal, attributesView->viewport());
attributesGrid->setSpacing(spacingHint());
attributesView->addChild(attributesGrid);
attributesGrid->show();
@ -486,7 +486,7 @@ void QalculateDataSetsDialog::newObject() {
}
}
void QalculateDataSetsDialog::objectDoubleClicked(QListViewItem*i) {
void QalculateDataSetsDialog::objectDoubleClicked(TQListViewItem*i) {
UPDATE_SELECTED_DATASET
selected_object = objectItems[i];
if(!selected_object)

@ -21,13 +21,13 @@
#define QALCULATEDATASETSDIALOG_H
#include <kdialogbase.h>
#include <qmap.h>
#include <tqmap.h>
class QPushButton;
class TQPushButton;
class KListView;
class KTextBrowser;
class QScrollView;
class QGrid;
class TQScrollView;
class TQGrid;
class DataSet;
class DataObject;
class QalculateEditDataSetDialog;
@ -42,17 +42,17 @@ class QalculateDataSetsDialog : public KDialogBase {
public:
QalculateDataSetsDialog(QWidget *parent = 0, const char *name = 0);
QalculateDataSetsDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateDataSetsDialog();
QPushButton *newObjectButton, *editObjectButton, *deleteObjectButton, *newDataSetButton, *editDataSetButton, *deleteDataSetButton;
TQPushButton *newObjectButton, *editObjectButton, *deleteObjectButton, *newDataSetButton, *editDataSetButton, *deleteDataSetButton;
KListView *objectsView, *dataSetsView;
KTextBrowser *descriptionBrowser;
QScrollView *attributesView;
QGrid *attributesGrid;
TQScrollView *attributesView;
TQGrid *attributesGrid;
QMap<QListViewItem*, DataSet*> dataSetItems;
QMap<QListViewItem*, DataObject*> objectItems;
TQMap<TQListViewItem*, DataSet*> dataSetItems;
TQMap<TQListViewItem*, DataObject*> objectItems;
DataSet *selected_dataset;
DataObject *selected_object;
@ -63,8 +63,8 @@ public:
public slots:
void updateDataSetTree();
void dataSetDoubleClicked(QListViewItem*);
void objectDoubleClicked(QListViewItem*);
void dataSetDoubleClicked(TQListViewItem*);
void objectDoubleClicked(TQListViewItem*);
void dataSetSelected();
void objectSelected();
void deleteDataSet();

@ -19,32 +19,32 @@
***************************************************************************/
#include "qalculatedecimalsdialog.h"
#include <qlabel.h>
#include <qspinbox.h>
#include <tqlabel.h>
#include <tqspinbox.h>
#include <klocale.h>
#include <qgrid.h>
#include <tqgrid.h>
QalculateDecimalsDialog::QalculateDecimalsDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Decimals"), Close, Close, true) {
QalculateDecimalsDialog::QalculateDecimalsDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Decimals"), Close, Close, true) {
QGrid *grid = makeGridMainWidget(2, Qt::Horizontal);
TQGrid *grid = makeGridMainWidget(2, TQt::Horizontal);
new QLabel(i18n("Max decimals:"), grid);
new TQLabel(i18n("Max decimals:"), grid);
maxDecimalsBox = new QSpinBox(grid);
maxDecimalsBox->setButtonSymbols(QSpinBox::PlusMinus);
maxDecimalsBox = new TQSpinBox(grid);
maxDecimalsBox->setButtonSymbols(TQSpinBox::PlusMinus);
maxDecimalsBox->setMinValue(-1);
maxDecimalsBox->setValue(-1);
maxDecimalsBox->setSpecialValueText(i18n( "Off" ));
new QLabel(i18n("Min decimals:"), grid);
new TQLabel(i18n("Min decimals:"), grid);
minDecimalsBox = new QSpinBox(grid);
minDecimalsBox->setButtonSymbols(QSpinBox::PlusMinus);
minDecimalsBox = new TQSpinBox(grid);
minDecimalsBox->setButtonSymbols(TQSpinBox::PlusMinus);
minDecimalsBox->setMinValue(0);
minDecimalsBox->setValue(0);
minDecimalsBox->setSpecialValueText(i18n( "Off" ));
resize(QSize(300, minimumSizeHint().height()).expandedTo(minimumSizeHint()));
resize(TQSize(300, minimumSizeHint().height()).expandedTo(minimumSizeHint()));
}

@ -22,7 +22,7 @@
#include <kdialogbase.h>
class QSpinBox;
class TQSpinBox;
/**
@author Niklas Knutsson
@ -33,10 +33,10 @@ class QalculateDecimalsDialog : public KDialogBase {
public:
QalculateDecimalsDialog(QWidget *parent = 0, const char *name = 0);
QalculateDecimalsDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateDecimalsDialog();
QSpinBox *maxDecimalsBox, *minDecimalsBox;
TQSpinBox *maxDecimalsBox, *minDecimalsBox;
};

@ -19,15 +19,15 @@
***************************************************************************/
#include "qalculateeditdataobjectdialog.h"
#include "qalculate_tde_utils.h"
#include <qlabel.h>
#include <qgrid.h>
#include <tqlabel.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <kcombobox.h>
#include <qvaluevector.h>
#include <qstring.h>
#include <tqvaluevector.h>
#include <tqstring.h>
#include <klocale.h>
QalculateEditDataObjectDialog::QalculateEditDataObjectDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Object"), Ok | Cancel, Ok, true) {
QalculateEditDataObjectDialog::QalculateEditDataObjectDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Object"), Ok | Cancel, Ok, true) {
}
@ -42,28 +42,28 @@ DataObject *QalculateEditDataObjectDialog::editDataObject(DataSet *ds, DataObjec
setCaption(i18n("New Object"));
}
QGrid *grid = new QGrid(4, Qt::Horizontal, this);
TQGrid *grid = new TQGrid(4, TQt::Horizontal, this);
grid->setSpacing(spacingHint());
setMainWidget(grid);
new QLabel(i18n("Property"), grid);
new QLabel(i18n("Value"), grid);
new QLabel(grid);
new QLabel(i18n("Approximation"), grid);
new TQLabel(i18n("Property"), grid);
new TQLabel(i18n("Value"), grid);
new TQLabel(grid);
new TQLabel(i18n("Approximation"), grid);
DataPropertyIter it;
DataProperty *dp = ds->getFirstProperty(&it);
string sval;
QValueVector<KLineEdit*> value_entries;
QValueVector<KComboBox*> approx_menus;
TQValueVector<KLineEdit*> value_entries;
TQValueVector<KComboBox*> approx_menus;
string str;
while(dp) {
new QLabel(dp->title().c_str(), grid);
new TQLabel(dp->title().c_str(), grid);
KLineEdit *entry = new KLineEdit(grid);
value_entries.push_back(entry);
int iapprox = -1;
if(o) {
entry->setText(o->getProperty(dp, &iapprox).c_str());
}
new QLabel(dp->getUnitString().c_str(), grid);
new TQLabel(dp->getUnitString().c_str(), grid);
KComboBox *om = new KComboBox(grid);
om->setEditable(false);
om->insertItem(i18n("Default"));
@ -73,7 +73,7 @@ DataObject *QalculateEditDataObjectDialog::editDataObject(DataSet *ds, DataObjec
om->setCurrentItem(iapprox + 1);
dp = ds->getNextProperty(&it);
}
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
bool new_object = (o == NULL);
if(new_object) {
o = new DataObject(ds);
@ -81,7 +81,7 @@ DataObject *QalculateEditDataObjectDialog::editDataObject(DataSet *ds, DataObjec
}
dp = ds->getFirstProperty(&it);
size_t i = 0;
QString val;
TQString val;
while(dp) {
val = value_entries[i]->text().stripWhiteSpace();
if(!val.isEmpty()) {

@ -34,7 +34,7 @@ class QalculateEditDataObjectDialog : public KDialogBase {
public:
QalculateEditDataObjectDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditDataObjectDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditDataObjectDialog();
DataObject *editDataObject(DataSet *ds, DataObject *o = NULL);

@ -21,80 +21,80 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
#include <qgrid.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <kdeversion.h>
#include <qlayout.h>
#include <tqlayout.h>
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
#include <qtextedit.h>
#include <tqtextedit.h>
#else
#include <ktextedit.h>
#endif
#include <klistview.h>
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
#include <qtabwidget.h>
#include <tqtabwidget.h>
#else
#include <ktabwidget.h>
#endif
#include <qapplication.h>
#include <tqapplication.h>
#include <kstdguiitem.h>
extern PrintOptions printops;
extern tree_struct function_cats;
QalculateEditDataSetDialog::QalculateEditDataSetDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Data Set"), Ok | Cancel, Ok, false) {
QalculateEditDataSetDialog::QalculateEditDataSetDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Data Set"), Ok | Cancel, Ok, false) {
names_edit_dialog = NULL;
edited_dataset = NULL;
property_edit_dialog = NULL;
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
tabs = new QTabWidget(this);
tabs = new TQTabWidget(this);
#else
tabs = new KTabWidget(this);
#endif
setMainWidget(tabs);
QWidget *page1 = new QWidget(this);
QWidget *page2 = new QWidget(this);
QWidget *page3 = new QWidget(this);
TQWidget *page1 = new TQWidget(this);
TQWidget *page2 = new TQWidget(this);
TQWidget *page3 = new TQWidget(this);
tabs->addTab(page1, i18n("General"));
tabs->addTab(page2, i18n("Properties"));
tabs->addTab(page3, i18n("Function"));
QGridLayout *grid = new QGridLayout(page1, 1, 1, spacingHint());
grid->addWidget(new QLabel(i18n("Title:"), page1), 0, 0);
TQGridLayout *grid = new TQGridLayout(page1, 1, 1, spacingHint());
grid->addWidget(new TQLabel(i18n("Title:"), page1), 0, 0);
titleEdit = new KLineEdit(page1);
grid->addWidget(titleEdit, 0, 1);
grid->addWidget(new QLabel(i18n("Data file:"), page1), 1, 0);
grid->addWidget(new TQLabel(i18n("Data file:"), page1), 1, 0);
fileEdit = new KLineEdit(page1);
grid->addWidget(fileEdit, 1, 1);
grid->addWidget(new QLabel(i18n("Description:"), page1), 2, 0);
grid->addWidget(new TQLabel(i18n("Description:"), page1), 2, 0);
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
descriptionEdit = new QTextEdit(page1);
descriptionEdit = new TQTextEdit(page1);
#else
descriptionEdit = new KTextEdit(page1);
#endif
descriptionEdit->setTextFormat(QTextEdit::PlainText);
descriptionEdit->setTextFormat(TQTextEdit::PlainText);
grid->addMultiCellWidget(descriptionEdit, 3, 3, 0, 1);
grid->addWidget(new QLabel(i18n("Copyright:"), page1), 4, 0);
grid->addWidget(new TQLabel(i18n("Copyright:"), page1), 4, 0);
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
copyrightEdit = new QTextEdit(page1);
copyrightEdit = new TQTextEdit(page1);
#else
copyrightEdit = new KTextEdit(page1);
#endif
copyrightEdit->setTextFormat(QTextEdit::PlainText);
copyrightEdit->setTextFormat(TQTextEdit::PlainText);
grid->addMultiCellWidget(copyrightEdit, 5, 5, 0, 1);
QVBoxLayout *vbox = new QVBoxLayout(page2, spacingHint());
vbox->addWidget(new QLabel(i18n("Properties:"), page2));
TQVBoxLayout *vbox = new TQVBoxLayout(page2, spacingHint());
vbox->addWidget(new TQLabel(i18n("Properties:"), page2));
propertiesView = new KListView(page2);
propertiesView->addColumn(i18n("Title"));
propertiesView->addColumn(i18n("Name"));
@ -102,41 +102,41 @@ QalculateEditDataSetDialog::QalculateEditDataSetDialog(QWidget *parent, const ch
propertiesView->setSorting(-1);
propertiesView->setRootIsDecorated(false);
vbox->addWidget(propertiesView);
QHBoxLayout *hbox = new QHBoxLayout(vbox, spacingHint());
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
newPropertyButton = new QPushButton(i18n("New"), page2);
TQHBoxLayout *hbox = new TQHBoxLayout(vbox, spacingHint());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
newPropertyButton = new TQPushButton(i18n("New"), page2);
hbox->addWidget(newPropertyButton);
editPropertyButton = new QPushButton(i18n("Edit"), page2);
editPropertyButton = new TQPushButton(i18n("Edit"), page2);
hbox->addWidget(editPropertyButton);
deletePropertyButton = new QPushButton(i18n("Delete"), page2);
deletePropertyButton = new TQPushButton(i18n("Delete"), page2);
hbox->addWidget(deletePropertyButton);
grid = new QGridLayout(page3, 1, 1, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), page3), 0, 0);
grid = new TQGridLayout(page3, 1, 1, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), page3), 0, 0);
nameEdit = new KLineEdit(page3);
grid->addWidget(nameEdit, 0, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(page3);
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(page3);
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), page3);
namesButton = new TQPushButton(i18n("Names Details"), page3);
hbox->addWidget(namesButton);
grid->addWidget(new QLabel(i18n("Object argument name:"), page3), 2, 0);
grid->addWidget(new TQLabel(i18n("Object argument name:"), page3), 2, 0);
objectArgumentEdit = new KLineEdit(page3);
grid->addWidget(objectArgumentEdit, 2, 1);
grid->addWidget(new QLabel(i18n("Property argument name:"), page3), 3, 0);
grid->addWidget(new TQLabel(i18n("Property argument name:"), page3), 3, 0);
propertyArgumentEdit = new KLineEdit(page3);
grid->addWidget(propertyArgumentEdit, 3, 1);
grid->addWidget(new QLabel(i18n("Default property:"), page3), 4, 0);
grid->addWidget(new TQLabel(i18n("Default property:"), page3), 4, 0);
defaultPropertyEdit = new KLineEdit(page3);
grid->addWidget(defaultPropertyEdit, 4, 1);
grid->addItem(new QSpacerItem(5, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
grid->addItem(new TQSpacerItem(5, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
connect(newPropertyButton, SIGNAL(clicked()), this, SLOT(newProperty()));
connect(editPropertyButton, SIGNAL(clicked()), this, SLOT(editProperty()));
connect(deletePropertyButton, SIGNAL(clicked()), this, SLOT(deleteProperty()));
@ -148,7 +148,7 @@ QalculateEditDataSetDialog::~QalculateEditDataSetDialog() {}
void QalculateEditDataSetDialog::propertySelectionChanged() {
QListViewItem *i = propertiesView->selectedItem();
TQListViewItem *i = propertiesView->selectedItem();
if(i) {
editPropertyButton->setEnabled(propertiesItems[i]->isUserModified());
deletePropertyButton->setEnabled(propertiesItems[i]->isUserModified());
@ -163,8 +163,8 @@ void QalculateEditDataSetDialog::updateDatasetPropertyList() {
propertiesItems.clear();
editPropertyButton->setEnabled(false);
deletePropertyButton->setEnabled(false);
QString str;
QListViewItem *i_prev = NULL;
TQString str;
TQListViewItem *i_prev = NULL;
for(size_t i = 0; i < tmp_props.size(); i++) {
if(tmp_props[i]) {
str = "";
@ -195,7 +195,7 @@ void QalculateEditDataSetDialog::updateDatasetPropertyList() {
str += i18n("key");
str += ")";
}
QListViewItem *item = new KListViewItem(propertiesView, i_prev, tmp_props[i]->title(false).c_str(), tmp_props[i]->getName().c_str(), str);
TQListViewItem *item = new KListViewItem(propertiesView, i_prev, tmp_props[i]->title(false).c_str(), tmp_props[i]->getName().c_str(), str);
i_prev = item;
propertiesItems[item] = tmp_props[i];
}
@ -232,7 +232,7 @@ void QalculateEditDataSetDialog::slotOk() {
ds = new DataSet(i18n("Data Sets").ascii(), "", fileEdit->text().ascii(), titleEdit->text().ascii(), descriptionEdit->text().ascii(), true);
add_func = true;
}
QString str2 = objectArgumentEdit->text().stripWhiteSpace();
TQString str2 = objectArgumentEdit->text().stripWhiteSpace();
if(str2.isEmpty()) str2 = i18n("Object");
Argument *arg = ds->getArgumentDefinition(1);
if(arg) {
@ -354,7 +354,7 @@ DataSet *QalculateEditDataSetDialog::editDataSet(DataSet *ds) {
}
updateDatasetPropertyList();
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
ds = edited_dataset;
edited_dataset = NULL;
return ds;
@ -394,7 +394,7 @@ void QalculateEditDataSetDialog::newProperty() {
}
void QalculateEditDataSetDialog::editProperty() {
QListViewItem *i = propertiesView->selectedItem();
TQListViewItem *i = propertiesView->selectedItem();
if(i == NULL) return;
if(!property_edit_dialog) {
property_edit_dialog = new QalculateEditDataPropertyDialog(this);
@ -404,7 +404,7 @@ void QalculateEditDataSetDialog::editProperty() {
}
}
void QalculateEditDataSetDialog::deleteProperty() {
QListViewItem *i = propertiesView->selectedItem();
TQListViewItem *i = propertiesView->selectedItem();
if(i == NULL) return;
if(propertiesItems[i]->isUserModified()) {
for(size_t index = 0; index < tmp_props.size(); index++) {
@ -422,7 +422,7 @@ void QalculateEditDataSetDialog::deleteProperty() {
}
}
void QalculateEditDataSetDialog::nameChanged(const QString &name) {
void QalculateEditDataSetDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->functionNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);
@ -432,54 +432,54 @@ void QalculateEditDataSetDialog::nameChanged(const QString &name) {
}
QalculateEditDataPropertyDialog::QalculateEditDataPropertyDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Property"), Ok | Cancel, Ok, true) {
QalculateEditDataPropertyDialog::QalculateEditDataPropertyDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Property"), Ok | Cancel, Ok, true) {
names_edit_dialog = NULL;
edited_property = NULL;
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), mainWidget()), 0, 0);
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), mainWidget()), 0, 0);
nameEdit = new KLineEdit(mainWidget());
grid->addWidget(nameEdit, 0, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(mainWidget());
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(mainWidget());
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), mainWidget());
namesButton = new TQPushButton(i18n("Names Details"), mainWidget());
hbox->addWidget(namesButton);
grid->addWidget(new QLabel(i18n("Descriptive name:"), mainWidget()), 2, 0);
grid->addWidget(new TQLabel(i18n("Descriptive name:"), mainWidget()), 2, 0);
titleEdit = new KLineEdit(mainWidget());
grid->addWidget(titleEdit, 2, 1);
grid->addWidget(new QLabel(i18n("Description:"), mainWidget()), 3, 0);
grid->addWidget(new TQLabel(i18n("Description:"), mainWidget()), 3, 0);
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
descriptionEdit = new QTextEdit(mainWidget());
descriptionEdit = new TQTextEdit(mainWidget());
#else
descriptionEdit = new KTextEdit(mainWidget());
#endif
descriptionEdit->setTextFormat(QTextEdit::PlainText);
descriptionEdit->setTextFormat(TQTextEdit::PlainText);
grid->addMultiCellWidget(descriptionEdit, 4, 4, 0, 1);
grid->addWidget(new QLabel(i18n("Value type:"), mainWidget()), 5, 0);
grid->addWidget(new TQLabel(i18n("Value type:"), mainWidget()), 5, 0);
typeCombo = new KComboBox(mainWidget());
typeCombo->setEditable(false);
typeCombo->insertItem(i18n("Text"));
typeCombo->insertItem(i18n("Number"));
typeCombo->insertItem(i18n("Expression"));
grid->addWidget(typeCombo, 5, 1);
hideButton = new QCheckBox(i18n("Hide"), mainWidget());
hideButton = new TQCheckBox(i18n("Hide"), mainWidget());
grid->addWidget(hideButton, 6, 0);
//Use as a unique data set key
keyButton = new QCheckBox(i18n("Use as key"), mainWidget());
keyButton = new TQCheckBox(i18n("Use as key"), mainWidget());
grid->addWidget(keyButton, 6, 1);
approximateButton = new QCheckBox(i18n("Approximate value"), mainWidget());
approximateButton = new TQCheckBox(i18n("Approximate value"), mainWidget());
grid->addWidget(approximateButton, 7, 0);
caseButton = new QCheckBox(i18n("Case sensitive value"), mainWidget());
caseButton = new TQCheckBox(i18n("Case sensitive value"), mainWidget());
grid->addWidget(caseButton, 7, 1);
bracketsButton = new QCheckBox(i18n("Value uses brackets"), mainWidget());
bracketsButton = new TQCheckBox(i18n("Value uses brackets"), mainWidget());
grid->addWidget(bracketsButton, 8, 0);
grid->addWidget(new QLabel(i18n("Unit expression:"), mainWidget()), 9, 0);
grid->addWidget(new TQLabel(i18n("Unit expression:"), mainWidget()), 9, 0);
unitEdit = new KLineEdit(mainWidget());
grid->addWidget(unitEdit, 9, 1);
@ -554,7 +554,7 @@ bool QalculateEditDataPropertyDialog::editDataProperty(DataProperty *dp, bool ne
nameEdit->setText(dp->getName().c_str());
if(dp->countNames() > 1) {
QString str = "+ ";
TQString str = "+ ";
for(size_t i = 2; i <= dp->countNames(); i++) {
if(i > 2) str += ", ";
str += dp->getName(i).c_str();
@ -590,7 +590,7 @@ bool QalculateEditDataPropertyDialog::editDataProperty(DataProperty *dp, bool ne
}
}
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
edited_property = NULL;
return true;
}
@ -610,28 +610,28 @@ void QalculateEditDataPropertyDialog::editNames() {
}
QalculateEditDataPropertyNamesDialog::QalculateEditDataPropertyNamesDialog(QWidget *parent, const char *name) : KDialog(parent, name, true) {
QalculateEditDataPropertyNamesDialog::QalculateEditDataPropertyNamesDialog(TQWidget *parent, const char *name) : KDialog(parent, name, true) {
setCaption(i18n("Edit Names"));
QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint());
TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint());
namesView = new KListView(this);
namesView->addColumn(i18n("Name"));
namesView->addColumn(i18n("Reference"));
namesView->setColumnAlignment(1, Qt::AlignCenter);
namesView->setColumnAlignment(1, TQt::AlignCenter);
namesView->setSorting(-1);
namesView->setItemsRenameable(true);
namesView->setItemsMovable(true);
layout->addWidget(namesView);
QHBoxLayout *buttonLayout = new QHBoxLayout(layout, spacingHint());
newButton = new QPushButton(i18n("New"), this);
TQHBoxLayout *buttonLayout = new TQHBoxLayout(layout, spacingHint());
newButton = new TQPushButton(i18n("New"), this);
buttonLayout->addWidget(newButton);
deleteButton = new QPushButton(i18n("Delete"), this);
deleteButton = new TQPushButton(i18n("Delete"), this);
deleteButton->setEnabled(false);
buttonLayout->addWidget(deleteButton);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
buttonLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
buttonClose = new KPushButton(KStdGuiItem::close(), this);
buttonClose->setAutoDefault(true);
buttonClose->setDefault(true);
@ -641,7 +641,7 @@ QalculateEditDataPropertyNamesDialog::QalculateEditDataPropertyNamesDialog(QWidg
connect(buttonClose, SIGNAL(clicked()), this, SLOT(accept()));
connect(newButton, SIGNAL(clicked()), this, SLOT(newName()));
connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteName()));
connect(namesView, SIGNAL(clicked(QListViewItem*, const QPoint&, int)), this, SLOT(itemClicked(QListViewItem*, const QPoint&, int)));
connect(namesView, SIGNAL(clicked(TQListViewItem*, const TQPoint&, int)), this, SLOT(itemClicked(TQListViewItem*, const TQPoint&, int)));
}
@ -649,22 +649,22 @@ QalculateEditDataPropertyNamesDialog::~QalculateEditDataPropertyNamesDialog() {}
void QalculateEditDataPropertyNamesDialog::newName() {
ExpressionName name;
QListViewItem *i = new KListViewItem(namesView, namesView->lastChild(), "", i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"));
TQListViewItem *i = new KListViewItem(namesView, namesView->lastChild(), "", i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"));
namesView->setSelected(i, true);
qApp->processEvents();
tqApp->processEvents();
namesView->rename(i, 0);
}
void QalculateEditDataPropertyNamesDialog::setNames(DataProperty *item, const QString &namestr, bool names_edited) {
void QalculateEditDataPropertyNamesDialog::setNames(DataProperty *item, const TQString &namestr, bool names_edited) {
if(!names_edited) {
deleteButton->setEnabled(false);
namesView->clear();
}
if(!names_edited && item && item->countNames() > 0) {
QListViewItem *i_prev = NULL;
TQListViewItem *i_prev = NULL;
for(size_t index = 1; index <= item->countNames(); index++) {
QListViewItem *i = new KListViewItem(namesView, i_prev);
TQListViewItem *i = new KListViewItem(namesView, i_prev);
i_prev = i;
if(item->nameIsReference(index))
i->setText(1, i18n("Yes"));
@ -678,7 +678,7 @@ void QalculateEditDataPropertyNamesDialog::setNames(DataProperty *item, const QS
}
} else if(!namestr.isEmpty()) {
if(names_edited) {
QListViewItemIterator it(namesView);
TQListViewItemIterator it(namesView);
if(it.current())
it.current()->setText(0, namestr);
} else {
@ -686,9 +686,9 @@ void QalculateEditDataPropertyNamesDialog::setNames(DataProperty *item, const QS
}
}
}
void QalculateEditDataPropertyNamesDialog::saveNames(DataProperty *item, const QString &str) {
void QalculateEditDataPropertyNamesDialog::saveNames(DataProperty *item, const TQString &str) {
item->clearNames();
QListViewItemIterator it(namesView);
TQListViewItemIterator it(namesView);
if(it.current()) {
bool b = false;
while(it.current()) {
@ -704,10 +704,10 @@ void QalculateEditDataPropertyNamesDialog::saveNames(DataProperty *item, const Q
item->addName(str.ascii());
}
}
void QalculateEditDataPropertyNamesDialog::setNamesLE(QLineEdit *entry, QLabel *label) {
void QalculateEditDataPropertyNamesDialog::setNamesLE(TQLineEdit *entry, TQLabel *label) {
int index = 0;
QString str;
QListViewItemIterator it(namesView);
TQString str;
TQListViewItemIterator it(namesView);
while(it.current()) {
if(index == 0) {
entry->setText(it.current()->text(0));
@ -732,7 +732,7 @@ void QalculateEditDataPropertyNamesDialog::deleteName() {
namesView->removeItem(namesView->selectedItem());
}
void QalculateEditDataPropertyNamesDialog::itemClicked(QListViewItem *i, const QPoint &, int c) {
void QalculateEditDataPropertyNamesDialog::itemClicked(TQListViewItem *i, const TQPoint &, int c) {
if(i && c > 0) {
if(i->text(c) == i18n("Yes"))
i->setText(c, i18n("No"));

@ -21,24 +21,24 @@
#define QALCULATEEDITDATASETDIALOG_H
#include <kdialogbase.h>
#include <qmap.h>
#include <qvaluevector.h>
#include <tqmap.h>
#include <tqvaluevector.h>
class KLineEdit;
class QCheckBox;
class TQCheckBox;
class KComboBox;
class QPushButton;
class TQPushButton;
class MathStructure;
class QalculateEditNamesDialog;
class DataSet;
class KListView;
class QTextEdit;
class TQTextEdit;
class DataProperty;
class QTabWidget;
class TQTabWidget;
class UserFunction;
class QalculateEditDataPropertyDialog;
class QalculateEditDataPropertyNamesDialog;
class QLineEdit;
class TQLineEdit;
/**
@author Niklas Knutsson
@ -49,7 +49,7 @@ class QalculateEditDataSetDialog : public KDialogBase {
public:
QalculateEditDataSetDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditDataSetDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditDataSetDialog();
DataSet *editDataSet(DataSet *ds = NULL);
@ -59,14 +59,14 @@ public:
QalculateEditDataPropertyDialog *property_edit_dialog;
DataSet *edited_dataset;
KLineEdit *objectArgumentEdit, *propertyArgumentEdit, *defaultPropertyEdit, *nameEdit, *titleEdit, *fileEdit;
QLabel *namesLabel;
TQLabel *namesLabel;
KListView *propertiesView;
QTextEdit *descriptionEdit, *copyrightEdit;
QPushButton *namesButton, *newPropertyButton, *editPropertyButton, *deletePropertyButton;
QTabWidget *tabs;
QMap<QListViewItem*, DataProperty*> propertiesItems;
QValueVector<DataProperty*> tmp_props;
QValueVector<DataProperty*> tmp_props_orig;
TQTextEdit *descriptionEdit, *copyrightEdit;
TQPushButton *namesButton, *newPropertyButton, *editPropertyButton, *deletePropertyButton;
TQTabWidget *tabs;
TQMap<TQListViewItem*, DataProperty*> propertiesItems;
TQValueVector<DataProperty*> tmp_props;
TQValueVector<DataProperty*> tmp_props_orig;
public slots:
@ -75,7 +75,7 @@ public slots:
void newProperty();
void editProperty();
void deleteProperty();
void nameChanged(const QString&);
void nameChanged(const TQString&);
protected slots:
@ -89,7 +89,7 @@ class QalculateEditDataPropertyDialog : public KDialogBase {
public:
QalculateEditDataPropertyDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditDataPropertyDialog(TQWidget *parent = 0, const char *name = 0);
~QalculateEditDataPropertyDialog();
bool editDataProperty(DataProperty *dp, bool newdp = false);
@ -98,10 +98,10 @@ public:
DataProperty *edited_property;
KComboBox *typeCombo;
KLineEdit *nameEdit, *titleEdit, *unitEdit;
QLabel *namesLabel;
QCheckBox *hideButton, *keyButton, *approximateButton, *caseButton, *bracketsButton;
QPushButton *namesButton;
QTextEdit *descriptionEdit;
TQLabel *namesLabel;
TQCheckBox *hideButton, *keyButton, *approximateButton, *caseButton, *bracketsButton;
TQPushButton *namesButton;
TQTextEdit *descriptionEdit;
public slots:
@ -119,23 +119,23 @@ class QalculateEditDataPropertyNamesDialog : public KDialog {
public:
QalculateEditDataPropertyNamesDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditDataPropertyNamesDialog(TQWidget *parent = 0, const char *name = 0);
~QalculateEditDataPropertyNamesDialog();
void saveNames(DataProperty *item, const QString &str = QString::null);
void setNames(DataProperty *item = NULL, const QString &namestr = QString::null, bool names_edited = false);
void saveNames(DataProperty *item, const TQString &str = TQString::null);
void setNames(DataProperty *item = NULL, const TQString &namestr = TQString::null, bool names_edited = false);
bool isEmpty();
void setNamesLE(QLineEdit *entry, QLabel *label);
void setNamesLE(TQLineEdit *entry, TQLabel *label);
KListView* namesView;
QPushButton* newButton;
QPushButton* deleteButton;
QPushButton* buttonClose;
TQPushButton* newButton;
TQPushButton* deleteButton;
TQPushButton* buttonClose;
int i_type;
public slots:
void itemClicked(QListViewItem*, const QPoint&, int);
void itemClicked(TQListViewItem*, const TQPoint&, int);
void newName();
void deleteName();
void nameSelectionChanged();

@ -21,30 +21,30 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
#include <qgrid.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <kdeversion.h>
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
#include <qtextedit.h>
#include <tqtextedit.h>
#else
#include <ktextedit.h>
#endif
#include <klistview.h>
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
#include <qtabwidget.h>
#include <tqtabwidget.h>
#else
#include <ktabwidget.h>
#endif
#include <qheader.h>
#include <tqheader.h>
#include <kapplication.h>
#include <kstdguiitem.h>
@ -52,7 +52,7 @@ extern PrintOptions printops;
extern EvaluationOptions evalops;
extern tree_struct function_cats;
QalculateEditFunctionDialog::QalculateEditFunctionDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Function"), Ok | Cancel | Help, Ok, false) {
QalculateEditFunctionDialog::QalculateEditFunctionDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Function"), Ok | Cancel | Help, Ok, false) {
names_edit_dialog = NULL;
subfunctions_edit_dialog = NULL;
@ -60,66 +60,66 @@ QalculateEditFunctionDialog::QalculateEditFunctionDialog(QWidget *parent, const
argument_edit_dialog = NULL;
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
tabs = new QTabWidget(this);
tabs = new TQTabWidget(this);
#else
tabs = new KTabWidget(this);
#endif
setMainWidget(tabs);
QWidget *page1 = new QWidget(this);
QWidget *page2 = new QWidget(this);
TQWidget *page1 = new TQWidget(this);
TQWidget *page2 = new TQWidget(this);
tabs->addTab(page1, i18n("General"));
tabs->addTab(page2, i18n("Function"));
QGridLayout *grid = new QGridLayout(page1, 1, 1, spacingHint());
QVBoxLayout *vbox = new QVBoxLayout(page2, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), page1), 0, 0);
TQGridLayout *grid = new TQGridLayout(page1, 1, 1, spacingHint());
TQVBoxLayout *vbox = new TQVBoxLayout(page2, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), page1), 0, 0);
nameEdit = new KLineEdit(page1);
grid->addWidget(nameEdit, 0, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(page1);
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(page1);
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), page1);
namesButton = new TQPushButton(i18n("Names Details"), page1);
hbox->addWidget(namesButton);
grid->addWidget(new QLabel(i18n("Category:"), page1), 2, 0);
grid->addWidget(new TQLabel(i18n("Category:"), page1), 2, 0);
categoryCombo = new KComboBox(page1);
categoryCombo->setMaximumWidth(250);
categoryCombo->setEditable(true);
grid->addWidget(categoryCombo, 2, 1);
grid->addWidget(new QLabel(i18n("Descriptive name:"), page1), 3, 0);
grid->addWidget(new TQLabel(i18n("Descriptive name:"), page1), 3, 0);
titleEdit = new KLineEdit(page1);
grid->addWidget(titleEdit, 3, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 4, 4, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
hideButton = new QCheckBox(i18n("Hide function"), page1);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
hideButton = new TQCheckBox(i18n("Hide function"), page1);
hbox->addWidget(hideButton);
grid->addWidget(new QLabel(i18n("Description:"), page1), 5, 0);
grid->addWidget(new TQLabel(i18n("Description:"), page1), 5, 0);
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
descriptionEdit = new QTextEdit(page1);
descriptionEdit = new TQTextEdit(page1);
#else
descriptionEdit = new KTextEdit(page1);
#endif
descriptionEdit->setTextFormat(QTextEdit::PlainText);
descriptionEdit->setTextFormat(TQTextEdit::PlainText);
grid->addMultiCellWidget(descriptionEdit, 6, 6, 0, 1);
vbox->addWidget(new QLabel(i18n("Expression:"), page2));
vbox->addWidget(new TQLabel(i18n("Expression:"), page2));
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 1
expressionEdit = new QTextEdit(page2);
expressionEdit = new TQTextEdit(page2);
#else
expressionEdit = new KTextEdit(page2);
#endif
expressionEdit->setTextFormat(QTextEdit::PlainText);
expressionEdit->setTextFormat(TQTextEdit::PlainText);
vbox->addWidget(expressionEdit);
hbox = new QHBoxLayout(vbox, spacingHint());
hbox->addWidget(new QLabel(i18n("Condition:"), page2));
hbox = new TQHBoxLayout(vbox, spacingHint());
hbox->addWidget(new TQLabel(i18n("Condition:"), page2));
conditionEdit = new KLineEdit(page2);
hbox->addWidget(conditionEdit);
hbox = new QHBoxLayout(vbox, spacingHint());
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
subFunctionsButton = new QPushButton(i18n("Sub-Functions"), page2);
hbox = new TQHBoxLayout(vbox, spacingHint());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
subFunctionsButton = new TQPushButton(i18n("Sub-Functions"), page2);
hbox->addWidget(subFunctionsButton);
vbox->addWidget(new QLabel(i18n("Arguments:"), page2));
vbox->addWidget(new TQLabel(i18n("Arguments:"), page2));
argumentsView = new KListView(page2);
argumentsView->addColumn(i18n("Name"));
argumentsView->addColumn(i18n("Type"));
@ -128,22 +128,22 @@ QalculateEditFunctionDialog::QalculateEditFunctionDialog(QWidget *parent, const
argumentsView->setItemsRenameable(true);
argumentsView->setItemsMovable(false);
vbox->addWidget(argumentsView);
hbox = new QHBoxLayout(vbox, spacingHint());
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
newArgumentButton = new QPushButton(i18n("New"), page2);
hbox = new TQHBoxLayout(vbox, spacingHint());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
newArgumentButton = new TQPushButton(i18n("New"), page2);
hbox->addWidget(newArgumentButton);
editArgumentButton = new QPushButton(i18n("Edit"), page2);
editArgumentButton = new TQPushButton(i18n("Edit"), page2);
hbox->addWidget(editArgumentButton);
deleteArgumentButton = new QPushButton(i18n("Delete"), page2);
deleteArgumentButton = new TQPushButton(i18n("Delete"), page2);
hbox->addWidget(deleteArgumentButton);
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(subFunctionsButton, SIGNAL(clicked()), this, SLOT(editSubFunctions()));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
connect(newArgumentButton, SIGNAL(clicked()), this, SLOT(newArgument()));
connect(editArgumentButton, SIGNAL(clicked()), this, SLOT(editArgument()));
connect(deleteArgumentButton, SIGNAL(clicked()), this, SLOT(deleteArgument()));
connect(argumentsView, SIGNAL(itemRenamed(QListViewItem*, const QString&, int)), this, SLOT(argumentRenamed(QListViewItem*, const QString&, int)));
connect(argumentsView, SIGNAL(itemRenamed(TQListViewItem*, const TQString&, int)), this, SLOT(argumentRenamed(TQListViewItem*, const TQString&, int)));
connect(argumentsView, SIGNAL(selectionChanged()), this, SLOT(argumentSelectionChanged()));
}
@ -156,7 +156,7 @@ void QalculateEditFunctionDialog::slotHelp() {
}
void QalculateEditFunctionDialog::argumentSelectionChanged() {
QListViewItem *i = argumentsView->selectedItem();
TQListViewItem *i = argumentsView->selectedItem();
if(i == NULL || (edited_function && edited_function->isBuiltin()) || argumentsItems[i]->type() > ARGUMENT_TYPE_ANGLE) {
editArgumentButton->setEnabled(false);
deleteArgumentButton->setEnabled(false);
@ -165,7 +165,7 @@ void QalculateEditFunctionDialog::argumentSelectionChanged() {
deleteArgumentButton->setEnabled(true);
}
}
void QalculateEditFunctionDialog::argumentRenamed(QListViewItem *i, const QString &str, int col) {
void QalculateEditFunctionDialog::argumentRenamed(TQListViewItem *i, const TQString &str, int col) {
if(!i || col != 0) return;
if(col == 0) {
if(!argumentsItemsEdited[i]) {
@ -220,7 +220,7 @@ void QalculateEditFunctionDialog::slotOk() {
}
f->setCondition(CALCULATOR->unlocalizeExpression(conditionEdit->text().ascii(), evalops.parse_options));
size_t index = 1;
QListViewItemIterator it(argumentsView);
TQListViewItemIterator it(argumentsView);
while(it.current()) {
if(argumentsItemsEdited[it.current()]) {
if(f->isBuiltin() && f->getArgumentDefinition(index)) {
@ -267,7 +267,7 @@ void QalculateEditFunctionDialog::slotOk() {
}
MathFunction *QalculateEditFunctionDialog::editFunction(QString category, MathFunction *f) {
MathFunction *QalculateEditFunctionDialog::editFunction(TQString category, MathFunction *f) {
nameEdit->setFocus();
@ -290,7 +290,7 @@ MathFunction *QalculateEditFunctionDialog::editFunction(QString category, MathFu
setCaption(i18n("New Function"));
}
QString catstr;
TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
function_cats.it = function_cats.items.begin();
@ -364,8 +364,8 @@ MathFunction *QalculateEditFunctionDialog::editFunction(QString category, MathFu
if(args < 0) {
args = f->minargs() + 1;
}
QString str, str2;
QListViewItem *i_prev = NULL;
TQString str, str2;
TQListViewItem *i_prev = NULL;
for(int i = 1; i <= args; i++) {
arg = f->getArgumentDefinition(i);
if(arg) {
@ -377,7 +377,7 @@ MathFunction *QalculateEditFunctionDialog::editFunction(QString category, MathFu
str = defarg.printlong().c_str();
str2 = "";
}
QListViewItem *i_new = new KListViewItem(argumentsView, i_prev, str2, str);
TQListViewItem *i_new = new KListViewItem(argumentsView, i_prev, str2, str);
i_prev = i_new;
argumentsItems[i_new] = arg;
argumentsItemsEdited[i_new] = false;
@ -385,12 +385,12 @@ MathFunction *QalculateEditFunctionDialog::editFunction(QString category, MathFu
}
argumentsView->setResizeMode(KListView::AllColumns);
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
f = edited_function;
edited_function = NULL;
return f;
}
QListViewItemIterator it(argumentsView);
TQListViewItemIterator it(argumentsView);
while(it.current()) {
if(argumentsItemsEdited[it.current()]) {
delete argumentsItems[it.current()];
@ -419,13 +419,13 @@ void QalculateEditFunctionDialog::newArgument() {
}
Argument *arg = argument_edit_dialog->editArgument();
if(arg) {
QListViewItem *i = new KListViewItem(argumentsView, argumentsView->lastChild(), arg->name().c_str(), arg->printlong().c_str());
TQListViewItem *i = new KListViewItem(argumentsView, argumentsView->lastChild(), arg->name().c_str(), arg->printlong().c_str());
argumentsItems[i] = arg;
argumentsItemsEdited[i] = true;
}
}
void QalculateEditFunctionDialog::editArgument() {
QListViewItem *i = argumentsView->selectedItem();
TQListViewItem *i = argumentsView->selectedItem();
if(i == NULL) return;
if(!argument_edit_dialog) {
argument_edit_dialog = new QalculateEditArgumentDialog(this);
@ -442,7 +442,7 @@ void QalculateEditFunctionDialog::editArgument() {
}
}
void QalculateEditFunctionDialog::deleteArgument() {
QListViewItem *i = argumentsView->selectedItem();
TQListViewItem *i = argumentsView->selectedItem();
if(i == NULL) return;
if(argumentsItemsEdited[i]) {
delete argumentsItems[i];
@ -462,7 +462,7 @@ void QalculateEditFunctionDialog::editSubFunctions() {
subfunctions_edit_dialog->exec();
}
void QalculateEditFunctionDialog::nameChanged(const QString &name) {
void QalculateEditFunctionDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->functionNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);
@ -471,11 +471,11 @@ void QalculateEditFunctionDialog::nameChanged(const QString &name) {
}
}
QalculateEditSubFunctionsDialog::QalculateEditSubFunctionsDialog(QWidget *parent, const char *name) : KDialog(parent, name, true) {
QalculateEditSubFunctionsDialog::QalculateEditSubFunctionsDialog(TQWidget *parent, const char *name) : KDialog(parent, name, true) {
setCaption(i18n("Sub-Functions"));
QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint());
TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint());
subFunctionsView = new KListView(this);
subFunctionsView->addColumn(i18n("Reference"));
@ -488,13 +488,13 @@ QalculateEditSubFunctionsDialog::QalculateEditSubFunctionsDialog(QWidget *parent
subFunctionsView->setItemsMovable(false);
layout->addWidget(subFunctionsView);
QHBoxLayout *buttonLayout = new QHBoxLayout(layout, spacingHint());
newButton = new QPushButton(i18n("New"), this);
TQHBoxLayout *buttonLayout = new TQHBoxLayout(layout, spacingHint());
newButton = new TQPushButton(i18n("New"), this);
buttonLayout->addWidget(newButton);
deleteButton = new QPushButton(i18n("Delete"), this);
deleteButton = new TQPushButton(i18n("Delete"), this);
deleteButton->setEnabled(false);
buttonLayout->addWidget(deleteButton);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
buttonLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
buttonClose = new KPushButton(KStdGuiItem::close(), this);
buttonClose->setAutoDefault(true);
buttonClose->setDefault(true);
@ -504,18 +504,18 @@ QalculateEditSubFunctionsDialog::QalculateEditSubFunctionsDialog(QWidget *parent
connect(buttonClose, SIGNAL(clicked()), this, SLOT(accept()));
connect(newButton, SIGNAL(clicked()), this, SLOT(newSubFunction()));
connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteSubFunction()));
connect(subFunctionsView, SIGNAL(clicked(QListViewItem*, const QPoint&, int)), this, SLOT(itemClicked(QListViewItem*, const QPoint&, int)));
connect(subFunctionsView, SIGNAL(clicked(TQListViewItem*, const TQPoint&, int)), this, SLOT(itemClicked(TQListViewItem*, const TQPoint&, int)));
}
QalculateEditSubFunctionsDialog::~QalculateEditSubFunctionsDialog() {}
void QalculateEditSubFunctionsDialog::newSubFunction() {
ExpressionName name;
QString str = "\\";
str += QString::number(subFunctionsView->childCount() + 1);
QListViewItem *i = new KListViewItem(subFunctionsView, subFunctionsView->lastChild(), str, "", i18n("Yes"));
TQString str = "\\";
str += TQString::number(subFunctionsView->childCount() + 1);
TQListViewItem *i = new KListViewItem(subFunctionsView, subFunctionsView->lastChild(), str, "", i18n("Yes"));
subFunctionsView->setSelected(i, true);
qApp->processEvents();
tqApp->processEvents();
subFunctionsView->rename(i, 1);
}
@ -525,12 +525,12 @@ void QalculateEditSubFunctionsDialog::setSubFunctions(UserFunction *f, bool edit
subFunctionsView->clear();
}
if(!edited && f && f->countSubfunctions() > 0) {
QListViewItem *i_prev = NULL;
TQListViewItem *i_prev = NULL;
for(size_t index = 1; index <= f->countSubfunctions(); index++) {
QListViewItem *i = new KListViewItem(subFunctionsView, i_prev);
TQListViewItem *i = new KListViewItem(subFunctionsView, i_prev);
i_prev = i;
QString str = "\\";
str += QString::number(index);
TQString str = "\\";
str += TQString::number(index);
i->setText(0, str);
i->setText(1, f->getSubfunction(index).c_str());
if(f->subfunctionPrecalculated(index)) i->setText(2, i18n("Yes"));
@ -540,7 +540,7 @@ void QalculateEditSubFunctionsDialog::setSubFunctions(UserFunction *f, bool edit
}
void QalculateEditSubFunctionsDialog::saveSubFunctions(UserFunction *f) {
f->clearSubfunctions();
QListViewItemIterator it(subFunctionsView);
TQListViewItemIterator it(subFunctionsView);
while(it.current()) {
f->addSubfunction(it.current()->text(1).ascii(), it.current()->text(2) == i18n("Yes"));
++it;
@ -552,18 +552,18 @@ bool QalculateEditSubFunctionsDialog::isEmpty() {
void QalculateEditSubFunctionsDialog::deleteSubFunction() {
subFunctionsView->removeItem(subFunctionsView->selectedItem());
QListViewItemIterator it(subFunctionsView);
TQListViewItemIterator it(subFunctionsView);
int index = 1;
while(it.current()) {
QString str = "\\";
str += QString::number(index);
TQString str = "\\";
str += TQString::number(index);
it.current()->setText(0, str);
++it;
index++;
}
}
void QalculateEditSubFunctionsDialog::itemClicked(QListViewItem *i, const QPoint &, int c) {
void QalculateEditSubFunctionsDialog::itemClicked(TQListViewItem *i, const TQPoint &, int c) {
if(i && c == 2) {
if(i->text(c) == i18n("Yes"))
i->setText(c, i18n("No"));
@ -576,14 +576,14 @@ void QalculateEditSubFunctionsDialog::selectionChanged() {
deleteButton->setEnabled(subFunctionsView->selectedItem() != NULL);
}
QalculateEditArgumentDialog::QalculateEditArgumentDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Argument"), Ok | Cancel, Ok, true) {
QalculateEditArgumentDialog::QalculateEditArgumentDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Argument"), Ok | Cancel, Ok, true) {
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), mainWidget()), 0, 0);
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), mainWidget()), 0, 0);
nameEdit = new KLineEdit(mainWidget());
grid->addWidget(nameEdit, 0, 1);
grid->addWidget(new QLabel(i18n("Type:"), mainWidget()), 1, 0);
grid->addWidget(new TQLabel(i18n("Type:"), mainWidget()), 1, 0);
typeCombo = new KComboBox(mainWidget());
typeCombo->setEditable(false);
typeCombo->insertItem(i18n("Free"));
@ -602,35 +602,35 @@ QalculateEditArgumentDialog::QalculateEditArgumentDialog(QWidget *parent, const
typeCombo->insertItem(i18n("File"));
typeCombo->insertItem(i18n("Angle"));
grid->addWidget(typeCombo, 1, 1);
testButton = new QCheckBox(i18n("Enable rules and type test"), mainWidget());
testButton = new TQCheckBox(i18n("Enable rules and type test"), mainWidget());
grid->addMultiCellWidget(testButton, 2, 2, 0, 1);
conditionButton = new QCheckBox(i18n("Custom condition:"), mainWidget());
conditionButton = new TQCheckBox(i18n("Custom condition:"), mainWidget());
grid->addWidget(conditionButton, 3, 0);
conditionEdit = new KLineEdit(mainWidget());
grid->addWidget(conditionEdit, 3, 1);
matrixButton = new QCheckBox(i18n("Allow matrix"), mainWidget());
matrixButton = new TQCheckBox(i18n("Allow matrix"), mainWidget());
grid->addMultiCellWidget(matrixButton, 4, 4, 0, 1);
zeroButton = new QCheckBox(i18n("Forbid zero"), mainWidget());
zeroButton = new TQCheckBox(i18n("Forbid zero"), mainWidget());
grid->addMultiCellWidget(zeroButton, 5, 5, 0, 1);
complexButton = new QCheckBox(i18n("Allow complex"), mainWidget());
complexButton = new TQCheckBox(i18n("Allow complex"), mainWidget());
grid->addMultiCellWidget(complexButton, 6, 6, 0, 1);
minButton = new QCheckBox(i18n("Min:"), mainWidget());
minButton = new TQCheckBox(i18n("Min:"), mainWidget());
grid->addWidget(minButton, 7, 0);
minEdit = new KLineEdit(mainWidget());
grid->addWidget(minEdit, 7, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 8, 8, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
minIncludeEqualsButton = new QCheckBox(i18n("Include equals"), mainWidget());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
minIncludeEqualsButton = new TQCheckBox(i18n("Include equals"), mainWidget());
hbox->addWidget(minIncludeEqualsButton);
maxButton = new QCheckBox(i18n("Max:"), mainWidget());
maxButton = new TQCheckBox(i18n("Max:"), mainWidget());
grid->addWidget(maxButton, 9, 0);
maxEdit = new KLineEdit(mainWidget());
grid->addWidget(maxEdit, 9, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 10, 10, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
maxIncludeEqualsButton = new QCheckBox(i18n("Include equals"), mainWidget());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
maxIncludeEqualsButton = new TQCheckBox(i18n("Include equals"), mainWidget());
hbox->addWidget(maxIncludeEqualsButton);
connect(conditionButton, SIGNAL(toggled(bool)), conditionEdit, SLOT(setEnabled(bool)));
@ -738,7 +738,7 @@ Argument *QalculateEditArgumentDialog::editArgument(Argument *arg) {
}
typeChanged(typeCombo->currentItem());
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
switch(typeCombo->currentItem()) {
case 1: {
arg = new NumberArgument();

@ -21,22 +21,22 @@
#define QALCULATEEDITFUNCTIONDIALOG_H
#include <kdialogbase.h>
#include <qmap.h>
#include <tqmap.h>
class QLabel;
class TQLabel;
class KComboBox;
class KLineEdit;
class QCheckBox;
class QPushButton;
class TQCheckBox;
class TQPushButton;
class MathStructure;
class QalculateEditNamesDialog;
class QalculateEditSubFunctionsDialog;
class QalculateEditArgumentDialog;
class MathFunction;
class KListView;
class QTextEdit;
class TQTextEdit;
class Argument;
class QTabWidget;
class TQTabWidget;
class UserFunction;
/**
@ -48,10 +48,10 @@ class QalculateEditFunctionDialog : public KDialogBase {
public:
QalculateEditFunctionDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditFunctionDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditFunctionDialog();
MathFunction *editFunction(QString category = QString::null, MathFunction *f = NULL);
MathFunction *editFunction(TQString category = TQString::null, MathFunction *f = NULL);
QalculateEditNamesDialog *names_edit_dialog;
QalculateEditSubFunctionsDialog *subfunctions_edit_dialog;
@ -59,25 +59,25 @@ public:
MathFunction *edited_function;
KComboBox *categoryCombo;
KLineEdit *conditionEdit, *nameEdit, *titleEdit;
QLabel *namesLabel;
QCheckBox *hideButton;
TQLabel *namesLabel;
TQCheckBox *hideButton;
KListView *argumentsView;
QTextEdit *descriptionEdit, *expressionEdit;
QPushButton *namesButton, *subFunctionsButton, *newArgumentButton, *editArgumentButton, *deleteArgumentButton;
QTabWidget *tabs;
QMap<QListViewItem*, Argument*> argumentsItems;
QMap<QListViewItem*, bool> argumentsItemsEdited;
TQTextEdit *descriptionEdit, *expressionEdit;
TQPushButton *namesButton, *subFunctionsButton, *newArgumentButton, *editArgumentButton, *deleteArgumentButton;
TQTabWidget *tabs;
TQMap<TQListViewItem*, Argument*> argumentsItems;
TQMap<TQListViewItem*, bool> argumentsItemsEdited;
public slots:
void argumentSelectionChanged();
void argumentRenamed(QListViewItem*, const QString&, int);
void argumentRenamed(TQListViewItem*, const TQString&, int);
void editNames();
void newArgument();
void editArgument();
void deleteArgument();
void editSubFunctions();
void nameChanged(const QString&);
void nameChanged(const TQString&);
protected slots:
@ -92,7 +92,7 @@ class QalculateEditSubFunctionsDialog : public KDialog {
public:
QalculateEditSubFunctionsDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditSubFunctionsDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditSubFunctionsDialog();
void saveSubFunctions(UserFunction *f);
@ -100,13 +100,13 @@ public:
bool isEmpty();
KListView* subFunctionsView;
QPushButton* newButton;
QPushButton* deleteButton;
QPushButton* buttonClose;
TQPushButton* newButton;
TQPushButton* deleteButton;
TQPushButton* buttonClose;
public slots:
void itemClicked(QListViewItem*, const QPoint&, int);
void itemClicked(TQListViewItem*, const TQPoint&, int);
void newSubFunction();
void deleteSubFunction();
void selectionChanged();
@ -119,14 +119,14 @@ class QalculateEditArgumentDialog : public KDialogBase {
public:
QalculateEditArgumentDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditArgumentDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditArgumentDialog();
Argument *editArgument(Argument *arg = NULL);
KComboBox *typeCombo;
KLineEdit *nameEdit, *conditionEdit, *maxEdit, *minEdit;
QCheckBox *conditionButton, *matrixButton, *zeroButton, *complexButton, *maxButton, *minButton, *maxIncludeEqualsButton, *minIncludeEqualsButton, *testButton;
TQCheckBox *conditionButton, *matrixButton, *zeroButton, *complexButton, *maxButton, *minButton, *maxIncludeEqualsButton, *minIncludeEqualsButton, *testButton;
public slots:

@ -21,101 +21,101 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
#include <qgrid.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qtable.h>
#include <tqspinbox.h>
#include <tqlayout.h>
#include <tqbuttongroup.h>
#include <tqradiobutton.h>
#include <tqtable.h>
#include <kapplication.h>
extern PrintOptions printops;
extern EvaluationOptions evalops;
extern tree_struct variable_cats;
class QalculateEditMatrixVectorTableItem : public QTableItem {
class QalculateEditMatrixVectorTableItem : public TQTableItem {
public:
QalculateEditMatrixVectorTableItem(QTable *table);
QalculateEditMatrixVectorTableItem(QTable *table, const QString & text);
QalculateEditMatrixVectorTableItem(TQTable *table);
QalculateEditMatrixVectorTableItem(TQTable *table, const TQString & text);
int alignment() const;
};
class QalculateEditMatrixTable : public QTable {
class QalculateEditMatrixTable : public TQTable {
public:
QalculateEditMatrixTable(QWidget *parent = 0, const char *name = 0) : QTable(parent, name) {}
QalculateEditMatrixTable(int numRows, int numCols, QWidget *parent = 0, const char *name = 0) : QTable(numRows, numCols, parent, name) {}
QalculateEditMatrixTable(TQWidget *parent = 0, const char *name = 0) : TQTable(parent, name) {}
QalculateEditMatrixTable(int numRows, int numCols, TQWidget *parent = 0, const char *name = 0) : TQTable(numRows, numCols, parent, name) {}
QWidget *beginEdit(int row, int col, bool replace) {
QWidget *w = QTable::beginEdit(row, col, replace);
((QLineEdit*) w)->selectAll();
TQWidget *beginEdit(int row, int col, bool replace) {
TQWidget *w = TQTable::beginEdit(row, col, replace);
((TQLineEdit*) w)->selectAll();
return w;
}
};
QalculateEditMatrixVectorDialog::QalculateEditMatrixVectorDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
QalculateEditMatrixVectorDialog::QalculateEditMatrixVectorDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
names_edit_dialog = NULL;
edited_variable = NULL;
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), mainWidget()), 0, 0);
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), mainWidget()), 0, 0);
nameEdit = new KLineEdit(mainWidget());
grid->addWidget(nameEdit, 0, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(mainWidget());
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(mainWidget());
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), mainWidget());
namesButton = new TQPushButton(i18n("Names Details"), mainWidget());
hbox->addWidget(namesButton);
grid->addWidget(new QLabel(i18n("Category:"), mainWidget()), 2, 0);
grid->addWidget(new TQLabel(i18n("Category:"), mainWidget()), 2, 0);
categoryCombo = new KComboBox(mainWidget());
categoryCombo->setEditable(true);
grid->addWidget(categoryCombo, 2, 1);
grid->addWidget(new QLabel(i18n("Descriptive name:"), mainWidget()), 3, 0);
grid->addWidget(new TQLabel(i18n("Descriptive name:"), mainWidget()), 3, 0);
titleEdit = new KLineEdit(mainWidget());
grid->addWidget(titleEdit, 3, 1);
grid->addWidget(new QLabel(i18n("Rows:"), mainWidget()), 4, 0);
rowsBox = new QSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(new TQLabel(i18n("Rows:"), mainWidget()), 4, 0);
rowsBox = new TQSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(rowsBox, 4, 1);
grid->addWidget(new QLabel(i18n("Columns:"), mainWidget()), 5, 0);
columnsBox = new QSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(new TQLabel(i18n("Columns:"), mainWidget()), 5, 0);
columnsBox = new TQSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(columnsBox, 5, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 6, 6, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
QButtonGroup *group = new QButtonGroup();
matrixButton = new QRadioButton(i18n("Matrix"), mainWidget());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
TQButtonGroup *group = new TQButtonGroup();
matrixButton = new TQRadioButton(i18n("Matrix"), mainWidget());
group->insert(matrixButton, 0);
hbox->addWidget(matrixButton);
vectorButton = new QRadioButton(i18n("Vector"), mainWidget());
vectorButton = new TQRadioButton(i18n("Vector"), mainWidget());
group->insert(vectorButton, 1);
hbox->addWidget(vectorButton);
elementsLabel = new QLabel(i18n("Elements:"), mainWidget());
elementsLabel = new TQLabel(i18n("Elements:"), mainWidget());
grid->addMultiCellWidget(elementsLabel, 7, 7, 0, 1);
elementsTable = new QalculateEditMatrixTable(0, 0, mainWidget());
grid->addMultiCellWidget(elementsTable, 8, 8, 0, 1);
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
connect(rowsBox, SIGNAL(valueChanged(int)), this, SLOT(rowsChanged(int)));
connect(columnsBox, SIGNAL(valueChanged(int)), this, SLOT(columnsChanged(int)));
connect(group, SIGNAL(clicked(int)), this, SLOT(typeChanged(int)));
@ -169,10 +169,10 @@ void QalculateEditMatrixVectorDialog::columnsChanged(int i) {
}
}
KnownVariable *QalculateEditMatrixVectorDialog::newVector(QString category) {
KnownVariable *QalculateEditMatrixVectorDialog::newVector(TQString category) {
return editVariable(category, NULL, NULL, false, true);
}
KnownVariable *QalculateEditMatrixVectorDialog::newMatrix(QString category) {
KnownVariable *QalculateEditMatrixVectorDialog::newMatrix(TQString category) {
return editVariable(category, NULL, NULL, false, false);
}
@ -268,7 +268,7 @@ void QalculateEditMatrixVectorDialog::slotOk() {
accept();
}
KnownVariable *QalculateEditMatrixVectorDialog::editVariable(QString category, KnownVariable *v, MathStructure *initial_value, bool force_value, bool create_vector) {
KnownVariable *QalculateEditMatrixVectorDialog::editVariable(TQString category, KnownVariable *v, MathStructure *initial_value, bool force_value, bool create_vector) {
nameEdit->setFocus();
@ -319,8 +319,8 @@ KnownVariable *QalculateEditMatrixVectorDialog::editVariable(QString category, K
namesLabel->setText("");
//QStringList cats;
QString catstr;
//TQStringList cats;
TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
variable_cats.it = variable_cats.items.begin();
@ -448,7 +448,7 @@ KnownVariable *QalculateEditMatrixVectorDialog::editVariable(QString category, K
init_value = initial_value;
force_init_value = force_value;
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
v = edited_variable;
edited_variable = NULL;
return v;
@ -469,7 +469,7 @@ void QalculateEditMatrixVectorDialog::editNames() {
names_edit_dialog->setNamesLE(nameEdit, namesLabel);
}
void QalculateEditMatrixVectorDialog::nameChanged(const QString &name) {
void QalculateEditMatrixVectorDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->variableNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);
@ -478,14 +478,14 @@ void QalculateEditMatrixVectorDialog::nameChanged(const QString &name) {
}
}
#if QT_VERSION >= 0x030200
QalculateEditMatrixVectorTableItem::QalculateEditMatrixVectorTableItem(QTable *table) : QTableItem(table, QTableItem::OnTyping) {}
#if TQT_VERSION >= 0x030200
QalculateEditMatrixVectorTableItem::QalculateEditMatrixVectorTableItem(TQTable *table) : TQTableItem(table, TQTableItem::OnTyping) {}
#else
QalculateEditMatrixVectorTableItem::QalculateEditMatrixVectorTableItem(QTable *table) : QTableItem(table, QTableItem::OnTyping, QString::null) {}
QalculateEditMatrixVectorTableItem::QalculateEditMatrixVectorTableItem(TQTable *table) : TQTableItem(table, TQTableItem::OnTyping, TQString::null) {}
#endif
QalculateEditMatrixVectorTableItem::QalculateEditMatrixVectorTableItem(QTable *table, const QString & text) : QTableItem(table, QTableItem::OnTyping, text) {}
QalculateEditMatrixVectorTableItem::QalculateEditMatrixVectorTableItem(TQTable *table, const TQString & text) : TQTableItem(table, TQTableItem::OnTyping, text) {}
int QalculateEditMatrixVectorTableItem::alignment() const {return Qt::AlignRight;}
int QalculateEditMatrixVectorTableItem::alignment() const {return TQt::AlignRight;}
#include "qalculateeditmatrixvectordialog.moc"

@ -22,13 +22,13 @@
#include <kdialogbase.h>
class QLabel;
class QSpinBox;
class QTable;
class QRadioButton;
class TQLabel;
class TQSpinBox;
class TQTable;
class TQRadioButton;
class KComboBox;
class KLineEdit;
class QPushButton;
class TQPushButton;
class MathStructure;
class QalculateEditNamesDialog;
class KnownVariable;
@ -42,22 +42,22 @@ class QalculateEditMatrixVectorDialog : public KDialogBase {
public:
QalculateEditMatrixVectorDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditMatrixVectorDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditMatrixVectorDialog();
KnownVariable *newMatrix(QString category = QString::null);
KnownVariable *newVector(QString category = QString::null);
KnownVariable *editVariable(QString category = QString::null, KnownVariable *v = NULL, MathStructure *initial_value = NULL, bool force_value = false, bool create_vector = false);
KnownVariable *newMatrix(TQString category = TQString::null);
KnownVariable *newVector(TQString category = TQString::null);
KnownVariable *editVariable(TQString category = TQString::null, KnownVariable *v = NULL, MathStructure *initial_value = NULL, bool force_value = false, bool create_vector = false);
QalculateEditNamesDialog *names_edit_dialog;
KnownVariable *edited_variable;
KComboBox *categoryCombo;
KLineEdit *nameEdit, *titleEdit;
QLabel *namesLabel, *elementsLabel;
QRadioButton *matrixButton, *vectorButton;
QTable *elementsTable;
QSpinBox *rowsBox, *columnsBox;
QPushButton *namesButton;
TQLabel *namesLabel, *elementsLabel;
TQRadioButton *matrixButton, *vectorButton;
TQTable *elementsTable;
TQSpinBox *rowsBox, *columnsBox;
TQPushButton *namesButton;
private:
@ -70,7 +70,7 @@ public slots:
void rowsChanged(int);
void columnsChanged(int);
void editNames();
void nameChanged(const QString&);
void nameChanged(const TQString&);
protected slots:

@ -23,36 +23,36 @@
#include <klocale.h>
#include <klistview.h>
#include <kpushbutton.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <klineedit.h>
#include <qlabel.h>
#include <qapplication.h>
#include <tqlabel.h>
#include <tqapplication.h>
#include <kstdguiitem.h>
QalculateEditNamesDialog::QalculateEditNamesDialog(int item_type, QWidget *parent, const char *name) : KDialog(parent, name, true) {
QalculateEditNamesDialog::QalculateEditNamesDialog(int item_type, TQWidget *parent, const char *name) : KDialog(parent, name, true) {
setCaption(i18n("Edit Names"));
i_type = item_type;
QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint());
TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint());
namesView = new KListView(this);
namesView->addColumn(i18n("Name"));
namesView->addColumn(i18n("Abbreviation"));
namesView->setColumnAlignment(1, Qt::AlignCenter);
namesView->setColumnAlignment(1, TQt::AlignCenter);
namesView->addColumn(i18n("Plural"));
namesView->setColumnAlignment(2, Qt::AlignCenter);
namesView->setColumnAlignment(2, TQt::AlignCenter);
namesView->addColumn(i18n("Reference"));
namesView->setColumnAlignment(3, Qt::AlignCenter);
namesView->setColumnAlignment(3, TQt::AlignCenter);
namesView->addColumn(i18n("Avoid Input"));
namesView->setColumnAlignment(4, Qt::AlignCenter);
namesView->setColumnAlignment(4, TQt::AlignCenter);
namesView->addColumn(i18n("Unicode"));
namesView->setColumnAlignment(5, Qt::AlignCenter);
namesView->setColumnAlignment(5, TQt::AlignCenter);
namesView->addColumn(i18n("Suffix"));
namesView->setColumnAlignment(6, Qt::AlignCenter);
namesView->setColumnAlignment(6, TQt::AlignCenter);
namesView->addColumn(i18n("Case Sensitive"));
namesView->setColumnAlignment(7, Qt::AlignCenter);
namesView->setColumnAlignment(7, TQt::AlignCenter);
namesView->setSorting(-1);
namesView->setItemsRenameable(true);
namesView->setItemsMovable(true);
@ -60,13 +60,13 @@ QalculateEditNamesDialog::QalculateEditNamesDialog(int item_type, QWidget *paren
namesView->setAcceptDrops(true);
layout->addWidget(namesView);
QHBoxLayout *buttonLayout = new QHBoxLayout(layout, spacingHint());
newButton = new QPushButton(i18n("New"), this);
TQHBoxLayout *buttonLayout = new TQHBoxLayout(layout, spacingHint());
newButton = new TQPushButton(i18n("New"), this);
buttonLayout->addWidget(newButton);
deleteButton = new QPushButton(i18n("Delete"), this);
deleteButton = new TQPushButton(i18n("Delete"), this);
deleteButton->setEnabled(false);
buttonLayout->addWidget(deleteButton);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
buttonLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
buttonClose = new KPushButton(KStdGuiItem::close(), this);
buttonClose->setAutoDefault(true);
buttonClose->setDefault(true);
@ -76,8 +76,8 @@ QalculateEditNamesDialog::QalculateEditNamesDialog(int item_type, QWidget *paren
connect(buttonClose, SIGNAL(clicked()), this, SLOT(accept()));
connect(newButton, SIGNAL(clicked()), this, SLOT(newName()));
connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteName()));
connect(namesView, SIGNAL(clicked(QListViewItem*, const QPoint&, int)), this, SLOT(itemClicked(QListViewItem*, const QPoint&, int)));
connect(namesView->renameLineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(namesView, SIGNAL(clicked(TQListViewItem*, const TQPoint&, int)), this, SLOT(itemClicked(TQListViewItem*, const TQPoint&, int)));
connect(namesView->renameLineEdit(), SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
}
@ -85,23 +85,23 @@ QalculateEditNamesDialog::~QalculateEditNamesDialog() {}
void QalculateEditNamesDialog::newName() {
ExpressionName name;
QListViewItem *i = new KListViewItem(namesView, namesView->lastChild(), "", i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"));
TQListViewItem *i = new KListViewItem(namesView, namesView->lastChild(), "", i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"), i18n("No"));
namesView->setSelected(i, true);
qApp->processEvents();
tqApp->processEvents();
namesView->rename(i, 0);
}
void QalculateEditNamesDialog::setNames(ExpressionItem *item, const QString &namestr, bool names_edited) {
void QalculateEditNamesDialog::setNames(ExpressionItem *item, const TQString &namestr, bool names_edited) {
if(!names_edited) {
deleteButton->setEnabled(false);
namesView->clear();
}
if(!names_edited && item && item->countNames() > 0) {
QListViewItem *i_prev = NULL;
TQListViewItem *i_prev = NULL;
for(size_t index = 1; index <= item->countNames(); index++) {
const ExpressionName *ename = &item->getName(index);
QListViewItem *i = new KListViewItem(namesView, i_prev);
TQListViewItem *i = new KListViewItem(namesView, i_prev);
i_prev = i;
if(ename->abbreviation)
i->setText(1, i18n("Yes"));
@ -139,12 +139,12 @@ void QalculateEditNamesDialog::setNames(ExpressionItem *item, const QString &nam
}
} else if(!namestr.isEmpty()) {
if(names_edited) {
QListViewItemIterator it(namesView);
TQListViewItemIterator it(namesView);
if(it.current())
it.current()->setText(0, namestr);
} else {
ExpressionName ename(namestr.ascii());
QListViewItem *i = new KListViewItem(namesView, ename.name.c_str());
TQListViewItem *i = new KListViewItem(namesView, ename.name.c_str());
if(ename.abbreviation)
i->setText(1, i18n("Yes"));
else
@ -176,9 +176,9 @@ void QalculateEditNamesDialog::setNames(ExpressionItem *item, const QString &nam
}
}
}
void QalculateEditNamesDialog::saveNames(ExpressionItem *item, const QString &str) {
void QalculateEditNamesDialog::saveNames(ExpressionItem *item, const TQString &str) {
item->clearNames();
QListViewItemIterator it(namesView);
TQListViewItemIterator it(namesView);
if(it.current()) {
bool b = false;
while(it.current()) {
@ -202,10 +202,10 @@ void QalculateEditNamesDialog::saveNames(ExpressionItem *item, const QString &st
item->addName(str.ascii());
}
}
void QalculateEditNamesDialog::setNamesLE(QLineEdit *entry, QLabel *label) {
void QalculateEditNamesDialog::setNamesLE(TQLineEdit *entry, TQLabel *label) {
int index = 0;
QString str;
QListViewItemIterator it(namesView);
TQString str;
TQListViewItemIterator it(namesView);
while(it.current()) {
if(index == 0) {
entry->setText(it.current()->text(0));
@ -230,7 +230,7 @@ void QalculateEditNamesDialog::deleteName() {
namesView->removeItem(namesView->selectedItem());
}
void QalculateEditNamesDialog::itemClicked(QListViewItem *i, const QPoint &, int c) {
void QalculateEditNamesDialog::itemClicked(TQListViewItem *i, const TQPoint &, int c) {
if(i && c > 0) {
if(i->text(c) == i18n("Yes"))
i->setText(c, i18n("No"));
@ -245,7 +245,7 @@ void QalculateEditNamesDialog::nameSelectionChanged() {
deleteButton->setEnabled(namesView->selectedItem() != NULL);
}
void QalculateEditNamesDialog::nameChanged(const QString &name) {
void QalculateEditNamesDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
namesView->renameLineEdit()->blockSignals(true);
switch(i_type) {

@ -24,10 +24,10 @@
class ExpressionItem;
class KListView;
class QPushButton;
class QLineEdit;
class QLabel;
class QListViewItem;
class TQPushButton;
class TQLineEdit;
class TQLabel;
class TQListViewItem;
/**
@author Niklas Knutsson
@ -38,26 +38,26 @@ class QalculateEditNamesDialog : public KDialog {
public:
QalculateEditNamesDialog(int item_type, QWidget *parent = 0, const char *name = 0);
QalculateEditNamesDialog(int item_type, TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditNamesDialog();
void saveNames(ExpressionItem *item, const QString &str = QString::null);
void setNames(ExpressionItem *item = NULL, const QString &namestr = QString::null, bool names_edited = false);
void saveNames(ExpressionItem *item, const TQString &str = TQString::null);
void setNames(ExpressionItem *item = NULL, const TQString &namestr = TQString::null, bool names_edited = false);
bool isEmpty();
void setNamesLE(QLineEdit *entry, QLabel *label);
void setNamesLE(TQLineEdit *entry, TQLabel *label);
KListView* namesView;
QPushButton* newButton;
QPushButton* deleteButton;
QPushButton* buttonClose;
TQPushButton* newButton;
TQPushButton* deleteButton;
TQPushButton* buttonClose;
int i_type;
public slots:
virtual void itemClicked(QListViewItem*, const QPoint&, int);
virtual void itemClicked(TQListViewItem*, const TQPoint&, int);
virtual void newName();
virtual void deleteName();
virtual void nameChanged(const QString&);
virtual void nameChanged(const TQString&);
virtual void nameSelectionChanged();
};

@ -21,75 +21,75 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
#include <qgrid.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <qgroupbox.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <tqgroupbox.h>
#include <tqspinbox.h>
#include <tqlayout.h>
#include <kapplication.h>
extern PrintOptions printops;
extern EvaluationOptions evalops;
extern tree_struct unit_cats;
QalculateEditUnitDialog::QalculateEditUnitDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Unit"), Ok | Cancel | Help, Ok, true) {
QalculateEditUnitDialog::QalculateEditUnitDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Unit"), Ok | Cancel | Help, Ok, true) {
names_edit_dialog = NULL;
edited_unit = NULL;
QVBox *box = makeVBoxMainWidget();
TQVBox *box = makeVBoxMainWidget();
grid1 = new QGroupBox(1, Qt::Horizontal, i18n("Name"), box);
grid1 = new TQGroupBox(1, TQt::Horizontal, i18n("Name"), box);
grid1->setInsideMargin(spacingHint());
grid1->setInsideSpacing(spacingHint());
QWidget *widget = new QWidget(grid1);
QGridLayout *grid = new QGridLayout(widget, 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), widget), 0, 0);
TQWidget *widget = new TQWidget(grid1);
TQGridLayout *grid = new TQGridLayout(widget, 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), widget), 0, 0);
nameEdit = new KLineEdit(widget);
grid->addWidget(nameEdit, 0, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(widget);
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(widget);
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), widget);
namesButton = new TQPushButton(i18n("Names Details"), widget);
hbox->addWidget(namesButton);
grid->addWidget(new QLabel(i18n("Descriptive name:"), widget), 2, 0);
grid->addWidget(new TQLabel(i18n("Descriptive name:"), widget), 2, 0);
titleEdit = new KLineEdit(widget);
grid->addWidget(titleEdit, 2, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 3, 3, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
hideButton = new QCheckBox(i18n("Hide unit"), widget);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
hideButton = new TQCheckBox(i18n("Hide unit"), widget);
hbox->addWidget(hideButton);
grid2 = new QGroupBox(1, Qt::Horizontal, i18n("Type"), box);
grid2 = new TQGroupBox(1, TQt::Horizontal, i18n("Type"), box);
grid2->setInsideMargin(spacingHint());
grid2->setInsideSpacing(spacingHint());
widget = new QWidget(grid2);
grid = new QGridLayout(widget, 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Class:"), widget), 0, 0);
widget = new TQWidget(grid2);
grid = new TQGridLayout(widget, 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Class:"), widget), 0, 0);
classCombo = new KComboBox(widget);
grid->addWidget(classCombo, 0, 1);
classCombo->insertItem(i18n("Base Unit"));
classCombo->insertItem(i18n("Alias"));
classCombo->insertItem(i18n("Composite Unit"));
classCombo->setMaximumWidth(250);
grid->addWidget(new QLabel(i18n("Category:"), widget), 1, 0);
grid->addWidget(new TQLabel(i18n("Category:"), widget), 1, 0);
categoryCombo = new KComboBox(widget);
grid->addWidget(categoryCombo, 1, 1);
categoryCombo->setMaximumWidth(250);
categoryCombo->setEditable(true);
grid->addWidget(new QLabel(i18n("System:"), widget), 2, 0);
grid->addWidget(new TQLabel(i18n("System:"), widget), 2, 0);
systemCombo = new KComboBox(widget);
grid->addWidget(systemCombo, 2, 1);
systemCombo->insertItem(i18n("SI"));
@ -99,35 +99,35 @@ QalculateEditUnitDialog::QalculateEditUnitDialog(QWidget *parent, const char *na
systemCombo->setMaximumWidth(250);
systemCombo->setEditable(true);
grid3 = new QGroupBox(1, Qt::Horizontal, i18n("Relation"), box);
grid3 = new TQGroupBox(1, TQt::Horizontal, i18n("Relation"), box);
grid3->setInsideMargin(spacingHint());
grid3->setInsideSpacing(spacingHint());
widget = new QWidget(grid3);
grid = new QGridLayout(widget, 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Base unit:"), widget), 0, 0);
widget = new TQWidget(grid3);
grid = new TQGridLayout(widget, 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Base unit:"), widget), 0, 0);
baseEdit = new KLineEdit(widget);
grid->addWidget(baseEdit, 0, 1);
exponentLabel = new QLabel(i18n("Exponent:"), widget);
exponentLabel = new TQLabel(i18n("Exponent:"), widget);
grid->addWidget(exponentLabel, 1, 0);
exponentBox = new QSpinBox(-9, 9, 1, widget);
exponentBox = new TQSpinBox(-9, 9, 1, widget);
grid->addWidget(exponentBox, 1, 1);
relationLabel = new QLabel(i18n("Relation:"), widget);
relationLabel = new TQLabel(i18n("Relation:"), widget);
grid->addWidget(relationLabel, 2, 0);
relationEdit = new KLineEdit(widget);
grid->addWidget(relationEdit, 2, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 3, 3, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
relationExactButton = new QCheckBox(i18n("Relation is exact"), widget);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
relationExactButton = new TQCheckBox(i18n("Relation is exact"), widget);
hbox->addWidget(relationExactButton);
inverseRelationLabel = new QLabel(i18n("Inverse relation:"), widget);
inverseRelationLabel = new TQLabel(i18n("Inverse relation:"), widget);
grid->addWidget(inverseRelationLabel, 4, 0);
inverseRelationEdit = new KLineEdit(widget);
grid->addWidget(inverseRelationEdit, 4, 1);
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(classCombo, SIGNAL(activated(int)), this, SLOT(classChanged(int)));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
}
@ -273,7 +273,7 @@ void QalculateEditUnitDialog::classChanged(int i) {
grid3->setEnabled(i != 0);
}
Unit *QalculateEditUnitDialog::editUnit(QString category, Unit *u) {
Unit *QalculateEditUnitDialog::editUnit(TQString category, Unit *u) {
nameEdit->setFocus();
@ -291,8 +291,8 @@ Unit *QalculateEditUnitDialog::editUnit(QString category, Unit *u) {
setCaption(i18n("New Unit"));
}
//QStringList cats;
QString catstr;
//TQStringList cats;
TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
unit_cats.it = unit_cats.items.begin();
@ -391,7 +391,7 @@ Unit *QalculateEditUnitDialog::editUnit(QString category, Unit *u) {
classChanged(1);
}
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
u = edited_unit;
edited_unit = NULL;
return u;
@ -411,7 +411,7 @@ void QalculateEditUnitDialog::editNames() {
names_edit_dialog->setNamesLE(nameEdit, namesLabel);
}
void QalculateEditUnitDialog::nameChanged(const QString &name) {
void QalculateEditUnitDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->unitNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);

@ -22,16 +22,16 @@
#include <kdialogbase.h>
class QLabel;
class TQLabel;
class KComboBox;
class KLineEdit;
class QCheckBox;
class QPushButton;
class QSpinBox;
class TQCheckBox;
class TQPushButton;
class TQSpinBox;
class MathStructure;
class QalculateEditNamesDialog;
class Unit;
class QGroupBox;
class TQGroupBox;
/**
@author Niklas Knutsson
@ -42,26 +42,26 @@ class QalculateEditUnitDialog : public KDialogBase {
public:
QalculateEditUnitDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditUnitDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditUnitDialog();
Unit *editUnit(QString category = QString::null, Unit *u = NULL);
Unit *editUnit(TQString category = TQString::null, Unit *u = NULL);
QalculateEditNamesDialog *names_edit_dialog;
Unit *edited_unit;
KComboBox *categoryCombo, *classCombo, *systemCombo;
KLineEdit *nameEdit, *titleEdit, *baseEdit, *relationEdit, *inverseRelationEdit;
QLabel *namesLabel, *exponentLabel, *relationLabel, *inverseRelationLabel;
QCheckBox *relationExactButton, *hideButton;
QPushButton *namesButton;
QSpinBox *exponentBox;
QGroupBox *grid1, *grid2, *grid3;
TQLabel *namesLabel, *exponentLabel, *relationLabel, *inverseRelationLabel;
TQCheckBox *relationExactButton, *hideButton;
TQPushButton *namesButton;
TQSpinBox *exponentBox;
TQGroupBox *grid1, *grid2, *grid3;
public slots:
void editNames();
void classChanged(int);
void nameChanged(const QString&);
void nameChanged(const TQString&);
protected slots:

@ -21,43 +21,43 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
#include <qgrid.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <kapplication.h>
extern PrintOptions printops;
extern tree_struct variable_cats;
QalculateEditUnknownVariableDialog::QalculateEditUnknownVariableDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
QalculateEditUnknownVariableDialog::QalculateEditUnknownVariableDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
names_edit_dialog = NULL;
edited_unknown = NULL;
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Name:"), mainWidget()), 0, 0);
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Name:"), mainWidget()), 0, 0);
nameEdit = new KLineEdit(mainWidget());
grid->addWidget(nameEdit, 0, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(mainWidget());
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(mainWidget());
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), mainWidget());
namesButton = new TQPushButton(i18n("Names Details"), mainWidget());
hbox->addWidget(namesButton);
assumptionsBox = new QCheckBox(i18n("Custom assumptions:"), mainWidget());
assumptionsBox = new TQCheckBox(i18n("Custom assumptions:"), mainWidget());
grid->addMultiCellWidget(assumptionsBox, 2, 2, 0, 1);
typeLabel = new QLabel(i18n("Type"), mainWidget());
typeLabel = new TQLabel(i18n("Type"), mainWidget());
grid->addWidget(typeLabel, 3, 0);
typeCombo = new KComboBox(mainWidget());
typeCombo->setMaximumWidth(250);
@ -70,7 +70,7 @@ QalculateEditUnknownVariableDialog::QalculateEditUnknownVariableDialog(QWidget *
typeCombo->insertItem(i18n("Rational Number"));
typeCombo->insertItem(i18n("Integer"));
grid->addWidget(typeCombo, 3, 1);
signLabel = new QLabel(i18n("Sign"), mainWidget());
signLabel = new TQLabel(i18n("Sign"), mainWidget());
grid->addWidget(signLabel, 4, 0);
signCombo = new KComboBox(mainWidget());
signCombo->setMaximumWidth(250);
@ -82,12 +82,12 @@ QalculateEditUnknownVariableDialog::QalculateEditUnknownVariableDialog(QWidget *
signCombo->insertItem(i18n("Non-Positive"));
signCombo->insertItem(i18n("Non-Zero"));
grid->addWidget(signCombo, 4, 1);
grid->addWidget(new QLabel(i18n("Category:"), mainWidget()), 5, 0);
grid->addWidget(new TQLabel(i18n("Category:"), mainWidget()), 5, 0);
categoryCombo = new KComboBox(mainWidget());
categoryCombo->setMaximumWidth(250);
categoryCombo->setEditable(true);
grid->addWidget(categoryCombo, 5, 1);
grid->addWidget(new QLabel(i18n("Descriptive name:"), mainWidget()), 6, 0);
grid->addWidget(new TQLabel(i18n("Descriptive name:"), mainWidget()), 6, 0);
titleEdit = new KLineEdit(mainWidget());
grid->addWidget(titleEdit, 6, 1);
@ -98,7 +98,7 @@ QalculateEditUnknownVariableDialog::QalculateEditUnknownVariableDialog(QWidget *
connect(typeCombo, SIGNAL(activated(int)), this, SLOT(typeComboActivated(int)));
connect(signCombo, SIGNAL(activated(int)), this, SLOT(signComboActivated(int)));
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
}
@ -185,7 +185,7 @@ void QalculateEditUnknownVariableDialog::slotOk() {
}
UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(QString category, UnknownVariable *v) {
UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(TQString category, UnknownVariable *v) {
nameEdit->setFocus();
@ -207,8 +207,8 @@ UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(QString catego
namesLabel->setText("");
//QStringList cats;
QString catstr;
//TQStringList cats;
TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
variable_cats.it = variable_cats.items.begin();
@ -275,7 +275,7 @@ UnknownVariable *QalculateEditUnknownVariableDialog::editVariable(QString catego
signCombo->setEnabled(!v || (!v->isBuiltin() && v->assumptions()));
typeCombo->setEnabled(!v || (!v->isBuiltin() && v->assumptions()));
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
v = edited_unknown;
edited_unknown = NULL;
return v;
@ -295,7 +295,7 @@ void QalculateEditUnknownVariableDialog::editNames() {
names_edit_dialog->setNamesLE(nameEdit, namesLabel);
}
void QalculateEditUnknownVariableDialog::nameChanged(const QString &name) {
void QalculateEditUnknownVariableDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->variableNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);

@ -22,14 +22,14 @@
#include <kdialogbase.h>
class QLabel;
class TQLabel;
class KComboBox;
class KLineEdit;
class QPushButton;
class TQPushButton;
class MathStructure;
class QalculateEditNamesDialog;
class UnknownVariable;
class QCheckBox;
class TQCheckBox;
/**
@author Niklas Knutsson
@ -40,23 +40,23 @@ class QalculateEditUnknownVariableDialog : public KDialogBase {
public:
QalculateEditUnknownVariableDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditUnknownVariableDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditUnknownVariableDialog();
UnknownVariable *editVariable(QString category = QString::null, UnknownVariable *v = NULL);
UnknownVariable *editVariable(TQString category = TQString::null, UnknownVariable *v = NULL);
QalculateEditNamesDialog *names_edit_dialog;
UnknownVariable *edited_unknown;
KComboBox *categoryCombo, *signCombo, *typeCombo;
KLineEdit *nameEdit, *titleEdit;
QLabel *namesLabel, *signLabel, *typeLabel;
QPushButton *namesButton;
QCheckBox *assumptionsBox;
TQLabel *namesLabel, *signLabel, *typeLabel;
TQPushButton *namesButton;
TQCheckBox *assumptionsBox;
public slots:
void editNames();
void nameChanged(const QString&);
void nameChanged(const TQString&);
void signComboActivated(int);
void typeComboActivated(int);

@ -21,69 +21,69 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
#include <qgrid.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <kapplication.h>
extern PrintOptions printops;
extern EvaluationOptions evalops;
extern tree_struct variable_cats;
QalculateEditVariableDialog::QalculateEditVariableDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
QalculateEditVariableDialog::QalculateEditVariableDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | Help, Ok, true) {
names_edit_dialog = NULL;
edited_variable = NULL;
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 6, 2, 0, spacingHint());
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 6, 2, 0, spacingHint());
nameLabel = new QLabel(i18n("Name:"), mainWidget());
nameLabel = new TQLabel(i18n("Name:"), mainWidget());
grid->addWidget(nameLabel, 0, 0);
nameEdit = new KLineEdit(mainWidget());
grid->addWidget(nameEdit, 0, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
namesLabel = new QLabel(mainWidget());
namesLabel->setAlignment(Qt::AlignRight);
namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
namesLabel = new TQLabel(mainWidget());
namesLabel->setAlignment(TQt::AlignRight);
namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
namesButton = new QPushButton(i18n("Names Details"), mainWidget());
namesButton = new TQPushButton(i18n("Names Details"), mainWidget());
hbox->addWidget(namesButton);
valueLabel = new QLabel(i18n("Value:"), mainWidget());
valueLabel = new TQLabel(i18n("Value:"), mainWidget());
grid->addWidget(valueLabel, 2, 0);
valueEdit = new KLineEdit(mainWidget());
grid->addWidget(valueEdit, 2, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 3, 3, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
valueExactButton = new QCheckBox(i18n("Value is exact"), mainWidget());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
valueExactButton = new TQCheckBox(i18n("Value is exact"), mainWidget());
hbox->addWidget(valueExactButton);
grid->addWidget(new QLabel(i18n("Category:"), mainWidget()), 4, 0);
grid->addWidget(new TQLabel(i18n("Category:"), mainWidget()), 4, 0);
categoryCombo = new KComboBox(mainWidget());
grid->addWidget(categoryCombo, 4, 1);
categoryCombo->setMaximumWidth(250);
categoryCombo->setEditable(true);
titleLabel = new QLabel(i18n("Descriptive name:"), mainWidget());
titleLabel = new TQLabel(i18n("Descriptive name:"), mainWidget());
grid->addWidget(titleLabel, 5, 0);
titleEdit = new KLineEdit(mainWidget());
grid->addWidget(titleEdit, 5, 1);
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
}
@ -166,7 +166,7 @@ void QalculateEditVariableDialog::slotOk() {
accept();
}
KnownVariable *QalculateEditVariableDialog::editVariable(QString category, KnownVariable *v, MathStructure *initial_value, bool force_value) {
KnownVariable *QalculateEditVariableDialog::editVariable(TQString category, KnownVariable *v, MathStructure *initial_value, bool force_value) {
nameEdit->setFocus();
@ -189,8 +189,8 @@ KnownVariable *QalculateEditVariableDialog::editVariable(QString category, Known
namesLabel->setText("");
//QStringList cats;
QString catstr;
//TQStringList cats;
TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
variable_cats.it = variable_cats.items.begin();
@ -271,7 +271,7 @@ KnownVariable *QalculateEditVariableDialog::editVariable(QString category, Known
init_value = initial_value;
force_init_value = force_value;
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
v = edited_variable;
edited_variable = NULL;
return v;
@ -291,7 +291,7 @@ void QalculateEditVariableDialog::editNames() {
names_edit_dialog->setNamesLE(nameEdit, namesLabel);
}
void QalculateEditVariableDialog::nameChanged(const QString &name) {
void QalculateEditVariableDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->variableNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);

@ -22,15 +22,15 @@
#include <kdialogbase.h>
class QLabel;
class TQLabel;
class KComboBox;
class KLineEdit;
class QCheckBox;
class QPushButton;
class TQCheckBox;
class TQPushButton;
class MathStructure;
class QalculateEditNamesDialog;
class KnownVariable;
class QGridLayout;
class TQGridLayout;
/**
@author Niklas Knutsson
@ -41,18 +41,18 @@ class QalculateEditVariableDialog : public KDialogBase {
public:
QalculateEditVariableDialog(QWidget *parent = 0, const char *name = 0);
QalculateEditVariableDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateEditVariableDialog();
KnownVariable *editVariable(QString category = QString::null, KnownVariable *v = NULL, MathStructure *initial_value = NULL, bool force_value = false);
KnownVariable *editVariable(TQString category = TQString::null, KnownVariable *v = NULL, MathStructure *initial_value = NULL, bool force_value = false);
QalculateEditNamesDialog *names_edit_dialog;
KnownVariable *edited_variable;
KComboBox *categoryCombo;
KLineEdit *valueEdit, *nameEdit, *titleEdit;
QLabel *namesLabel, *titleLabel, *nameLabel, *valueLabel;
QCheckBox *valueExactButton;
QPushButton *namesButton;
TQLabel *namesLabel, *titleLabel, *nameLabel, *valueLabel;
TQCheckBox *valueExactButton;
TQPushButton *namesButton;
private:
@ -62,7 +62,7 @@ private:
public slots:
void editNames();
void nameChanged(const QString&);
void nameChanged(const TQString&);
protected slots:

@ -20,40 +20,40 @@
#include "qalculateexportcsvdialog.h"
#include "qalculate_tde_utils.h"
#include <qlayout.h>
#include <tqlayout.h>
#include <kurlrequester.h>
#include <klineedit.h>
#include <qlabel.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <tqlabel.h>
#include <tqradiobutton.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qbuttongroup.h>
#include <tqbuttongroup.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <kapplication.h>
extern MathStructure *mstruct;
QalculateExportCSVDialog::QalculateExportCSVDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Export CSV File"), Ok | Cancel | Help, Ok, true) {
QalculateExportCSVDialog::QalculateExportCSVDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Export CSV File"), Ok | Cancel | Help, Ok, true) {
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
QButtonGroup *group = new QButtonGroup();
currentResultButton = new QRadioButton(i18n("Current result"), mainWidget());
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
TQButtonGroup *group = new TQButtonGroup();
currentResultButton = new TQRadioButton(i18n("Current result"), mainWidget());
group->insert(currentResultButton, 0);
grid->addWidget(currentResultButton, 0, 0);
currentResultButton->setChecked(true);
matrixVectorButton = new QRadioButton(i18n("Matrix/vector variable"), mainWidget());
matrixVectorButton = new TQRadioButton(i18n("Matrix/vector variable"), mainWidget());
group->insert(matrixVectorButton, 1);
grid->addWidget(matrixVectorButton, 1, 0);
matrixVectorEdit = new KLineEdit(mainWidget());
grid->addWidget(matrixVectorEdit, 1, 1);
grid->addWidget(new QLabel(i18n("File:"), mainWidget()), 2, 0);
grid->addWidget(new TQLabel(i18n("File:"), mainWidget()), 2, 0);
fileEdit = new KURLRequester(mainWidget());
fileEdit->setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
fileEdit->setCaption(i18n("Export CSV File"));
grid->addWidget(fileEdit, 2, 1);
grid->addWidget(new QLabel(i18n("Delimiter:"), mainWidget()), 3, 0);
grid->addWidget(new TQLabel(i18n("Delimiter:"), mainWidget()), 3, 0);
delimiterCombo = new KComboBox(mainWidget());
delimiterCombo->setMaximumWidth(250);
delimiterCombo->insertItem(i18n("Comma"));
@ -86,7 +86,7 @@ void QalculateExportCSVDialog::delimiterChanged(int i) {
}
void QalculateExportCSVDialog::slotOk() {
QString str = fileEdit->url().stripWhiteSpace();
TQString str = fileEdit->url().stripWhiteSpace();
if(str.isEmpty()) {
//no name -- open dialog again
fileEdit->setFocus();
@ -150,7 +150,7 @@ void QalculateExportCSVDialog::slotOk() {
matrix_struct = (MathStructure*) &((KnownVariable*) var)->get();
}
if(!CALCULATOR->exportCSV(*matrix_struct, str.ascii(), delimiter)) {
QString error_str;
TQString error_str;
error_str.sprintf(i18n("Could not export to file \n%s"), str.ascii());
KMessageBox::error(this, error_str);
reject();

@ -24,7 +24,7 @@
class KLineEdit;
class KComboBox;
class QRadioButton;
class TQRadioButton;
class KURLRequester;
class KnownVariable;
@ -37,12 +37,12 @@ class QalculateExportCSVDialog : public KDialogBase {
public:
QalculateExportCSVDialog(QWidget *parent = 0, const char *name = 0);
QalculateExportCSVDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateExportCSVDialog();
KLineEdit *otherDelimiterEdit, *matrixVectorEdit;
KComboBox *delimiterCombo;
QRadioButton *currentResultButton, *matrixVectorButton;
TQRadioButton *currentResultButton, *matrixVectorButton;
KURLRequester *fileEdit;
void exportCSVFile(KnownVariable *v = NULL);

@ -23,17 +23,17 @@
#include "kqalculate.h"
#include <kdeversion.h>
#include <kcursor.h>
#include <qstyle.h>
#include <qpainter.h>
#include <qapplication.h>
#include <qfontmetrics.h>
#include <tqstyle.h>
#include <tqpainter.h>
#include <tqapplication.h>
#include <tqfontmetrics.h>
#include <kstringhandler.h>
#include <kpopupmenu.h>
#include <kxmlguifactory.h>
#include <kxmlguiclient.h>
#include <kaction.h>
#include <klocale.h>
#include <qsimplerichtext.h>
#include <tqsimplerichtext.h>
extern vector<mode_struct> modes;
@ -44,15 +44,15 @@ extern bool rpn_mode, rpn_keypad_only;
extern tree_struct function_cats, unit_cats, variable_cats;
extern vector<void*> ia_units, ia_variables, ia_functions;
class QalculateExpressionEditListBoxItem : public QListBoxItem {
class QalculateExpressionEditListBoxItem : public TQListBoxItem {
public:
QalculateExpressionEditListBoxItem(ExpressionItem *eitem);
virtual ~QalculateExpressionEditListBoxItem();
int height(const QListBox*) const;
int width(const QListBox*) const;
int height(const TQListBox*) const;
int width(const TQListBox*) const;
bool reuse(ExpressionItem *newItem);
@ -60,17 +60,17 @@ public:
protected:
void paint(QPainter*);
void paint(TQPainter*);
private:
QString title;
TQString title;
int italic_index;
bool rich_text;
};
QalculateExpressionEdit::QalculateExpressionEdit(bool connected_to_main_win, QWidget *parent, const char *name) : KLineEdit(parent, name) {
QalculateExpressionEdit::QalculateExpressionEdit(bool connected_to_main_win, TQWidget *parent, const char *name) : KLineEdit(parent, name) {
qalculateCompletionBox = new QalculateExpressionEditCompletionBox(this);
qalculateCompletion = new KCompletion();
@ -91,15 +91,15 @@ QalculateExpressionEdit::QalculateExpressionEdit(bool connected_to_main_win, QWi
prev_position = 0;
pos_timer = startTimer(50);
connect(qalculateCompletionBox, SIGNAL(highlighted(QListBoxItem*)), this, SLOT(insertCompletion(QListBoxItem*)));
connect(qalculateCompletionBox, SIGNAL(userCancelled(const QString&)), this, SLOT(cancelCompletion(const QString&)));
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged(const QString&)));
connect(qalculateCompletionBox, SIGNAL(highlighted(TQListBoxItem*)), this, SLOT(insertCompletion(TQListBoxItem*)));
connect(qalculateCompletionBox, SIGNAL(userCancelled(const TQString&)), this, SLOT(cancelCompletion(const TQString&)));
connect(this, SIGNAL(textChanged(const TQString&)), this, SLOT(onTextChanged(const TQString&)));
}
QalculateExpressionEdit::~QalculateExpressionEdit() {}
void QalculateExpressionEdit::timerEvent(QTimerEvent *event) {
void QalculateExpressionEdit::timerEvent(TQTimerEvent *event) {
if(event->timerId() == pos_timer) {
if(cursorPosition() != prev_position) {
prev_position = cursorPosition();
@ -110,7 +110,7 @@ void QalculateExpressionEdit::timerEvent(QTimerEvent *event) {
}
}
void QalculateExpressionEdit::onTextChanged(const QString &str) {
void QalculateExpressionEdit::onTextChanged(const TQString &str) {
if(str.isEmpty()) {
if(qalculateCompletionBox) {
qalculateCompletionBox->hide();
@ -121,7 +121,7 @@ void QalculateExpressionEdit::onTextChanged(const QString &str) {
prev_position = cursorPosition();
}
void QalculateExpressionEdit::cancelCompletion(const QString &str) {
void QalculateExpressionEdit::cancelCompletion(const TQString &str) {
int new_pos = pos_before_completion;
setText(str);
setCursorPosition(new_pos);
@ -137,10 +137,10 @@ bool QalculateExpressionEdit::completionEnabled() const {
return completionMode() == KGlobalSettings::CompletionPopup;
}
QPopupMenu *QalculateExpressionEdit::createPopupMenu() {
TQPopupMenu *QalculateExpressionEdit::createPopupMenu() {
setCompletionObject(NULL);
QPopupMenu *menu = KLineEdit::createPopupMenu();
TQPopupMenu *menu = KLineEdit::createPopupMenu();
setCompletionObject(qalculateCompletion);
menu->insertSeparator();
if(completionMode() == KGlobalSettings::CompletionPopup) menu->insertItem(i18n("Disable Completion"), this, SLOT(disableCompletion()));
@ -150,8 +150,8 @@ QPopupMenu *QalculateExpressionEdit::createPopupMenu() {
mainWin->ActionReadPrecision->plug(menu);
mainWin->ActionLimitImplicitMultiplication->plug(menu);
mainWin->ActionRPNMode->plug(menu);
QPopupMenu *modes_menu = new QPopupMenu(menu);
QObject::connect(modes_menu, SIGNAL(activated(int)), mainWin, SLOT(loadMode(int)));
TQPopupMenu *modes_menu = new TQPopupMenu(menu);
TQObject::connect(modes_menu, SIGNAL(activated(int)), mainWin, SLOT(loadMode(int)));
for(size_t i = 0; i < modes.size(); i++) {
modes_menu->insertItem(modes[i].name, i, i);
}
@ -167,15 +167,15 @@ QPopupMenu *QalculateExpressionEdit::createPopupMenu() {
}
#if QT_VERSION >= 0x030200
#if TQT_VERSION >= 0x030200
#define GET_SELECTION int start = selectionStart(), end = -1; if(start >= 0) end = start + selectedText().length();
#else
#define GET_SELECTION int start = -1, end = -1; getSelection(&start, &end);
#endif
#define RESTORE_SELECTION if(start > 0) setSelection(start, end - start);
void QalculateExpressionEdit::addToHistory(const QString &str) {
for(QStringList::Iterator it = expression_history.begin(); it != expression_history.end(); ++it) {
void QalculateExpressionEdit::addToHistory(const TQString &str) {
for(TQStringList::Iterator it = expression_history.begin(); it != expression_history.end(); ++it) {
if(*it == str) {
expression_history.erase(it);
break;
@ -193,13 +193,13 @@ void QalculateExpressionEdit::setAfterCompletionPosition() {
setCursorPosition(cpos_ac);
}
void QalculateExpressionEdit::insertCompletion(QListBoxItem *li) {
void QalculateExpressionEdit::insertCompletion(TQListBoxItem *li) {
ExpressionItem *item = ((QalculateExpressionEditListBoxItem*) li)->item;
setSelection(cstart, cend - cstart + 1);
QString str = completed_text;
TQString str = completed_text;
const ExpressionName *ename = NULL, *ename_r = NULL;
ename_r = &item->preferredInputName(false, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) this);
for(size_t name_i = 0; name_i <= item->countNames() && !ename; name_i++) {
@ -265,7 +265,7 @@ void QalculateExpressionEdit::insertCompletion(QListBoxItem *li) {
}
bool matchesExpressionItem(const QString &str, ExpressionItem *item) {
bool matchesExpressionItem(const TQString &str, ExpressionItem *item) {
bool b_match = false;
for(size_t name_i = 1; !b_match && name_i <= item->countNames(); name_i++) {
const ExpressionName *ename = &item->getName(name_i);
@ -282,7 +282,7 @@ bool matchesExpressionItem(const QString &str, ExpressionItem *item) {
return b_match;
}
void QalculateExpressionEdit::makeCompletion(const QString &str) {
void QalculateExpressionEdit::makeCompletion(const TQString &str) {
if(cursorPosition() <= 0 || str.isEmpty()) {
if(qalculateCompletionBox) {
qalculateCompletionBox->hide();
@ -292,7 +292,7 @@ void QalculateExpressionEdit::makeCompletion(const QString &str) {
}
uint start = (uint) cursorPosition();
cend = (int) start - 1;
QString str2 = str;
TQString str2 = str;
str2.truncate(start);
const char *cstr = str2.ascii();
bool non_number_before = false;
@ -385,7 +385,7 @@ void QalculateExpressionEdit::wrapSelection() {
}
}
void QalculateExpressionEdit::keyPressEvent(QKeyEvent *e) {
void QalculateExpressionEdit::keyPressEvent(TQKeyEvent *e) {
if(e->key() == Key_Enter || e->key() == Key_Return) {
if(b_main) {
mainWin->execute();
@ -626,10 +626,10 @@ void QalculateExpressionEdit::keyPressEvent(QKeyEvent *e) {
KLineEdit::keyPressEvent(e);
}
bool QalculateExpressionEdit::eventFilter(QObject *o, QEvent *ev) {
if(o == this && ev->type() == QEvent::KeyPress) {
QKeyEvent *e = static_cast<QKeyEvent *>(ev);
if((e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && qalculateCompletionBox && qalculateCompletionBox->isVisible()) {
bool QalculateExpressionEdit::eventFilter(TQObject *o, TQEvent *ev) {
if(o == this && ev->type() == TQEvent::KeyPress) {
TQKeyEvent *e = static_cast<TQKeyEvent *>(ev);
if((e->key() == TQt::Key_Return || e->key() == TQt::Key_Enter) && qalculateCompletionBox && qalculateCompletionBox->isVisible()) {
if(qalculateCompletionBox->selectedItem()) {
KCursor::autoHideEventFilter(this, ev);
e->accept();
@ -646,7 +646,7 @@ bool QalculateExpressionEdit::eventFilter(QObject *o, QEvent *ev) {
}
void set_title(ExpressionItem *item, QString &title) {
void set_title(ExpressionItem *item, TQString &title) {
if(item->type() != TYPE_VARIABLE || !item->title(false).empty()) {
title = item->title().c_str();
} else {
@ -748,7 +748,7 @@ string sub_suffix(const ExpressionName *ename) {
return str;
}
QString makeListName(ExpressionItem *item, QWidget *w, int *italic_index, bool *rich_text) {
TQString makeListName(ExpressionItem *item, TQWidget *w, int *italic_index, bool *rich_text) {
string str;
const ExpressionName *ename, *ename_r;
*rich_text = false;
@ -783,7 +783,7 @@ QString makeListName(ExpressionItem *item, QWidget *w, int *italic_index, bool *
return str.c_str();
}
QalculateExpressionEditListBoxItem::QalculateExpressionEditListBoxItem(ExpressionItem *eitem) : QListBoxItem() {
QalculateExpressionEditListBoxItem::QalculateExpressionEditListBoxItem(ExpressionItem *eitem) : TQListBoxItem() {
item = eitem;
italic_index = -1;
setText(makeListName(item, listBox(), &italic_index, &rich_text));
@ -793,13 +793,13 @@ QalculateExpressionEditListBoxItem::~QalculateExpressionEditListBoxItem() {
}
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
QString rPixelSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint maxPixels)
TQString rPixelSqueeze(const TQString& name, const TQFontMetrics& fontMetrics, uint maxPixels)
{
uint nameWidth = fontMetrics.width(name);
if (maxPixels < nameWidth)
{
QString tmp = name;
TQString tmp = name;
const uint em = fontMetrics.maxWidth();
maxPixels -= fontMetrics.width("...");
@ -822,18 +822,18 @@ QString rPixelSqueeze(const QString& name, const QFontMetrics& fontMetrics, uint
}
#endif
void QalculateExpressionEditListBoxItem::paint(QPainter *painter) {
void QalculateExpressionEditListBoxItem::paint(TQPainter *painter) {
int itemHeight = height(listBox());
int entryWidth = listBox()->width() - listBox()->style().pixelMetric(QStyle::PM_ScrollBarExtent) - 2 * listBox()->style().pixelMetric(QStyle::PM_DefaultFrameWidth);
int entryWidth = listBox()->width() - listBox()->style().pixelMetric(TQStyle::PM_ScrollBarExtent) - 2 * listBox()->style().pixelMetric(TQStyle::PM_DefaultFrameWidth);
int titleWidth = (entryWidth / 2) - 1;
int nameWidth = entryWidth - titleWidth - 2;
if(!text().isEmpty()) {
QString squeezedText;
TQString squeezedText;
if(rich_text) {
QSimpleRichText rt(text(), painter->font());
TQSimpleRichText rt(text(), painter->font());
rt.setWidth(entryWidth);
if(rt.widthUsed() > nameWidth - 1) {
squeezedText = text();
@ -843,11 +843,11 @@ void QalculateExpressionEditListBoxItem::paint(QPainter *painter) {
#else
squeezedText = KStringHandler::rPixelSqueeze(squeezedText, listBox()->fontMetrics(), nameWidth);
#endif
painter->drawText(0, 0, nameWidth, itemHeight, Qt::AlignLeft | Qt::AlignVCenter, squeezedText);
painter->drawText(0, 0, nameWidth, itemHeight, TQt::AlignLeft | TQt::AlignVCenter, squeezedText);
} else {
QColorGroup cg = listBox()->colorGroup();
cg.setColor(QColorGroup::Text, painter->pen().color());
rt.draw(painter, 1, 0, QRect(0, 0, nameWidth - 1, itemHeight), cg, &painter->brush());
TQColorGroup cg = listBox()->colorGroup();
cg.setColor(TQColorGroup::Text, painter->pen().color());
rt.draw(painter, 1, 0, TQRect(0, 0, nameWidth - 1, itemHeight), cg, &painter->brush());
}
} else {
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
@ -855,29 +855,29 @@ void QalculateExpressionEditListBoxItem::paint(QPainter *painter) {
#else
squeezedText = KStringHandler::rPixelSqueeze(text(), listBox()->fontMetrics(), nameWidth);
#endif
painter->drawText(0, 0, nameWidth, itemHeight, Qt::AlignLeft | Qt::AlignVCenter, squeezedText);
painter->drawText(0, 0, nameWidth, itemHeight, TQt::AlignLeft | TQt::AlignVCenter, squeezedText);
}
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
squeezedText = rPixelSqueeze(title, listBox()->fontMetrics(), titleWidth);
#else
squeezedText = KStringHandler::rPixelSqueeze(title, listBox()->fontMetrics(), titleWidth);
#endif
QFont font = painter->font();
TQFont font = painter->font();
font.setItalic(true);
painter->setFont(font);
painter->drawText(entryWidth - titleWidth, 0, titleWidth, itemHeight, Qt::AlignLeft | Qt::AlignVCenter, squeezedText);
painter->drawText(entryWidth - titleWidth, 0, titleWidth, itemHeight, TQt::AlignLeft | TQt::AlignVCenter, squeezedText);
}
}
int QalculateExpressionEditListBoxItem::height(const QListBox *lb) const {
int QalculateExpressionEditListBoxItem::height(const TQListBox *lb) const {
int h;
h = lb->fontMetrics().lineSpacing() + 4;
return QMAX(h, QApplication::globalStrut().height());
return TQMAX(h, TQApplication::globalStrut().height());
}
int QalculateExpressionEditListBoxItem::width(const QListBox *lb) const {
return QMAX(lb->fontMetrics().width(text()) + 6, QApplication::globalStrut().width());
int QalculateExpressionEditListBoxItem::width(const TQListBox *lb) const {
return TQMAX(lb->fontMetrics().width(text()) + 6, TQApplication::globalStrut().width());
}
bool QalculateExpressionEditListBoxItem::reuse(ExpressionItem *newItem) {
if(item == newItem) return false;
@ -888,17 +888,17 @@ bool QalculateExpressionEditListBoxItem::reuse(ExpressionItem *newItem) {
return true;
}
QalculateExpressionEditCompletionBox::QalculateExpressionEditCompletionBox(QWidget *parent, const char *name) : KCompletionBox(parent, name) {
QalculateExpressionEditCompletionBox::QalculateExpressionEditCompletionBox(TQWidget *parent, const char *name) : KCompletionBox(parent, name) {
}
QalculateExpressionEditCompletionBox::~QalculateExpressionEditCompletionBox() {
}
void QalculateExpressionEditCompletionBox::setItems(const QValueVector<ExpressionItem*>& items) {
void QalculateExpressionEditCompletionBox::setItems(const TQValueVector<ExpressionItem*>& items) {
bool block = signalsBlocked();
blockSignals(true);
QListBoxItem* item = firstItem();
TQListBoxItem* item = firstItem();
if(!item) {
insertItemList(items);
} else {
@ -907,12 +907,12 @@ void QalculateExpressionEditCompletionBox::setItems(const QValueVector<Expressio
//to reduce flicker
bool dirty = false;
#if QT_VERSION >= 0x030200
QValueVector<ExpressionItem*>::ConstIterator it = items.constBegin();
const QValueVector<ExpressionItem*>::ConstIterator itEnd = items.constEnd();
#if TQT_VERSION >= 0x030200
TQValueVector<ExpressionItem*>::ConstIterator it = items.constBegin();
const TQValueVector<ExpressionItem*>::ConstIterator itEnd = items.constEnd();
#else
QValueVector<ExpressionItem*>::ConstIterator it = items.begin();
const QValueVector<ExpressionItem*>::ConstIterator itEnd = items.end();
TQValueVector<ExpressionItem*>::ConstIterator it = items.begin();
const TQValueVector<ExpressionItem*>::ConstIterator itEnd = items.end();
#endif
for (; it != itEnd; ++it) {
@ -930,7 +930,7 @@ void QalculateExpressionEditCompletionBox::setItems(const QValueVector<Expressio
//If there is an unused item, mark as dirty -> less items now
if(item) dirty = true;
QListBoxItem* tmp = item;
TQListBoxItem* tmp = item;
while((item = tmp)) {
tmp = item->next();
delete item;
@ -952,21 +952,21 @@ void QalculateExpressionEditCompletionBox::setItems(const QValueVector<Expressio
blockSignals(block);
// Trigger d->down_workaround = true within KCompletionBox
QStringList dummy;
TQStringList dummy;
KCompletionBox::insertItems(dummy, 1);
}
void QalculateExpressionEditCompletionBox::insertItemList(const QValueVector<ExpressionItem*> & list, int index) {
void QalculateExpressionEditCompletionBox::insertItemList(const TQValueVector<ExpressionItem*> & list, int index) {
if(index < 0) index = count();
for(QValueVector<ExpressionItem*>::ConstIterator it = list.begin(); it != list.end(); ++it) {
for(TQValueVector<ExpressionItem*>::ConstIterator it = list.begin(); it != list.end(); ++it) {
insertItem(new QalculateExpressionEditListBoxItem(*it), index++);
}
}
void QalculateExpressionEdit::setCompletedItems() {
QString txt;
TQString txt;
if(qalculateCompletionBox && qalculateCompletionBox->isVisible()) {
// The popup is visible already - do the matching on the initial string,
// not on the currently selected one.
@ -979,9 +979,9 @@ void QalculateExpressionEdit::setCompletedItems() {
if(qalculateCompletionBox->isVisible()) {
bool wasSelected = qalculateCompletionBox->isSelected(qalculateCompletionBox->currentItem());
const QString currentSelection = qalculateCompletionBox->currentText();
const TQString currentSelection = qalculateCompletionBox->currentText();
qalculateCompletionBox->setItems(matched_items);
QListBoxItem* item = qalculateCompletionBox->findItem(currentSelection, Qt::ExactMatch);
TQListBoxItem* item = qalculateCompletionBox->findItem(currentSelection, TQt::ExactMatch);
// If no item is selected, that means the listbox hasn't been manipulated by the user yet,
// because it's not possible otherwise to have no selected item. In such case make
// always the first item current and unselected, so that the current item doesn't jump.
@ -1011,7 +1011,7 @@ void QalculateExpressionEdit::setCompletedItems() {
}
void QalculateExpressionEditCompletionBox::hideEvent(QHideEvent*) {
void QalculateExpressionEditCompletionBox::hideEvent(TQHideEvent*) {
emit hidden();
}

@ -23,13 +23,13 @@
#include <klineedit.h>
#include <kcompletionbox.h>
#include <kcompletion.h>
#include <qvaluevector.h>
#include <tqvaluevector.h>
class QStringList;
class QPopupMenu;
class TQStringList;
class TQPopupMenu;
class QalculateExpressionEditCompletionBox;
class ExpressionItem;
class QListBoxItem;
class TQListBoxItem;
class QalculateExpressionEdit : public KLineEdit {
@ -37,31 +37,31 @@ class QalculateExpressionEdit : public KLineEdit {
public:
QalculateExpressionEdit(bool connected_to_main_win, QWidget *parent = 0, const char *name = 0);
QalculateExpressionEdit(bool connected_to_main_win, TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateExpressionEdit();
QValueVector<ExpressionItem*> matched_items;
TQValueVector<ExpressionItem*> matched_items;
bool b_main;
QStringList expression_history;
TQStringList expression_history;
int expression_history_index;
bool dont_change_index;
QalculateExpressionEditCompletionBox *qalculateCompletionBox;
KCompletion *qalculateCompletion;
virtual bool eventFilter(QObject *o, QEvent *ev);
void keyPressEvent(QKeyEvent *e);
virtual bool eventFilter(TQObject *o, TQEvent *ev);
void keyPressEvent(TQKeyEvent *e);
public slots:
void onTextChanged(const QString&);
void addToHistory(const QString&);
void onTextChanged(const TQString&);
void addToHistory(const TQString&);
void wrapSelection();
void makeCompletion(const QString&);
void insertCompletion(QListBoxItem *li);
void makeCompletion(const TQString&);
void insertCompletion(TQListBoxItem *li);
void updateCompletion();
void setAfterCompletionPosition();
void cancelCompletion(const QString &str);
void cancelCompletion(const TQString &str);
void setCompletedItems();
void enableCompletion();
void disableCompletion();
@ -73,10 +73,10 @@ signals:
protected:
virtual QPopupMenu *createPopupMenu();
virtual void timerEvent(QTimerEvent*);
virtual TQPopupMenu *createPopupMenu();
virtual void timerEvent(TQTimerEvent*);
int cstart, cend, cpos_ac, prev_position, pos_timer;
QString completed_text;
TQString completed_text;
int pos_before_completion;
};
@ -87,17 +87,17 @@ class QalculateExpressionEditCompletionBox : public KCompletionBox {
public:
QalculateExpressionEditCompletionBox(QWidget *parent, const char *name = 0);
QalculateExpressionEditCompletionBox(TQWidget *parent, const char *name = 0);
virtual ~QalculateExpressionEditCompletionBox();
void insertItemList(const QValueVector<ExpressionItem*>& list, int index = -1);
void insertItemList(const TQValueVector<ExpressionItem*>& list, int index = -1);
public slots:
void setItems(const QValueVector<ExpressionItem*>& items);
void setItems(const TQValueVector<ExpressionItem*>& items);
protected:
void hideEvent(QHideEvent*);
void hideEvent(TQHideEvent*);
signals:

@ -21,13 +21,13 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditfunctiondialog.h"
#include <kpushbutton.h>
#include <qsplitter.h>
#include <qvbox.h>
#include <qhbox.h>
#include <tqsplitter.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <klistview.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <ktextbrowser.h>
#include <kapplication.h>
#include <kstdguiitem.h>
@ -36,19 +36,19 @@ extern tree_struct function_cats;
extern vector<void*> ia_functions;
extern PrintOptions printops;
QalculateFunctionsDialog::QalculateFunctionsDialog(QWidget *parent, const char *name) : KDialog(parent, name, false) {
QalculateFunctionsDialog::QalculateFunctionsDialog(TQWidget *parent, const char *name) : KDialog(parent, name, false) {
function_edit_dialog = NULL;
selected_category = "";
selected_function = NULL;
QHBoxLayout *layout = new QHBoxLayout(this, marginHint(), spacingHint());
TQHBoxLayout *layout = new TQHBoxLayout(this, marginHint(), spacingHint());
setCaption(i18n("Functions"));
QVBoxLayout *leftLayout = new QVBoxLayout(layout, spacingHint());
TQVBoxLayout *leftLayout = new TQVBoxLayout(layout, spacingHint());
QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
TQSplitter *splitter = new TQSplitter(TQt::Horizontal, this);
leftLayout->addWidget(splitter);
categoryView = new KListView(splitter);
@ -62,33 +62,33 @@ QalculateFunctionsDialog::QalculateFunctionsDialog(QWidget *parent, const char *
descriptionBrowser = new KTextBrowser(this);
leftLayout->addWidget(descriptionBrowser);
QVBoxLayout *buttonLayout = new QVBoxLayout(layout, spacingHint());
TQVBoxLayout *buttonLayout = new TQVBoxLayout(layout, spacingHint());
newButton = new QPushButton(i18n("New"), this);
newButton = new TQPushButton(i18n("New"), this);
buttonLayout->addWidget(newButton);
editButton = new QPushButton(i18n("Edit"), this);
editButton = new TQPushButton(i18n("Edit"), this);
editButton->setEnabled(false);
buttonLayout->addWidget(editButton);
deleteButton = new QPushButton(i18n("Delete"), this);
deleteButton = new TQPushButton(i18n("Delete"), this);
deleteButton->setEnabled(false);
buttonLayout->addWidget(deleteButton);
deactivateButton = new QPushButton(i18n("Deactivate"), this);
deactivateButton = new TQPushButton(i18n("Deactivate"), this);
deactivateButton->setEnabled(false);
buttonLayout->addWidget(deactivateButton);
insertButton = new QPushButton(i18n("Insert"), this);
insertButton = new TQPushButton(i18n("Insert"), this);
insertButton->setEnabled(false);
buttonLayout->addWidget(insertButton);
applyButton = new QPushButton(i18n("Apply"), this);
applyButton = new TQPushButton(i18n("Apply"), this);
applyButton->setEnabled(false);
buttonLayout->addWidget(applyButton);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
buttonLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
helpButton = new KPushButton(KStdGuiItem::help(), this);
buttonLayout->addWidget(helpButton);
buttonClose = new KPushButton(KStdGuiItem::close(), this);
buttonClose->setFocus();
buttonLayout->addWidget(buttonClose);
resize(QSize(675, 475).expandedTo(size()));
resize(TQSize(675, 475).expandedTo(size()));
connect(buttonClose, SIGNAL(clicked()), this, SLOT(close()));
connect(newButton, SIGNAL(clicked()), this, SLOT(newFunction()));
@ -98,7 +98,7 @@ QalculateFunctionsDialog::QalculateFunctionsDialog(QWidget *parent, const char *
connect(insertButton, SIGNAL(clicked()), this, SLOT(insertFunction()));
connect(applyButton, SIGNAL(clicked()), this, SLOT(applyFunction()));
connect(functionView, SIGNAL(selectionChanged()), this, SLOT(functionSelected()));
connect(functionView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(functionDoubleClicked(QListViewItem*)));
connect(functionView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(functionDoubleClicked(TQListViewItem*)));
connect(categoryView, SIGNAL(selectionChanged()), this, SLOT(categorySelected()));
connect(helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
@ -115,10 +115,10 @@ void QalculateFunctionsDialog::updateFunctionTree() {
functionItems.clear();
categoryItems.clear();
categoryView->clear();
QListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
TQListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
categoryItems[i] = i18n("All");
i->setOpen(true);
QString str;
TQString str;
tree_struct *item, *item2;
function_cats.it = function_cats.items.begin();
if(function_cats.it != function_cats.items.end()) {
@ -181,13 +181,13 @@ void QalculateFunctionsDialog::updateFunctionTree() {
if(!categoryView->selectedItem()) {
//if no category has been selected (previously selected has been renamed/deleted), select "All"
selected_category = i18n("All");
QListViewItemIterator it(categoryView);
TQListViewItemIterator it(categoryView);
if(it.current())
categoryView->setSelected(it.current(), true);
}
}
#define UPDATE_SELECTED_FUNCTION QListViewItem *i = functionView->selectedItem(); if(!i) return; selected_function = functionItems[i]; if(!selected_function) return;
#define UPDATE_SELECTED_FUNCTION TQListViewItem *i = functionView->selectedItem(); if(!i) return; selected_function = functionItems[i]; if(!selected_function) return;
#define CHECK_IF_FUNCTION_STILL_THERE if(!CALCULATOR->stillHasFunction(selected_function)) {KMessageBox::error(this, i18n("Function does not exist anymore.")); emit functionsChanged(); return;}
void QalculateFunctionsDialog::insertFunction() {
@ -227,7 +227,7 @@ void QalculateFunctionsDialog::editFunction() {
if(!function_edit_dialog) {
function_edit_dialog = new QalculateEditFunctionDialog(this);
}
MathFunction *f = function_edit_dialog->editFunction(QString::null, selected_function);
MathFunction *f = function_edit_dialog->editFunction(TQString::null, selected_function);
if(f) {
selected_function = f;
if(!f->isActive()) {
@ -250,7 +250,7 @@ void QalculateFunctionsDialog::newFunction() {
if(selected_category.isEmpty() || selected_category[0] != '/') {
f = function_edit_dialog->editFunction();
} else {
QString str = selected_category;
TQString str = selected_category;
str.remove(0, 1);
f = function_edit_dialog->editFunction(str);
}
@ -268,7 +268,7 @@ void QalculateFunctionsDialog::newFunction() {
}
}
void QalculateFunctionsDialog::functionDoubleClicked(QListViewItem*i) {
void QalculateFunctionsDialog::functionDoubleClicked(TQListViewItem*i) {
selected_function = functionItems[i];
if(!selected_function)
return;
@ -276,7 +276,7 @@ void QalculateFunctionsDialog::functionDoubleClicked(QListViewItem*i) {
if(!function_edit_dialog) {
function_edit_dialog = new QalculateEditFunctionDialog(this);
}
MathFunction *f = function_edit_dialog->editFunction(QString::null, selected_function);
MathFunction *f = function_edit_dialog->editFunction(TQString::null, selected_function);
if(f) {
selected_function = f;
if(!f->isActive()) {
@ -293,7 +293,7 @@ void QalculateFunctionsDialog::functionDoubleClicked(QListViewItem*i) {
void QalculateFunctionsDialog::functionSelected() {
QListViewItem *selected = functionView->selectedItem();
TQListViewItem *selected = functionView->selectedItem();
if(selected) {
MathFunction *f = functionItems[selected];
if(!CALCULATOR->stillHasFunction(f)) {
@ -317,7 +317,7 @@ void QalculateFunctionsDialog::functionSelected() {
Argument *arg;
Argument default_arg;
QString str, str2;
TQString str, str2;
const ExpressionName *ename = &f->preferredName(false, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) descriptionBrowser);
str += "<i><b>";
str += ename->name.c_str();
@ -342,7 +342,7 @@ void QalculateFunctionsDialog::functionSelected() {
} else {
str += i18n("argument");
str += " ";
str += QString::number(i2);
str += TQString::number(i2);
}
if(i2 > f->minargs()) {
str += "]";
@ -395,7 +395,7 @@ void QalculateFunctionsDialog::functionSelected() {
if(arg && !arg->name().empty()) {
str += arg->name().c_str();
} else {
str += QString::number(i2);
str += TQString::number(i2);
}
str += ": <i>";
if(arg) {
@ -483,7 +483,7 @@ void QalculateFunctionsDialog::functionSelected() {
}
void QalculateFunctionsDialog::addFunctionTreeItem(MathFunction *f) {
QListViewItem *i = new KListViewItem(functionView, f->title(true).c_str());
TQListViewItem *i = new KListViewItem(functionView, f->title(true).c_str());
functionItems[i] = f;
if(f == selected_function) {
functionView->setSelected(i, true);
@ -492,7 +492,7 @@ void QalculateFunctionsDialog::addFunctionTreeItem(MathFunction *f) {
void QalculateFunctionsDialog::categorySelected() {
QListViewItem *selected = categoryView->selectedItem();
TQListViewItem *selected = categoryView->selectedItem();
bool no_cat = false, b_all = false, b_inactive = false;
functionView->clear();
functionItems.clear();
@ -526,7 +526,7 @@ void QalculateFunctionsDialog::categorySelected() {
}
}
if(!selected_function || !functionView->selectedItem()) {
QListViewItemIterator it(functionView);
TQListViewItemIterator it(functionView);
if(it.current())
functionView->setSelected(it.current(), true);
}

@ -21,13 +21,13 @@
#define QALCULATEFUNCTIONSDIALOG_H
#include <kdialog.h>
#include <qmap.h>
#include <tqmap.h>
class MathFunction;
class QalculateEditFunctionDialog;
class KListView;
class QListViewItem;
class QPushButton;
class TQListViewItem;
class TQPushButton;
class KTextBrowser;
/**
@ -39,32 +39,32 @@ class QalculateFunctionsDialog : public KDialog {
public:
QalculateFunctionsDialog(QWidget *parent = 0, const char *name = 0);
QalculateFunctionsDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateFunctionsDialog();
QalculateEditFunctionDialog *function_edit_dialog;
QString selected_category;
TQString selected_category;
MathFunction *selected_function;
void addFunctionTreeItem(MathFunction *f);
QMap<QListViewItem*, MathFunction*> functionItems;
QMap<QListViewItem*, QString> categoryItems;
TQMap<TQListViewItem*, MathFunction*> functionItems;
TQMap<TQListViewItem*, TQString> categoryItems;
KListView *categoryView;
KListView *functionView;
QPushButton *newButton;
QPushButton *editButton;
QPushButton *deleteButton;
QPushButton *deactivateButton;
QPushButton *insertButton;
QPushButton *applyButton;
QPushButton *helpButton;
QPushButton *buttonClose;
TQPushButton *newButton;
TQPushButton *editButton;
TQPushButton *deleteButton;
TQPushButton *deactivateButton;
TQPushButton *insertButton;
TQPushButton *applyButton;
TQPushButton *helpButton;
TQPushButton *buttonClose;
KTextBrowser *descriptionBrowser;
public slots:
void updateFunctionTree();
void functionDoubleClicked(QListViewItem*);
void functionDoubleClicked(TQListViewItem*);
void functionSelected();
void categorySelected();
void insertFunction();

@ -20,64 +20,64 @@
#include "qalculateimportcsvdialog.h"
#include "qalculate_tde_utils.h"
#include <qlayout.h>
#include <tqlayout.h>
#include <kurlrequester.h>
#include <klineedit.h>
#include <qlabel.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <tqlabel.h>
#include <tqradiobutton.h>
#include <tqcheckbox.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qspinbox.h>
#include <qbuttongroup.h>
#include <tqspinbox.h>
#include <tqbuttongroup.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <kapplication.h>
extern tree_struct variable_cats;
QalculateImportCSVDialog::QalculateImportCSVDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Import CSV File"), Ok | Cancel | Help, Ok, true) {
QalculateImportCSVDialog::QalculateImportCSVDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Import CSV File"), Ok | Cancel | Help, Ok, true) {
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("File:"), mainWidget()), 0, 0);
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("File:"), mainWidget()), 0, 0);
fileEdit = new KURLRequester(mainWidget());
fileEdit->setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
fileEdit->setCaption(i18n("Import CSV File"));
grid->addWidget(fileEdit, 0, 1);
grid->addWidget(new QLabel(i18n("Import as:"), mainWidget()), 1, 0);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Import as:"), mainWidget()), 1, 0);
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addLayout(hbox, 1, 1);
QButtonGroup *group = new QButtonGroup();
matrixButton = new QRadioButton(i18n("Matrix"), mainWidget());
TQButtonGroup *group = new TQButtonGroup();
matrixButton = new TQRadioButton(i18n("Matrix"), mainWidget());
group->insert(matrixButton, 0);
hbox->addWidget(matrixButton);
matrixButton->setChecked(true);
vectorsButton = new QRadioButton(i18n("Vectors"), mainWidget());
vectorsButton = new TQRadioButton(i18n("Vectors"), mainWidget());
group->insert(vectorsButton, 1);
hbox->addWidget(vectorsButton);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
grid->addWidget(new QLabel(i18n("Name:"), mainWidget()), 2, 0);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
grid->addWidget(new TQLabel(i18n("Name:"), mainWidget()), 2, 0);
nameEdit = new KLineEdit(mainWidget());
grid->addWidget(nameEdit, 2, 1);
grid->addWidget(new QLabel(i18n("Descriptive name:"), mainWidget()), 3, 0);
grid->addWidget(new TQLabel(i18n("Descriptive name:"), mainWidget()), 3, 0);
titleEdit = new KLineEdit(mainWidget());
grid->addWidget(titleEdit, 3, 1);
grid->addWidget(new QLabel(i18n("Category:"), mainWidget()), 4, 0);
grid->addWidget(new TQLabel(i18n("Category:"), mainWidget()), 4, 0);
categoryCombo = new KComboBox(mainWidget());
categoryCombo->setMaximumWidth(250);
categoryCombo->setEditable(true);
grid->addWidget(categoryCombo, 4, 1);
grid->addWidget(new QLabel(i18n("First row:"), mainWidget()), 5, 0);
firstRowBox = new QSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(new TQLabel(i18n("First row:"), mainWidget()), 5, 0);
firstRowBox = new TQSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(firstRowBox, 5, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 6, 6, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
includesHeadingsButton = new QCheckBox(i18n("Includes headings"), mainWidget());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
includesHeadingsButton = new TQCheckBox(i18n("Includes headings"), mainWidget());
includesHeadingsButton->setChecked(true);
hbox->addWidget(includesHeadingsButton);
grid->addWidget(new QLabel(i18n("Delimiter:"), mainWidget()), 7, 0);
grid->addWidget(new TQLabel(i18n("Delimiter:"), mainWidget()), 7, 0);
delimiterCombo = new KComboBox(mainWidget());
delimiterCombo->setMaximumWidth(250);
delimiterCombo->insertItem(i18n("Comma"));
@ -92,7 +92,7 @@ QalculateImportCSVDialog::QalculateImportCSVDialog(QWidget *parent, const char *
otherDelimiterEdit->setEnabled(false);
connect(delimiterCombo, SIGNAL(activated(int)), this, SLOT(delimiterChanged(int)));
connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
}
@ -109,7 +109,7 @@ void QalculateImportCSVDialog::delimiterChanged(int i) {
void QalculateImportCSVDialog::slotOk() {
QString str = fileEdit->url().stripWhiteSpace();
TQString str = fileEdit->url().stripWhiteSpace();
if(str.isEmpty()) {
//no name -- open dialog again
fileEdit->setFocus();
@ -161,8 +161,8 @@ bool QalculateImportCSVDialog::importCSVFile() {
fileEdit->clear();
titleEdit->clear();
//QStringList cats;
QString catstr;
//TQStringList cats;
TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
variable_cats.it = variable_cats.items.begin();
@ -198,13 +198,13 @@ bool QalculateImportCSVDialog::importCSVFile() {
categoryCombo->lineEdit()->clear();
if(exec() == QDialog::Accepted) {
if(exec() == TQDialog::Accepted) {
return true;
}
return false;
}
void QalculateImportCSVDialog::nameChanged(const QString &name) {
void QalculateImportCSVDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->variableNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);

@ -24,9 +24,9 @@
class KLineEdit;
class KComboBox;
class QSpinBox;
class QCheckBox;
class QRadioButton;
class TQSpinBox;
class TQCheckBox;
class TQRadioButton;
class KURLRequester;
/**
@ -38,14 +38,14 @@ class QalculateImportCSVDialog : public KDialogBase {
public:
QalculateImportCSVDialog(QWidget *parent = 0, const char *name = 0);
QalculateImportCSVDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateImportCSVDialog();
KLineEdit *nameEdit, *titleEdit, *otherDelimiterEdit;
KComboBox *categoryCombo, *delimiterCombo;
QSpinBox *firstRowBox;
QCheckBox *includesHeadingsButton;
QRadioButton *matrixButton, *vectorsButton;
TQSpinBox *firstRowBox;
TQCheckBox *includesHeadingsButton;
TQRadioButton *matrixButton, *vectorsButton;
KURLRequester *fileEdit;
bool importCSVFile();
@ -53,7 +53,7 @@ public:
public slots:
void delimiterChanged(int);
void nameChanged(const QString&);
void nameChanged(const TQString&);
protected slots:

@ -19,19 +19,19 @@
***************************************************************************/
#include "qalculateinsertfunctiondialog.h"
#include "qalculate_tde_utils.h"
#include <qvbox.h>
#include <tqvbox.h>
#include <kactivelabel.h>
#include <klineedit.h>
#include <qlabel.h>
#include <qgrid.h>
#include <qhbox.h>
#include <tqlabel.h>
#include <tqgrid.h>
#include <tqhbox.h>
#include <klocale.h>
#include <qspinbox.h>
#include <tqspinbox.h>
#include <kcombobox.h>
#include <qhbuttongroup.h>
#include <qradiobutton.h>
#include <qstring.h>
#include <qpushbutton.h>
#include <tqhbuttongroup.h>
#include <tqradiobutton.h>
#include <tqstring.h>
#include <tqpushbutton.h>
#include <kdatepicker.h>
#include <kfiledialog.h>
#include <kdeversion.h>
@ -39,11 +39,11 @@
#include "buttonwithindexsignal.h"
#include "qalculateinsertmatrixvectordialog.h"
extern QWidget *expressionWidget;
extern TQWidget *expressionWidget;
extern PrintOptions printops;
extern EvaluationOptions evalops;
QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QWidget *parent, const QString &selected_text, const char *name) : KDialogBase(parent, name, true, f->title(true).c_str(), Ok|Apply|Cancel, Ok) {
QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, TQWidget *parent, const TQString &selected_text, const char *name) : KDialogBase(parent, name, true, f->title(true).c_str(), Ok|Apply|Cancel, Ok) {
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
setButtonOKText(i18n("Insert"));
@ -57,12 +57,12 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
setButtonApply(KGuiItem(i18n("Execute")));
#endif
mathFunction = f;
QVBox *box = makeVBoxMainWidget();
TQVBox *box = makeVBoxMainWidget();
box->setSpacing(12);
QString titlestr = "<font size=\"5\">";
TQString titlestr = "<font size=\"5\">";
titlestr += mathFunction->title(true).c_str();
titlestr += "</font>";
new QLabel(titlestr, box);
new TQLabel(titlestr, box);
int args = 0;
bool has_vector = false;
if(mathFunction->args() > 0) {
@ -74,14 +74,14 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
args = 1;
has_vector = true;
}
QGrid *table = new QGrid(3, box);
TQGrid *table = new TQGrid(3, box);
table->setSpacing(6);
table->setMargin(12);
table->setFrameStyle(QFrame::Sunken | QFrame::GroupBoxPanel);
table->setFrameStyle(TQFrame::Sunken | TQFrame::GroupBoxPanel);
label.resize(args);
entry.resize(args);
type_label.resize(args);
QString argstr, typestr, defstr, argtype;
TQString argstr, typestr, defstr, argtype;
//create argument entries
Argument *arg;
for(int i = 0; i < args; i++) {
@ -92,7 +92,7 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
} else {
argstr = i18n("Argument");
argstr += " ";
argstr += QString::number(i + 1);
argstr += TQString::number(i + 1);
argstr += ":";
}
} else {
@ -106,7 +106,7 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
defstr.remove(0, 1);
defstr.truncate(defstr.length() - 1);
}
label[i] = new QLabel(argstr, table);
label[i] = new TQLabel(argstr, table);
if(arg) {
switch(arg->type()) {
case ARGUMENT_TYPE_INTEGER: {
@ -118,9 +118,9 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
if(iarg->max()) {
max = iarg->max()->intValue();
}
QSpinBox *qsp = new QSpinBox(min, max, 1, table);
TQSpinBox *qsp = new TQSpinBox(min, max, 1, table);
entry[i] = qsp;
qsp->setButtonSymbols(QSpinBox::PlusMinus);
qsp->setButtonSymbols(TQSpinBox::PlusMinus);
int selected_value = 0;
bool convok = false;
if(i == 0 && !selected_text.isEmpty()) {
@ -129,7 +129,7 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
if(convok && selected_value >= min && selected_value <= max) {
qsp->setValue(selected_value);
} else if(!mathFunction->getDefaultValue(i + 1).empty()) {
qsp->setValue(QString(mathFunction->getDefaultValue(i + 1).c_str()).toInt());
qsp->setValue(TQString(mathFunction->getDefaultValue(i + 1).c_str()).toInt());
} else if(!arg->zeroForbidden() && min <= 0 && max >= 0) {
qsp->setValue(0);
} else {
@ -144,14 +144,14 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
break;
}
case ARGUMENT_TYPE_BOOLEAN: {
QHButtonGroup *bg = new QHButtonGroup(table);
TQHButtonGroup *bg = new TQHButtonGroup(table);
entry[i] = bg;
bg->setFrameStyle(QFrame::Plain | QFrame::NoFrame);
bg->setFrameStyle(TQFrame::Plain | TQFrame::NoFrame);
bg->setMargin(0);
bg->setRadioButtonExclusive(TRUE);
bg->insert(new QRadioButton(i18n("True"), bg), 1);
bg->insert(new QRadioButton(i18n("False"), bg), 0);
QString str = selected_text.stripWhiteSpace();
bg->insert(new TQRadioButton(i18n("True"), bg), 1);
bg->insert(new TQRadioButton(i18n("False"), bg), 0);
TQString str = selected_text.stripWhiteSpace();
if(i == 0 && str == "1") {
bg->setButton(1);
} else if(i == 0 && str == "0") {
@ -233,47 +233,47 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
typestr.remove(0, 1);
typestr.remove(typestr.length() - 1, 1);
type_label[i] = new ButtonWithIndexSignal(typestr, i, table);
QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectDate(int)));
TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectDate(int)));
break;
}
case ARGUMENT_TYPE_MATRIX: {
typestr.remove(0, 1);
typestr.remove(typestr.length() - 1, 1);
type_label[i] = new ButtonWithIndexSignal(typestr, i, table);
QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertMatrix(int)));
TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertMatrix(int)));
break;
}
case ARGUMENT_TYPE_VECTOR: {
typestr.remove(0, 1);
typestr.remove(typestr.length() - 1, 1);
type_label[i] = new ButtonWithIndexSignal(typestr, i, table);
QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertVector(int)));
TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertVector(int)));
break;
}
case ARGUMENT_TYPE_FILE: {
typestr.remove(0, 1);
typestr.remove(typestr.length() - 1, 1);
type_label[i] = new ButtonWithIndexSignal(typestr, i, table);
QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectFile(int)));
TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectFile(int)));
break;
}
default: {
type_label[i] = new QLabel(typestr, table);
type_label[i] = new TQLabel(typestr, table);
}
}
} else {
type_label[i] = new QLabel(typestr, table);
type_label[i] = new TQLabel(typestr, table);
}
if(i == 0) entry[0]->setFocus();
}
//display function description
if(!mathFunction->description().empty()) {
QString str = mathFunction->description().c_str();
TQString str = mathFunction->description().c_str();
str.replace("<", "&lt;");
str.replace(">", "&gt;");
str.replace("\n", "<br>");
KActiveLabel *descrLabel = new KActiveLabel(str, box);
descrLabel->setAlignment(Qt::AlignJustify);
descrLabel->setAlignment(TQt::AlignJustify);
enableButtonSeparator(true);
}
}
@ -281,8 +281,8 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW
QalculateInsertFunctionDialog::~QalculateInsertFunctionDialog() {
}
QString QalculateInsertFunctionDialog::functionExpression() {
QString str = mathFunction->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str(), str2;
TQString QalculateInsertFunctionDialog::functionExpression() {
TQString str = mathFunction->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str(), str2;
str += "(";
int args = 0;
if(mathFunction->args() > 0) {
@ -294,13 +294,13 @@ QString QalculateInsertFunctionDialog::functionExpression() {
}
for(int i = 0; i < args; i++) {
if(mathFunction->getArgumentDefinition(i + 1) && mathFunction->getArgumentDefinition(i + 1)->type() == ARGUMENT_TYPE_BOOLEAN) {
if(((QButtonGroup*) entry[i])->id(((QButtonGroup*) entry[i])->selected()) == 1) {
if(((TQButtonGroup*) entry[i])->id(((TQButtonGroup*) entry[i])->selected()) == 1) {
str2 = "1";
} else {
str2 = "0";
}
} else if(mathFunction->getArgumentDefinition(i + 1) && mathFunction->getArgumentDefinition(i + 1)->type() == ARGUMENT_TYPE_INTEGER) {
str2 = ((QSpinBox*) entry[i])->text();
str2 = ((TQSpinBox*) entry[i])->text();
} else if(mathFunction->subtype() == SUBTYPE_DATA_SET && mathFunction->getArgumentDefinition(i + 1) && mathFunction->getArgumentDefinition(i + 1)->type() == ARGUMENT_TYPE_DATA_PROPERTY) {
int index = ((KComboBox*) entry[i])->currentItem();
DataPropertyIter it;
@ -352,23 +352,23 @@ void QalculateInsertFunctionDialog::slotApply() {
void QalculateInsertFunctionDialog::selectDate(int index) {
KDialogBase *dialog = new KDialogBase(this, 0, true, i18n("Date"), Ok|Cancel);
KDatePicker *datePicker;
QDate date(QDate::fromString(((KLineEdit*) entry[index])->text(), Qt::ISODate));
TQDate date(TQDate::fromString(((KLineEdit*) entry[index])->text(), TQt::ISODate));
if(date.isValid()) datePicker = new KDatePicker(dialog->makeVBoxMainWidget(), date);
else datePicker = new KDatePicker(dialog->makeVBoxMainWidget());
if(dialog->exec() == QDialog::Accepted) {
((KLineEdit*) entry[index])->setText(datePicker->date().toString(Qt::ISODate));
if(dialog->exec() == TQDialog::Accepted) {
((KLineEdit*) entry[index])->setText(datePicker->date().toString(TQt::ISODate));
}
dialog->deleteLater();
}
void QalculateInsertFunctionDialog::selectFile(int index) {
QString filename = KFileDialog::getSaveFileName(((KLineEdit*) entry[index])->text(), QString::null, this, i18n("File"));
TQString filename = KFileDialog::getSaveFileName(((KLineEdit*) entry[index])->text(), TQString::null, this, i18n("File"));
if(!filename.isEmpty()) {
((KLineEdit*) entry[index])->setText(filename);
}
}
void QalculateInsertFunctionDialog::insertMatrix(int index) {
QalculateInsertMatrixVectorDialog *d = new QalculateInsertMatrixVectorDialog(this);
QString str = ((KLineEdit*) entry[index])->text();
TQString str = ((KLineEdit*) entry[index])->text();
MathStructure mstruct;
if(!str.isEmpty()) {
CALCULATOR->parse(&mstruct, CALCULATOR->unlocalizeExpression(str.ascii(), evalops.parse_options));
@ -385,7 +385,7 @@ void QalculateInsertFunctionDialog::insertMatrix(int index) {
}
void QalculateInsertFunctionDialog::insertVector(int index) {
QalculateInsertMatrixVectorDialog *d = new QalculateInsertMatrixVectorDialog(this);
QString str = ((KLineEdit*) entry[index])->text();
TQString str = ((KLineEdit*) entry[index])->text();
MathStructure mstruct;
if(!str.isEmpty()) {
CALCULATOR->parse(&mstruct, CALCULATOR->unlocalizeExpression(str.ascii(), evalops.parse_options));

@ -21,7 +21,7 @@
#define QALCULATEINSERTFUNCTIONDIALOG_H
#include <kdialogbase.h>
#include <qvaluevector.h>
#include <tqvaluevector.h>
class MathFunction;
@ -30,16 +30,16 @@ class QalculateInsertFunctionDialog : public KDialogBase {
public:
QalculateInsertFunctionDialog(MathFunction *f, QWidget *parent = 0, const QString &selected_text = QString::null, const char *name = 0);
QalculateInsertFunctionDialog(MathFunction *f, TQWidget *parent = 0, const TQString &selected_text = TQString::null, const char *name = 0);
virtual ~QalculateInsertFunctionDialog();
QString functionExpression();
TQString functionExpression();
MathFunction *mathFunction;
QValueVector<QWidget*> label;
QValueVector<QWidget*> entry;
QValueVector<QWidget*> type_label;
TQValueVector<TQWidget*> label;
TQValueVector<TQWidget*> entry;
TQValueVector<TQWidget*> type_label;
protected slots:

@ -20,79 +20,79 @@
#include "qalculateinsertmatrixvectordialog.h"
#include "qalculate_tde_utils.h"
#include <qtable.h>
#include <qgrid.h>
#include <tqtable.h>
#include <tqgrid.h>
#include <klineedit.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qcheckbox.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <tqcheckbox.h>
#include <kmessagebox.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <tqspinbox.h>
#include <tqlayout.h>
#include <tqbuttongroup.h>
#include <tqradiobutton.h>
#include <kapplication.h>
#include <kdeversion.h>
#include <kstdguiitem.h>
extern PrintOptions printops;
class QalculateInsertMatrixTableItem : public QTableItem {
class QalculateInsertMatrixTableItem : public TQTableItem {
public:
QalculateInsertMatrixTableItem(QTable *table);
QalculateInsertMatrixTableItem(QTable *table, const QString & text);
QalculateInsertMatrixTableItem(TQTable *table);
QalculateInsertMatrixTableItem(TQTable *table, const TQString & text);
int alignment() const;
};
class QalculateInsertMatrixTable : public QTable {
class QalculateInsertMatrixTable : public TQTable {
public:
QalculateInsertMatrixTable(QWidget *parent = 0, const char *name = 0) : QTable(parent, name) {}
QalculateInsertMatrixTable(int numRows, int numCols, QWidget *parent = 0, const char *name = 0) : QTable(numRows, numCols, parent, name) {}
QalculateInsertMatrixTable(TQWidget *parent = 0, const char *name = 0) : TQTable(parent, name) {}
QalculateInsertMatrixTable(int numRows, int numCols, TQWidget *parent = 0, const char *name = 0) : TQTable(numRows, numCols, parent, name) {}
QWidget *beginEdit(int row, int col, bool replace) {
QWidget *w = QTable::beginEdit(row, col, replace);
((QLineEdit*) w)->selectAll();
TQWidget *beginEdit(int row, int col, bool replace) {
TQWidget *w = TQTable::beginEdit(row, col, replace);
((TQLineEdit*) w)->selectAll();
return w;
}
};
QalculateInsertMatrixVectorDialog::QalculateInsertMatrixVectorDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | User1, Ok, true, KGuiItem(i18n("Insert Selection"))) {
QalculateInsertMatrixVectorDialog::QalculateInsertMatrixVectorDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Variable"), Ok | Cancel | User1, Ok, true, KGuiItem(i18n("Insert Selection"))) {
setMainWidget(new QWidget(this));
QGridLayout *grid = new QGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new QLabel(i18n("Rows:"), mainWidget()), 0, 0);
rowsBox = new QSpinBox(1, 1000, 1, mainWidget());
setMainWidget(new TQWidget(this));
TQGridLayout *grid = new TQGridLayout(mainWidget(), 1, 1, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Rows:"), mainWidget()), 0, 0);
rowsBox = new TQSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(rowsBox, 0, 1);
grid->addWidget(new QLabel(i18n("Columns:"), mainWidget()), 1, 0);
columnsBox = new QSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(new TQLabel(i18n("Columns:"), mainWidget()), 1, 0);
columnsBox = new TQSpinBox(1, 1000, 1, mainWidget());
grid->addWidget(columnsBox, 1, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 2, 2, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
QButtonGroup *group = new QButtonGroup();
matrixButton = new QRadioButton(i18n("Matrix"), mainWidget());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
TQButtonGroup *group = new TQButtonGroup();
matrixButton = new TQRadioButton(i18n("Matrix"), mainWidget());
group->insert(matrixButton, 0);
hbox->addWidget(matrixButton);
vectorButton = new QRadioButton(i18n("Vector"), mainWidget());
vectorButton = new TQRadioButton(i18n("Vector"), mainWidget());
group->insert(vectorButton, 1);
hbox->addWidget(vectorButton);
elementsLabel = new QLabel(i18n("Elements:"), mainWidget());
elementsLabel = new TQLabel(i18n("Elements:"), mainWidget());
grid->addMultiCellWidget(elementsLabel, 3, 3, 0, 1);
elementsTable = new QalculateInsertMatrixTable(0, 0, mainWidget());
grid->addMultiCellWidget(elementsTable, 4, 4, 0, 1);
elementsTable->setSelectionMode(QTable::Single);
elementsTable->setSelectionMode(TQTable::Single);
insertSelectionButton = actionButton(User1);
onSelectionChanged();
@ -151,10 +151,10 @@ void QalculateInsertMatrixVectorDialog::columnsChanged(int i) {
}
}
QString QalculateInsertMatrixVectorDialog::newVector() {
TQString QalculateInsertMatrixVectorDialog::newVector() {
return editMatrixVector(NULL, true);
}
QString QalculateInsertMatrixVectorDialog::newMatrix() {
TQString QalculateInsertMatrixVectorDialog::newMatrix() {
return editMatrixVector(NULL, false);
}
@ -167,7 +167,7 @@ void QalculateInsertMatrixVectorDialog::slotOk() {
for(int index_r = 0; index_r < r; index_r++) {
for(int index_c = 0; index_c < c; index_c++) {
if(!elementsTable->text(index_r, index_c).isEmpty()) {
QString str2 = elementsTable->text(index_r, index_c).stripWhiteSpace();
TQString str2 = elementsTable->text(index_r, index_c).stripWhiteSpace();
if(!str2.isEmpty()) {
if(b) {
matrixstr += CALCULATOR->getComma();
@ -209,14 +209,14 @@ void QalculateInsertMatrixVectorDialog::slotOk() {
accept();
}
void QalculateInsertMatrixVectorDialog::insertSelection() {
QTableSelection sel = elementsTable->selection(elementsTable->currentSelection());
TQTableSelection sel = elementsTable->selection(elementsTable->currentSelection());
if(vectorButton->isChecked()) {
bool b = false;
matrixstr = "[";
for(int index_r = sel.topRow(); index_r <= sel.bottomRow(); index_r++) {
for(int index_c = sel.leftCol(); index_c <= sel.rightCol(); index_c++) {
if(!elementsTable->text(index_r, index_c).isEmpty()) {
QString str2 = elementsTable->text(index_r, index_c).stripWhiteSpace();
TQString str2 = elementsTable->text(index_r, index_c).stripWhiteSpace();
if(!str2.isEmpty()) {
if(b) {
matrixstr += CALCULATOR->getComma();
@ -258,7 +258,7 @@ void QalculateInsertMatrixVectorDialog::insertSelection() {
accept();
}
QString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure *initial_value, bool create_vector, bool is_text_struct, bool is_result) {
TQString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure *initial_value, bool create_vector, bool is_text_struct, bool is_result) {
if(initial_value && !initial_value->isVector()) {
return NULL;
@ -368,14 +368,14 @@ QString QalculateInsertMatrixVectorDialog::editMatrixVector(const MathStructure
return matrixstr;
}
#if QT_VERSION >= 0x030200
QalculateInsertMatrixTableItem::QalculateInsertMatrixTableItem(QTable *table) : QTableItem(table, QTableItem::OnTyping) {}
#if TQT_VERSION >= 0x030200
QalculateInsertMatrixTableItem::QalculateInsertMatrixTableItem(TQTable *table) : TQTableItem(table, TQTableItem::OnTyping) {}
#else
QalculateInsertMatrixTableItem::QalculateInsertMatrixTableItem(QTable *table) : QTableItem(table, QTableItem::OnTyping, QString::null) {}
QalculateInsertMatrixTableItem::QalculateInsertMatrixTableItem(TQTable *table) : TQTableItem(table, TQTableItem::OnTyping, TQString::null) {}
#endif
QalculateInsertMatrixTableItem::QalculateInsertMatrixTableItem(QTable *table, const QString & text) : QTableItem(table, QTableItem::OnTyping, text) {}
QalculateInsertMatrixTableItem::QalculateInsertMatrixTableItem(TQTable *table, const TQString & text) : TQTableItem(table, TQTableItem::OnTyping, text) {}
int QalculateInsertMatrixTableItem::alignment() const {return Qt::AlignRight;}
int QalculateInsertMatrixTableItem::alignment() const {return TQt::AlignRight;}
#include "qalculateinsertmatrixvectordialog.moc"

@ -22,13 +22,13 @@
#include <kdialogbase.h>
class QTable;
class QLabel;
class QSpinBox;
class QRadioButton;
class TQTable;
class TQLabel;
class TQSpinBox;
class TQRadioButton;
class KComboBox;
class KLineEdit;
class QPushButton;
class TQPushButton;
class MathStructure;
class QalculateEditNamesDialog;
class KnownVariable;
@ -42,19 +42,19 @@ class QalculateInsertMatrixVectorDialog : public KDialogBase {
public:
QalculateInsertMatrixVectorDialog(QWidget *parent = 0, const char *name = 0);
QalculateInsertMatrixVectorDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateInsertMatrixVectorDialog();
QString newMatrix();
QString newVector();
QString editMatrixVector(const MathStructure *initial_value = NULL, bool create_vector = false, bool is_text_struct = false, bool is_result = false);
TQString newMatrix();
TQString newVector();
TQString editMatrixVector(const MathStructure *initial_value = NULL, bool create_vector = false, bool is_text_struct = false, bool is_result = false);
QLabel *elementsLabel;
QRadioButton *matrixButton, *vectorButton;
QTable *elementsTable;
QSpinBox *rowsBox, *columnsBox;
QString matrixstr;
QPushButton *insertSelectionButton;
TQLabel *elementsLabel;
TQRadioButton *matrixButton, *vectorButton;
TQTable *elementsTable;
TQSpinBox *rowsBox, *columnsBox;
TQString matrixstr;
TQPushButton *insertSelectionButton;
public slots:

@ -20,62 +20,62 @@
#include "qalculateperiodictabledialog.h"
#include "qalculate_tde_utils.h"
#include <klocale.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qtooltip.h>
#include <qcolor.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qgrid.h>
#include <tqlayout.h>
#include <tqlabel.h>
#include <tqtooltip.h>
#include <tqcolor.h>
#include <tqpushbutton.h>
#include <tqvbox.h>
#include <tqgrid.h>
#include "qalculatebuttonwithdata.h"
#include <kiconloader.h>
#include <qfontmetrics.h>
#include <tqfontmetrics.h>
#include <kactivelabel.h>
#include <qlineedit.h>
#include <tqlineedit.h>
extern PrintOptions printops;
extern QWidget *expressionWidget;
extern TQWidget *expressionWidget;
QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, const char *name)
QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(TQWidget *parent, const char *name)
: KDialogBase(parent, name, false, i18n("Periodic Table"), Close, Close, true) {
actionButton(Close)->setAutoDefault(false);
actionButton(Close)->setDefault(false);
grid = new QGridLayout(makeMainWidget(), 11, 20, 0, 1);
grid = new TQGridLayout(makeMainWidget(), 11, 20, 0, 1);
grid->addWidget(new QLabel("1", mainWidget()), 0, 1, Qt::AlignHCenter);
grid->addWidget(new QLabel("2", mainWidget()), 0, 2, Qt::AlignHCenter);
grid->addWidget(new QLabel("3", mainWidget()), 0, 4, Qt::AlignHCenter);
grid->addWidget(new QLabel("4", mainWidget()), 0, 5, Qt::AlignHCenter);
grid->addWidget(new QLabel("5", mainWidget()), 0, 6, Qt::AlignHCenter);
grid->addWidget(new QLabel("6", mainWidget()), 0, 7, Qt::AlignHCenter);
grid->addWidget(new QLabel("7", mainWidget()), 0, 8, Qt::AlignHCenter);
grid->addWidget(new QLabel("8", mainWidget()), 0, 9, Qt::AlignHCenter);
grid->addWidget(new QLabel("9", mainWidget()), 0, 10, Qt::AlignHCenter);
grid->addWidget(new QLabel("10", mainWidget()), 0, 11, Qt::AlignHCenter);
grid->addWidget(new QLabel("11", mainWidget()), 0, 12, Qt::AlignHCenter);
grid->addWidget(new QLabel("12", mainWidget()), 0, 13, Qt::AlignHCenter);
grid->addWidget(new QLabel("13", mainWidget()), 0, 14, Qt::AlignHCenter);
grid->addWidget(new QLabel("14", mainWidget()), 0, 15, Qt::AlignHCenter);
grid->addWidget(new QLabel("15", mainWidget()), 0, 16, Qt::AlignHCenter);
grid->addWidget(new QLabel("16", mainWidget()), 0, 17, Qt::AlignHCenter);
grid->addWidget(new QLabel("17", mainWidget()), 0, 18, Qt::AlignHCenter);
grid->addWidget(new QLabel("18", mainWidget()), 0, 19, Qt::AlignHCenter);
grid->addWidget(new TQLabel("1", mainWidget()), 0, 1, TQt::AlignHCenter);
grid->addWidget(new TQLabel("2", mainWidget()), 0, 2, TQt::AlignHCenter);
grid->addWidget(new TQLabel("3", mainWidget()), 0, 4, TQt::AlignHCenter);
grid->addWidget(new TQLabel("4", mainWidget()), 0, 5, TQt::AlignHCenter);
grid->addWidget(new TQLabel("5", mainWidget()), 0, 6, TQt::AlignHCenter);
grid->addWidget(new TQLabel("6", mainWidget()), 0, 7, TQt::AlignHCenter);
grid->addWidget(new TQLabel("7", mainWidget()), 0, 8, TQt::AlignHCenter);
grid->addWidget(new TQLabel("8", mainWidget()), 0, 9, TQt::AlignHCenter);
grid->addWidget(new TQLabel("9", mainWidget()), 0, 10, TQt::AlignHCenter);
grid->addWidget(new TQLabel("10", mainWidget()), 0, 11, TQt::AlignHCenter);
grid->addWidget(new TQLabel("11", mainWidget()), 0, 12, TQt::AlignHCenter);
grid->addWidget(new TQLabel("12", mainWidget()), 0, 13, TQt::AlignHCenter);
grid->addWidget(new TQLabel("13", mainWidget()), 0, 14, TQt::AlignHCenter);
grid->addWidget(new TQLabel("14", mainWidget()), 0, 15, TQt::AlignHCenter);
grid->addWidget(new TQLabel("15", mainWidget()), 0, 16, TQt::AlignHCenter);
grid->addWidget(new TQLabel("16", mainWidget()), 0, 17, TQt::AlignHCenter);
grid->addWidget(new TQLabel("17", mainWidget()), 0, 18, TQt::AlignHCenter);
grid->addWidget(new TQLabel("18", mainWidget()), 0, 19, TQt::AlignHCenter);
grid->addWidget(new QLabel("1 ", mainWidget()), 1, 0, Qt::AlignRight);
grid->addWidget(new QLabel("2 ", mainWidget()), 2, 0, Qt::AlignRight);
grid->addWidget(new QLabel("3 ", mainWidget()), 3, 0, Qt::AlignRight);
grid->addWidget(new QLabel("4 ", mainWidget()), 4, 0, Qt::AlignRight);
grid->addWidget(new QLabel("5 ", mainWidget()), 5, 0, Qt::AlignRight);
grid->addWidget(new QLabel("6 ", mainWidget()), 6, 0, Qt::AlignRight);
grid->addWidget(new QLabel("7 ", mainWidget()), 7, 0, Qt::AlignRight);
grid->addWidget(new TQLabel("1 ", mainWidget()), 1, 0, TQt::AlignRight);
grid->addWidget(new TQLabel("2 ", mainWidget()), 2, 0, TQt::AlignRight);
grid->addWidget(new TQLabel("3 ", mainWidget()), 3, 0, TQt::AlignRight);
grid->addWidget(new TQLabel("4 ", mainWidget()), 4, 0, TQt::AlignRight);
grid->addWidget(new TQLabel("5 ", mainWidget()), 5, 0, TQt::AlignRight);
grid->addWidget(new TQLabel("6 ", mainWidget()), 6, 0, TQt::AlignRight);
grid->addWidget(new TQLabel("7 ", mainWidget()), 7, 0, TQt::AlignRight);
grid->addWidget(new QLabel("*", mainWidget()), 6, 3, Qt::AlignRight);
grid->addWidget(new QLabel("**", mainWidget()), 7, 3, Qt::AlignRight);
grid->addWidget(new QLabel("*", mainWidget()), 9, 3, Qt::AlignRight);
grid->addWidget(new QLabel("**", mainWidget()), 10, 3, Qt::AlignRight);
grid->addWidget(new QLabel(" ", mainWidget()), 8, 0);
grid->addWidget(new TQLabel("*", mainWidget()), 6, 3, TQt::AlignRight);
grid->addWidget(new TQLabel("**", mainWidget()), 7, 3, TQt::AlignRight);
grid->addWidget(new TQLabel("*", mainWidget()), 9, 3, TQt::AlignRight);
grid->addWidget(new TQLabel("**", mainWidget()), 10, 3, TQt::AlignRight);
grid->addWidget(new TQLabel(" ", mainWidget()), 8, 0);
DataSet *dc = CALCULATOR->getDataSet("atom");
if(!dc) {
@ -83,7 +83,7 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
}
DataObject *e;
QalculateButtonWithData *e_button;
QString tip;
TQString tip;
DataProperty *p_xpos = dc->getProperty("x_pos");
DataProperty *p_ypos = dc->getProperty("y_pos");
DataProperty *p_weight = dc->getProperty("weight");
@ -92,7 +92,7 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
DataProperty *p_class = dc->getProperty("class");
DataProperty *p_name = dc->getProperty("name");
int x_pos = 0, y_pos = 0, group = 0;
QString weight;
TQString weight;
int w = -1;
for(size_t i = 1; i < 120; i++) {
e = dc->getObject(i2s(i));
@ -106,58 +106,58 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
group = s2i(e->getProperty(p_class));
switch(group) {
case 1: {
e_button->setPaletteBackgroundColor(QColor(0xee, 0xcc, 0xee));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xee, 0xcc, 0xee));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 2: {
e_button->setPaletteBackgroundColor(QColor(0xdd, 0xcc, 0xee));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xdd, 0xcc, 0xee));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 3: {
e_button->setPaletteBackgroundColor(QColor(0xdd, 0xdd, 0xff));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xdd, 0xdd, 0xff));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 4: {
e_button->setPaletteBackgroundColor(QColor(0xdd, 0xee, 0xff));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xdd, 0xee, 0xff));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 5: {
e_button->setPaletteBackgroundColor(QColor(0xcc, 0xee, 0xee));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xcc, 0xee, 0xee));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 6: {
e_button->setPaletteBackgroundColor(QColor(0xbb, 0xff, 0xbb));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xbb, 0xff, 0xbb));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 7: {
e_button->setPaletteBackgroundColor(QColor(0xee, 0xff, 0xdd));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xee, 0xff, 0xdd));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 8: {
e_button->setPaletteBackgroundColor(QColor(0xff, 0xff, 0xaa));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xff, 0xff, 0xaa));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 9: {
e_button->setPaletteBackgroundColor(QColor(0xff, 0xdd, 0xaa));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xff, 0xdd, 0xaa));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 10: {
e_button->setPaletteBackgroundColor(QColor(0xff, 0xcc, 0xdd));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xff, 0xcc, 0xdd));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 11: {
e_button->setPaletteBackgroundColor(QColor(0xaa, 0xee, 0xdd));
e_button->setPaletteForegroundColor(QColor(0, 0, 0));
e_button->setPaletteBackgroundColor(TQColor(0xaa, 0xee, 0xdd));
e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
}
@ -179,8 +179,8 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
tip += "\n";
tip += weight;
}
QToolTip::add(e_button, tip);
QObject::connect(e_button, SIGNAL(clickedWithData(void*)), this, SLOT(showElementInfo(void*)));
TQToolTip::add(e_button, tip);
TQObject::connect(e_button, SIGNAL(clickedWithData(void*)), this, SLOT(showElementInfo(void*)));
}
}
@ -192,22 +192,22 @@ void QalculatePeriodicTableDialog::showElementInfo(void *e) {
dialog->show();
}
QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Element Data"), Close, Close, true) {
QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Element Data"), Close, Close, true) {
setWFlags(getWFlags() | Qt::WDestructiveClose);
setWFlags(getWFlags() | TQt::WDestructiveClose);
e = element;
DataSet *ds = e->parentSet();
if(!ds) {
close();
return;
}
QVBox *vbox = makeVBoxMainWidget();
QVBox *vbox2 = new QVBox(vbox);
TQVBox *vbox = makeVBoxMainWidget();
TQVBox *vbox2 = new TQVBox(vbox);
DataProperty *p_number = ds->getProperty("number");
DataProperty *p_symbol = ds->getProperty("symbol");
DataProperty *p_class = ds->getProperty("class");
DataProperty *p_name = ds->getProperty("name");
QString str = "<div align=\"right\"><font size=4>"; str += e->getProperty(p_number).c_str(); str += "</font></div>";
TQString str = "<div align=\"right\"><font size=4>"; str += e->getProperty(p_number).c_str(); str += "</font></div>";
new KActiveLabel(str, vbox2);
str = "<font size=6>"; str += e->getProperty(p_symbol).c_str(); str += "</font>";
new KActiveLabel(str, vbox2);
@ -215,11 +215,11 @@ QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, QWid
new KActiveLabel(str, vbox2);
QalculateButtonWithData *button;
QGrid *grid = new QGrid(3, Qt::Horizontal, vbox);
TQGrid *grid = new TQGrid(3, TQt::Horizontal, vbox);
int group = s2i(e->getProperty(p_class));
if(group > 0) {
str = "<b>"; str += i18n("Classification"); str += ":"; str += "</b>";
new QLabel(str, grid);
new TQLabel(str, grid);
switch(group) {
case ALKALI_METALS: {str = i18n("Alkali Metal"); break;}
case ALKALI_EARTH_METALS: {str = i18n("Alkaline-Earth Metal"); break;}
@ -235,21 +235,21 @@ QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, QWid
default: {str = i18n("Unknown"); break;}
}
new KActiveLabel(str, grid);
new QFrame(grid);
new TQFrame(grid);
}
DataPropertyIter it;
DataProperty *dp = ds->getFirstProperty(&it);
QString sval;
TQString sval;
while(dp) {
if(!dp->isHidden() && dp != p_number && dp != p_class && dp != p_symbol && dp != p_name) {
sval = e->getPropertyDisplayString(dp).c_str();
if(!sval.isEmpty()) {
str = "<b>"; str += dp->title().c_str(); str += ":"; str += "</b>";
new QLabel(str, grid);
new TQLabel(str, grid);
new KActiveLabel(sval, grid);
button = new QalculateButtonWithData((void*) dp, QIconSet(SmallIcon("editpaste")), "", grid);
QObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertElementData(void*)));
button = new QalculateButtonWithData((void*) dp, TQIconSet(SmallIcon("editpaste")), "", grid);
TQObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertElementData(void*)));
}
}
dp = ds->getNextProperty(&it);
@ -261,7 +261,7 @@ void QalculateElementInfoDialog::insertElementData(void *data) {
DataProperty *dp = (DataProperty*) data;
DataSet *ds = dp->parentSet();
if(ds) {
QString str = ds->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str();
TQString str = ds->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str();
str += "(";
str += e->getProperty(ds->getPrimaryKeyProperty()).c_str();
str += CALCULATOR->getComma().c_str();

@ -21,9 +21,9 @@
#define QALCULATEPERIODICTABLEDIALOG_H
#include <kdialogbase.h>
#include <qpushbutton.h>
#include <tqpushbutton.h>
class QGridLayout;
class TQGridLayout;
class DataObject;
/**
@ -35,10 +35,10 @@ class QalculatePeriodicTableDialog : public KDialogBase {
public:
QalculatePeriodicTableDialog(QWidget *parent = 0, const char *name = 0);
QalculatePeriodicTableDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculatePeriodicTableDialog();
QGridLayout *grid;
TQGridLayout *grid;
public slots:
@ -52,7 +52,7 @@ class QalculateElementInfoDialog : public KDialogBase {
public:
QalculateElementInfoDialog(DataObject *element, QWidget *parent = 0, const char *name = 0);
QalculateElementInfoDialog(DataObject *element, TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateElementInfoDialog();
DataObject *e;

@ -23,19 +23,19 @@
#include <klineedit.h>
#include <kpushbutton.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <tqlabel.h>
#include <klocale.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
#include <qspinbox.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>
#include <tqbuttongroup.h>
#include <tqspinbox.h>
#include <kmessagebox.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <ktextedit.h>
#include <klistview.h>
#include <kdeversion.h>
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
#include <qtabwidget.h>
#include <tqtabwidget.h>
#else
#include <ktabwidget.h>
#endif
@ -46,22 +46,22 @@
extern PlotLegendPlacement default_plot_legend_placement;
extern bool default_plot_display_grid;
extern bool default_plot_full_border;
extern QString default_plot_min;
extern QString default_plot_max;
extern QString default_plot_step;
extern TQString default_plot_min;
extern TQString default_plot_max;
extern TQString default_plot_step;
extern int default_plot_sampling_rate;
extern bool default_plot_use_sampling_rate;
extern bool default_plot_rows;
extern int default_plot_type;
extern PlotStyle default_plot_style;
extern PlotSmoothing default_plot_smoothing;
extern QString default_plot_variable;
extern TQString default_plot_variable;
extern bool default_plot_color;
extern bool enable_plot_expression_completion;
extern EvaluationOptions evalops;
QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Plot"), User1 | Close | Help, Close, false, KStdGuiItem::save()) {
QalculatePlotDialog::QalculatePlotDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Plot"), User1 | Close | Help, Close, false, KStdGuiItem::save()) {
actionButton(Close)->setAutoDefault(false);
actionButton(Close)->setDefault(false);
@ -71,46 +71,46 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
actionButton(User1)->setEnabled(false);
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
tabs = new QTabWidget(this);
tabs = new TQTabWidget(this);
#else
tabs = new KTabWidget(this);
#endif
setMainWidget(tabs);
QWidget *page1 = new QWidget(this);
QWidget *page2 = new QWidget(this);
QWidget *page3 = new QWidget(this);
TQWidget *page1 = new TQWidget(this);
TQWidget *page2 = new TQWidget(this);
TQWidget *page3 = new TQWidget(this);
tabs->addTab(page1, i18n("Data"));
tabs->addTab(page2, i18n("Function Range"));
tabs->addTab(page3, i18n("Appearance"));
QGridLayout *grid = new QGridLayout(page1, 1, 1, spacingHint());
grid->addWidget(new QLabel(i18n("Title:"), page1), 0, 0);
TQGridLayout *grid = new TQGridLayout(page1, 1, 1, spacingHint());
grid->addWidget(new TQLabel(i18n("Title:"), page1), 0, 0);
seriesTitleEdit = new KLineEdit(page1);
grid->addWidget(seriesTitleEdit, 0, 1);
grid->addWidget(new QLabel(i18n("Expression:"), page1), 1, 0);
grid->addWidget(new TQLabel(i18n("Expression:"), page1), 1, 0);
expressionEdit = new QalculateExpressionEdit(false, page1);
if(!enable_plot_expression_completion) expressionEdit->disableCompletion();
expressionEdit->updateCompletion();
grid->addWidget(expressionEdit, 1, 1);
QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 2, 2, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
typeGroup = new QButtonGroup();
functionButton = new QRadioButton(i18n("Function"), page1);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
typeGroup = new TQButtonGroup();
functionButton = new TQRadioButton(i18n("Function"), page1);
typeGroup->insert(functionButton, 0);
hbox->addWidget(functionButton);
vectorMatrixButton = new QRadioButton(i18n("Vector/matrix"), page1);
vectorMatrixButton = new TQRadioButton(i18n("Vector/matrix"), page1);
typeGroup->insert(vectorMatrixButton, 1);
hbox->addWidget(vectorMatrixButton);
pairedMatrixButton = new QRadioButton(i18n("Paired matrix"), page1);
pairedMatrixButton = new TQRadioButton(i18n("Paired matrix"), page1);
typeGroup->insert(pairedMatrixButton, 2);
hbox->addWidget(pairedMatrixButton);
rowsButton = new QCheckBox(i18n("Rows"), page1);
rowsButton = new TQCheckBox(i18n("Rows"), page1);
hbox->addWidget(rowsButton);
xVariableLabel = new QLabel(i18n("X variable:"), page1);
xVariableLabel = new TQLabel(i18n("X variable:"), page1);
grid->addWidget(xVariableLabel, 3, 0);
xVariableEdit = new KLineEdit(page1);
grid->addWidget(xVariableEdit, 3, 1);
grid->addWidget(new QLabel(i18n("Style:"), page1), 4, 0);
grid->addWidget(new TQLabel(i18n("Style:"), page1), 4, 0);
styleCombo = new KComboBox(page1);
styleCombo->insertItem(i18n("Line"));
styleCombo->insertItem(i18n("Points"));
@ -121,7 +121,7 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
styleCombo->insertItem(i18n("Candlesticks"));
styleCombo->insertItem(i18n("Dots"));
grid->addWidget(styleCombo, 4, 1);
grid->addWidget(new QLabel(i18n("Smoothing:"), page1), 5, 0);
grid->addWidget(new TQLabel(i18n("Smoothing:"), page1), 5, 0);
smoothingCombo = new KComboBox(page1);
smoothingCombo->insertItem(i18n("None"));
smoothingCombo->insertItem(i18n("Monotonic"));
@ -129,25 +129,25 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
smoothingCombo->insertItem(i18n("Bezier"));
smoothingCombo->insertItem(i18n("Bezier (monotonic)"));
grid->addWidget(smoothingCombo, 5, 1);
grid->addWidget(new QLabel(i18n("Y-axis:"), page1), 6, 0);
hbox = new QHBoxLayout(0, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Y-axis:"), page1), 6, 0);
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addLayout(hbox, 6, 1);
QButtonGroup *group = new QButtonGroup();
primaryButton = new QRadioButton(i18n("Primary"), page1);
TQButtonGroup *group = new TQButtonGroup();
primaryButton = new TQRadioButton(i18n("Primary"), page1);
group->insert(primaryButton, 0);
hbox->addWidget(primaryButton);
secondaryButton = new QRadioButton(i18n("Secondary"), page1);
secondaryButton = new TQRadioButton(i18n("Secondary"), page1);
group->insert(secondaryButton, 1);
hbox->addWidget(secondaryButton);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 7, 7, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
addButton = new QPushButton(i18n("Add"), page1);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
addButton = new TQPushButton(i18n("Add"), page1);
hbox->addWidget(addButton);
modifyButton = new QPushButton(i18n("Modify"), page1);
modifyButton = new TQPushButton(i18n("Modify"), page1);
hbox->addWidget(modifyButton);
removeButton = new QPushButton(i18n("Remove"), page1);
removeButton = new TQPushButton(i18n("Remove"), page1);
hbox->addWidget(removeButton);
seriesView = new KListView(page1);
seriesView->addColumn(i18n("Title"));
@ -160,68 +160,68 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
seriesView->setSorting(-1);
grid->addMultiCellWidget(seriesView, 8, 8, 0, 1);
grid = new QGridLayout(page2, 1, 1, spacingHint());
grid->addWidget(new QLabel(i18n("Min:"), page2), 0, 0);
grid = new TQGridLayout(page2, 1, 1, spacingHint());
grid->addWidget(new TQLabel(i18n("Min:"), page2), 0, 0);
minEdit = new KLineEdit(page2);
grid->addWidget(minEdit, 0, 1);
grid->addWidget(new QLabel(i18n("Max:"), page2), 1, 0);
grid->addWidget(new TQLabel(i18n("Max:"), page2), 1, 0);
maxEdit = new KLineEdit(page2);
grid->addWidget(maxEdit, 1, 1);
rangeGroup = new QButtonGroup();
samplingRateButton = new QRadioButton(i18n("Sampling rate:"), page2);
rangeGroup = new TQButtonGroup();
samplingRateButton = new TQRadioButton(i18n("Sampling rate:"), page2);
rangeGroup->insert(samplingRateButton, 0);
grid->addWidget(samplingRateButton, 2, 0);
samplingRateBox = new QSpinBox(1, 10000, 10, page2);
samplingRateBox = new TQSpinBox(1, 10000, 10, page2);
grid->addWidget(samplingRateBox, 2, 1);
stepSizeButton = new QRadioButton(i18n("Step size:"), page2);
stepSizeButton = new TQRadioButton(i18n("Step size:"), page2);
rangeGroup->insert(stepSizeButton, 1);
grid->addWidget(stepSizeButton, 3, 0);
stepSizeEdit = new KLineEdit(page2);
grid->addWidget(stepSizeEdit, 3, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 4, 4, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
applyRangeButton = new KPushButton(KStdGuiItem::apply(), page2);
hbox->addWidget(applyRangeButton);
grid->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 5, 0);
grid->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding), 5, 0);
grid = new QGridLayout(page3, 1, 1, spacingHint());
grid->addWidget(new QLabel(i18n("Title:"), page3), 0, 0);
grid = new TQGridLayout(page3, 1, 1, spacingHint());
grid->addWidget(new TQLabel(i18n("Title:"), page3), 0, 0);
titleEdit = new KLineEdit(page3);
grid->addWidget(titleEdit, 0, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
gridButton = new QCheckBox(i18n("Display grid"), page3);
gridButton = new TQCheckBox(i18n("Display grid"), page3);
hbox->addWidget(gridButton);
fullBorderButton = new QCheckBox(i18n("Display full border"), page3);
fullBorderButton = new TQCheckBox(i18n("Display full border"), page3);
hbox->addWidget(fullBorderButton);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
logXButton = new QCheckBox(i18n("Logarithmic x scale:"), page3);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
logXButton = new TQCheckBox(i18n("Logarithmic x scale:"), page3);
grid->addWidget(logXButton, 2, 0);
logXBox = new QSpinBox(2, 100, 1, page3);
logXBox = new TQSpinBox(2, 100, 1, page3);
grid->addWidget(logXBox, 2, 1);
logYButton = new QCheckBox(i18n("Logarithmic y scale:"), page3);
logYButton = new TQCheckBox(i18n("Logarithmic y scale:"), page3);
grid->addWidget(logYButton, 3, 0);
logYBox = new QSpinBox(2, 100, 1, page3);
logYBox = new TQSpinBox(2, 100, 1, page3);
grid->addWidget(logYBox, 3, 1);
grid->addWidget(new QLabel(i18n("X-axis label:"), page3), 4, 0);
grid->addWidget(new TQLabel(i18n("X-axis label:"), page3), 4, 0);
xLabelEdit = new KLineEdit(page3);
grid->addWidget(xLabelEdit, 4, 1);
grid->addWidget(new QLabel(i18n("Y-axis label:"), page3), 5, 0);
grid->addWidget(new TQLabel(i18n("Y-axis label:"), page3), 5, 0);
yLabelEdit = new KLineEdit(page3);
grid->addWidget(yLabelEdit, 5, 1);
grid->addWidget(new QLabel(i18n("Color display:"), page3), 6, 0);
hbox = new QHBoxLayout(0, 0, spacingHint());
grid->addWidget(new TQLabel(i18n("Color display:"), page3), 6, 0);
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addLayout(hbox, 6, 1);
group = new QButtonGroup();
colorButton = new QRadioButton(i18n("Color"), page3);
group = new TQButtonGroup();
colorButton = new TQRadioButton(i18n("Color"), page3);
group->insert(colorButton, 0);
hbox->addWidget(colorButton);
monochromeButton = new QRadioButton(i18n("Monochrome"), page3);
monochromeButton = new TQRadioButton(i18n("Monochrome"), page3);
group->insert(monochromeButton, 1);
hbox->addWidget(monochromeButton);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
grid->addWidget(new QLabel(i18n("Legend placement:"), page3), 7, 0);
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
grid->addWidget(new TQLabel(i18n("Legend placement:"), page3), 7, 0);
legendPlacementCombo = new KComboBox(page3);
legendPlacementCombo->insertItem(i18n("Hide"));
legendPlacementCombo->insertItem(i18n("Top-left"));
@ -231,12 +231,12 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
legendPlacementCombo->insertItem(i18n("Below"));
legendPlacementCombo->insertItem(i18n("Outside"));
grid->addWidget(legendPlacementCombo, 7, 1);
hbox = new QHBoxLayout(0, 0, spacingHint());
hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 8, 8, 0, 1);
hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
applyAppearanceButton = new KPushButton(KStdGuiItem::apply(), page3);
hbox->addWidget(applyAppearanceButton);
grid->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 9, 0);
grid->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding), 9, 0);
primaryButton->setChecked(true);
modifyButton->setEnabled(false);
@ -303,7 +303,7 @@ QalculatePlotDialog::QalculatePlotDialog(QWidget *parent, const char *name) : KD
connect(applyRangeButton, SIGNAL(clicked()), this, SLOT(applyRange()));
connect(applyAppearanceButton, SIGNAL(clicked()), this, SLOT(applyAppearance()));
connect(seriesView, SIGNAL(selectionChanged()), this, SLOT(seriesSelected()));
connect(seriesView, SIGNAL(itemRenamed(QListViewItem*, const QString&, int)), this, SLOT(seriesItemRenamed(QListViewItem*, const QString&, int)));
connect(seriesView, SIGNAL(itemRenamed(TQListViewItem*, const TQString&, int)), this, SLOT(seriesItemRenamed(TQListViewItem*, const TQString&, int)));
connect(addButton, SIGNAL(clicked()), this, SLOT(addSeries()));
connect(modifyButton, SIGNAL(clicked()), this, SLOT(modifySeries()));
connect(removeButton, SIGNAL(clicked()), this, SLOT(removeSeries()));
@ -372,7 +372,7 @@ void QalculatePlotDialog::onClosing() {
removeButton->setEnabled(false);
actionButton(User1)->setEnabled(false);
QListViewItemIterator it(seriesView);
TQListViewItemIterator it(seriesView);
while(it.current()) {
MathStructure *y_vector = itemYVector[it.current()], *x_vector = itemXVector[it.current()];
if(y_vector) delete y_vector;
@ -394,7 +394,7 @@ void QalculatePlotDialog::onClosing() {
CALCULATOR->closeGnuplot();
}
void QalculatePlotDialog::seriesItemRenamed(QListViewItem *i, const QString &str, int col) {
void QalculatePlotDialog::seriesItemRenamed(TQListViewItem *i, const TQString &str, int col) {
if(!i) return;
if(col == 0) {
updatePlot();
@ -415,7 +415,7 @@ void QalculatePlotDialog::seriesItemRenamed(QListViewItem *i, const QString &str
seriesSelected();
}
void QalculatePlotDialog::seriesSelected() {
QListViewItem *i = seriesView->selectedItem();
TQListViewItem *i = seriesView->selectedItem();
if(i) {
modifyButton->setEnabled(true);
removeButton->setEnabled(true);
@ -444,7 +444,7 @@ void QalculatePlotDialog::typeChanged(int i) {
xVariableLabel->setEnabled(i != 1 && i != 2);
}
void QalculatePlotDialog::expressionActivated() {
QListViewItem *i = seriesView->selectedItem();
TQListViewItem *i = seriesView->selectedItem();
if(i) {
modifySeries();
} else {
@ -452,7 +452,7 @@ void QalculatePlotDialog::expressionActivated() {
}
}
void QalculatePlotDialog::addSeries() {
QString expression = expressionEdit->text();
TQString expression = expressionEdit->text();
if(expression.stripWhiteSpace().isEmpty()) {
expressionEdit->setFocus();
KMessageBox::error(this, i18n("Empty expression."));
@ -460,13 +460,13 @@ void QalculatePlotDialog::addSeries() {
}
int type = 0, axis = 1;
bool rows = false;
QString title = seriesTitleEdit->text();
TQString title = seriesTitleEdit->text();
if(vectorMatrixButton->isChecked()) {
type = 1;
} else if(pairedMatrixButton->isChecked()) {
type = 2;
}
QString str_x = xVariableEdit->text().stripWhiteSpace();
TQString str_x = xVariableEdit->text().stripWhiteSpace();
if(str_x.isEmpty() && type == 0) {
xVariableEdit->setFocus();
KMessageBox::error(this, i18n("Empty x variable."));
@ -485,7 +485,7 @@ void QalculatePlotDialog::addSeries() {
MathStructure *x_vector, *y_vector;
generatePlotSeries(&x_vector, &y_vector, type, expression.ascii(), str_x.ascii());
rows = rowsButton->isChecked();
QListViewItem *i = new KListViewItem(seriesView, seriesView->lastChild(), title, expression);
TQListViewItem *i = new KListViewItem(seriesView, seriesView->lastChild(), title, expression);
itemStyle[i] = styleCombo->currentItem();
itemSmoothing[i] = smoothingCombo->currentItem();
itemType[i] = type;
@ -498,22 +498,22 @@ void QalculatePlotDialog::addSeries() {
updatePlot();
}
void QalculatePlotDialog::modifySeries() {
QListViewItem *i = seriesView->selectedItem();
TQListViewItem *i = seriesView->selectedItem();
if(i) {
QString expression = expressionEdit->text();
TQString expression = expressionEdit->text();
if(expression.stripWhiteSpace().isEmpty()) {
expressionEdit->setFocus();
KMessageBox::error(this, i18n("Empty expression."));
return;
}
int type = 0, axis = 1;
QString title = seriesTitleEdit->text();
TQString title = seriesTitleEdit->text();
if(vectorMatrixButton->isChecked()) {
type = 1;
} else if(pairedMatrixButton->isChecked()) {
type = 2;
}
QString str_x = xVariableEdit->text().stripWhiteSpace();
TQString str_x = xVariableEdit->text().stripWhiteSpace();
if(str_x.isEmpty() && type == 0) {
xVariableEdit->setFocus();
KMessageBox::error(this, i18n("Empty x variable."));
@ -549,7 +549,7 @@ void QalculatePlotDialog::modifySeries() {
}
}
void QalculatePlotDialog::removeSeries() {
QListViewItem *i = seriesView->selectedItem();
TQListViewItem *i = seriesView->selectedItem();
if(i) {
MathStructure *x_vector = itemXVector[i], *y_vector = itemYVector[i];
if(x_vector) delete x_vector;
@ -569,7 +569,7 @@ void QalculatePlotDialog::removeSeries() {
}
}
void QalculatePlotDialog::applyRange() {
QListViewItemIterator it(seriesView);
TQListViewItemIterator it(seriesView);
while(it.current()) {
MathStructure *x_vector = itemXVector[it.current()], *y_vector = itemYVector[it.current()];
if(y_vector) delete y_vector;
@ -588,13 +588,13 @@ void QalculatePlotDialog::applyAppearance() {
}
bool QalculatePlotDialog::generatePlot(PlotParameters &pp, vector<MathStructure> &y_vectors, vector<MathStructure> &x_vectors, vector<PlotDataParameters*> &pdps) {
QListViewItemIterator it(seriesView);
TQListViewItemIterator it(seriesView);
if(!it.current()) {
return false;
}
while(it.current()) {
int count = 1;
QString title = it.current()->text(0), expression = it.current()->text(1);
TQString title = it.current()->text(0), expression = it.current()->text(1);
int style = itemStyle[it.current()];
int smoothing = itemSmoothing[it.current()];
int type = itemType[it.current()];
@ -715,19 +715,19 @@ bool QalculatePlotDialog::generatePlot(PlotParameters &pp, vector<MathStructure>
return true;
}
void QalculatePlotDialog::savePlot() {
QString title = titleEdit->text().ascii();
TQString title = titleEdit->text().ascii();
if(title.isEmpty()) {
title = "plot.png";
} else {
title += ".png";
}
QString filename;
TQString filename;
while(true) {
filename = KFileDialog::getSaveFileName(title, "image/png image/svg application/postscript image/x-eps /text/x-tex image/x-xfig", this, i18n("Save Image"));
if(filename.isEmpty()) {
return;
} else {
if(QFile::exists(filename)) {
if(TQFile::exists(filename)) {
if(KMessageBox::warningContinueCancel(this, i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?" ).arg(filename), i18n("Overwrite File?"), i18n( "&Overwrite" )) != KMessageBox::Cancel) {
break;
}

@ -21,20 +21,20 @@
#define QALCULATEPLOTDIALOG_H
#include <kdialogbase.h>
#include <qmap.h>
#include <qstring.h>
#include <tqmap.h>
#include <tqstring.h>
class KLineEdit;
class QCheckBox;
class QRadioButton;
class QSpinBox;
class QButtonGroup;
class TQCheckBox;
class TQRadioButton;
class TQSpinBox;
class TQButtonGroup;
class KComboBox;
class QPushButton;
class QTabWidget;
class TQPushButton;
class TQTabWidget;
class KListView;
class QLabel;
class QListViewItem;
class TQLabel;
class TQListViewItem;
class QalculateExpressionEdit;
#include "qalculate_tde_utils.h"
@ -48,32 +48,32 @@ class QalculatePlotDialog : public KDialogBase {
public:
QalculatePlotDialog(QWidget *parent = 0, const char *name = 0);
QalculatePlotDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculatePlotDialog();
QLabel *xVariableLabel;
TQLabel *xVariableLabel;
KLineEdit *seriesTitleEdit, *xVariableEdit, *minEdit, *maxEdit, *stepSizeEdit, *titleEdit, *xLabelEdit, *yLabelEdit;
QalculateExpressionEdit *expressionEdit;
QCheckBox *rowsButton, *gridButton, *fullBorderButton, *logXButton, *logYButton;
QRadioButton *functionButton, *vectorMatrixButton, *pairedMatrixButton, *primaryButton, *secondaryButton, *samplingRateButton, *stepSizeButton, *colorButton, *monochromeButton;
QSpinBox *samplingRateBox, *logXBox, *logYBox;
QButtonGroup *typeGroup, *rangeGroup;
TQCheckBox *rowsButton, *gridButton, *fullBorderButton, *logXButton, *logYButton;
TQRadioButton *functionButton, *vectorMatrixButton, *pairedMatrixButton, *primaryButton, *secondaryButton, *samplingRateButton, *stepSizeButton, *colorButton, *monochromeButton;
TQSpinBox *samplingRateBox, *logXBox, *logYBox;
TQButtonGroup *typeGroup, *rangeGroup;
KComboBox *styleCombo, *smoothingCombo, *legendPlacementCombo;
QPushButton *addButton, *modifyButton, *removeButton, *applyRangeButton, *applyAppearanceButton;
QTabWidget *tabs;
TQPushButton *addButton, *modifyButton, *removeButton, *applyRangeButton, *applyAppearanceButton;
TQTabWidget *tabs;
KListView *seriesView;
bool generatePlot(PlotParameters &pp, vector<MathStructure> &y_vectors, vector<MathStructure> &x_vectors, vector<PlotDataParameters*> &pdps);
void generatePlotSeries(MathStructure **x_vector, MathStructure **y_vector, int type, string str, string str_x);
QMap<QListViewItem*, int> itemStyle;
QMap<QListViewItem*, int> itemSmoothing;
QMap<QListViewItem*, int> itemType;
QMap<QListViewItem*, int> itemAxis;
QMap<QListViewItem*, bool> itemRows;
QMap<QListViewItem*, MathStructure*> itemXVector;
QMap<QListViewItem*, MathStructure*> itemYVector;
QMap<QListViewItem*, QString> itemXVariable;
TQMap<TQListViewItem*, int> itemStyle;
TQMap<TQListViewItem*, int> itemSmoothing;
TQMap<TQListViewItem*, int> itemType;
TQMap<TQListViewItem*, int> itemAxis;
TQMap<TQListViewItem*, bool> itemRows;
TQMap<TQListViewItem*, MathStructure*> itemXVector;
TQMap<TQListViewItem*, MathStructure*> itemYVector;
TQMap<TQListViewItem*, TQString> itemXVariable;
protected slots:
@ -82,7 +82,7 @@ protected slots:
public slots:
void onClosing();
void seriesItemRenamed(QListViewItem*, const QString&, int);
void seriesItemRenamed(TQListViewItem*, const TQString&, int);
void seriesSelected();
void rangeTypeChanged(int);
void typeChanged(int);

@ -19,31 +19,31 @@
***************************************************************************/
#include "qalculateprecisiondialog.h"
#include <qlabel.h>
#include <qspinbox.h>
#include <tqlabel.h>
#include <tqspinbox.h>
#include <klocale.h>
#include <qhbox.h>
#include <tqhbox.h>
#include <kguiitem.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <kpushbutton.h>
#include <kdeversion.h>
QalculatePrecisionDialog::QalculatePrecisionDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Precision"), Apply | Close, Close, true) {
QalculatePrecisionDialog::QalculatePrecisionDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Precision"), Apply | Close, Close, true) {
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
setButtonApplyText(i18n("Recalculate"));
#else
setButtonApply(KGuiItem(i18n("Recalculate")));
#endif
setMainWidget(new QWidget(this));
QHBoxLayout *box = new QHBoxLayout(mainWidget());
setMainWidget(new TQWidget(this));
TQHBoxLayout *box = new TQHBoxLayout(mainWidget());
box->setSpacing(spacingHint());
box->addWidget(new QLabel(i18n("Precision:"), mainWidget()));
precisionBox = new QSpinBox(1, 100000, 1, mainWidget());
precisionBox->setButtonSymbols(QSpinBox::PlusMinus);
box->addWidget(new TQLabel(i18n("Precision:"), mainWidget()));
precisionBox = new TQSpinBox(1, 100000, 1, mainWidget());
precisionBox->setButtonSymbols(TQSpinBox::PlusMinus);
box->addWidget(precisionBox);
resize(QSize(300, minimumSizeHint().height()).expandedTo(minimumSizeHint()));
resize(TQSize(300, minimumSizeHint().height()).expandedTo(minimumSizeHint()));
}

@ -22,7 +22,7 @@
#include <kdialogbase.h>
class QSpinBox;
class TQSpinBox;
/**
@author Niklas Knutsson
@ -33,10 +33,10 @@ class QalculatePrecisionDialog : public KDialogBase {
public:
QalculatePrecisionDialog(QWidget *parent = 0, const char *name = 0);
QalculatePrecisionDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculatePrecisionDialog();
QSpinBox *precisionBox;
TQSpinBox *precisionBox;
};

@ -21,24 +21,24 @@
#include "qalculate_tde_utils.h"
#include <klocale.h>
#include <qbuttongroup.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qradiobutton.h>
#include <qtooltip.h>
#include <tqbuttongroup.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqradiobutton.h>
#include <tqtooltip.h>
#include <kdeversion.h>
#if KDE_VERSION_MAJOR > 3 || KDE_VERSION_MINOR > 1
#include <kfontrequester.h>
#endif
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
#include <qtabwidget.h>
#include <tqtabwidget.h>
#else
#include <ktabwidget.h>
#endif
#include <qpushbutton.h>
#include <qfont.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <tqpushbutton.h>
#include <tqfont.h>
#include <tqpushbutton.h>
#include <tqlayout.h>
#include <kcolorbutton.h>
#include "kqalculate.h"
@ -47,29 +47,29 @@ extern PrintOptions printops;
extern EvaluationOptions evalops;
extern bool fetch_exchange_rates_at_startup, save_mode_on_exit, save_defs_on_exit;
extern bool use_custom_result_font, use_custom_expression_font, use_custom_status_font;
extern QString custom_result_font, custom_expression_font, custom_status_font;
extern QWidget *expressionWidget, *resultWidget, *statusWidget_l;
extern TQString custom_result_font, custom_expression_font, custom_status_font;
extern TQWidget *expressionWidget, *resultWidget, *statusWidget_l;
extern bool close_to_systray;
extern bool display_expression_status;
extern QColor status_error_color;
extern QColor status_warning_color;
extern TQColor status_error_color;
extern TQColor status_warning_color;
extern int use_icon_buttons;
extern bool rpn_keypad_only;
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
#include <kfontdialog.h>
class KFontRequester : public QWidget
class KFontRequester : public TQWidget
{
Q_OBJECT
public:
KFontRequester( QWidget *parent=0L, const char *name=0L,
KFontRequester( TQWidget *parent=0L, const char *name=0L,
bool onlyFixed=false );
QFont font() const { return m_selFont; }
virtual void setFont( const QFont &font, bool onlyFixed=false );
TQFont font() const { return m_selFont; }
virtual void setFont( const TQFont &font, bool onlyFixed=false );
protected:
@ -82,24 +82,24 @@ class KFontRequester : public QWidget
protected:
bool m_onlyFixed;
QString m_sampleText, m_title;
QLabel *m_sampleLabel;
QPushButton *m_button;
QFont m_selFont;
TQString m_sampleText, m_title;
TQLabel *m_sampleLabel;
TQPushButton *m_button;
TQFont m_selFont;
};
KFontRequester::KFontRequester( QWidget *parent, const char *name,
bool onlyFixed ) : QWidget( parent, name ),
KFontRequester::KFontRequester( TQWidget *parent, const char *name,
bool onlyFixed ) : TQWidget( parent, name ),
m_onlyFixed( onlyFixed )
{
QHBoxLayout *layout = new QHBoxLayout( this, 0, KDialog::spacingHint() );
TQHBoxLayout *layout = new TQHBoxLayout( this, 0, KDialog::spacingHint() );
m_sampleLabel = new QLabel( this, "m_sampleLabel" );
m_button = new QPushButton( i18n( "Choose..." ), this, "m_button" );
m_sampleLabel = new TQLabel( this, "m_sampleLabel" );
m_button = new TQPushButton( i18n( "Choose..." ), this, "m_button" );
m_sampleLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
m_sampleLabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
setFocusProxy( m_button );
layout->addWidget( m_sampleLabel, 1 );
@ -111,7 +111,7 @@ KFontRequester::KFontRequester( QWidget *parent, const char *name,
}
void KFontRequester::setFont( const QFont &font, bool onlyFixed )
void KFontRequester::setFont( const TQFont &font, bool onlyFixed )
{
m_selFont = font;
m_onlyFixed = onlyFixed;
@ -137,124 +137,124 @@ void KFontRequester::displaySampleText()
size = m_selFont.pixelSize();
if ( m_sampleText.isEmpty() )
m_sampleLabel->setText( QString( "%1 %2" ).arg( m_selFont.family() )
m_sampleLabel->setText( TQString( "%1 %2" ).arg( m_selFont.family() )
.arg( size ) );
else
m_sampleLabel->setText( m_sampleText );
}
#endif
QalculatePreferencesDialog::QalculatePreferencesDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Preferences"), Ok | Apply | Cancel, Ok, false) {
QalculatePreferencesDialog::QalculatePreferencesDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Preferences"), Ok | Apply | Cancel, Ok, false) {
#if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2
QTabWidget *tabs = new QTabWidget(this);
TQTabWidget *tabs = new TQTabWidget(this);
#else
QTabWidget *tabs = new KTabWidget(this);
TQTabWidget *tabs = new KTabWidget(this);
#endif
setMainWidget(tabs);
QWidget *page1 = new QWidget(this);
QWidget *page2 = new QWidget(this);
TQWidget *page1 = new TQWidget(this);
TQWidget *page2 = new TQWidget(this);
tabs->addTab(page1, i18n("General"));
tabs->addTab(page2, i18n("Fonts"));
QVBoxLayout *vbox = new QVBoxLayout(page1, spacingHint());
systrayButton = new QCheckBox(i18n("Close to system tray"), page1);
QToolTip::add(systrayButton, i18n("If the application will reside in the system tray when the window is closed"));
TQVBoxLayout *vbox = new TQVBoxLayout(page1, spacingHint());
systrayButton = new TQCheckBox(i18n("Close to system tray"), page1);
TQToolTip::add(systrayButton, i18n("If the application will reside in the system tray when the window is closed"));
vbox->addWidget(systrayButton);
statusButton = new QCheckBox(i18n("Display expression status"), page1);
QToolTip::add(statusButton, i18n("If as-you-type expression status shall be displayed below the expression entry"));
statusButton = new TQCheckBox(i18n("Display expression status"), page1);
TQToolTip::add(statusButton, i18n("If as-you-type expression status shall be displayed below the expression entry"));
vbox->addWidget(statusButton);
iconsButton = new QCheckBox(i18n("Use icon buttons"), page1);
QToolTip::add(iconsButton, i18n("Use icons instead of text on the top-right buttons. The third state uses the style setting for icons on buttons."));
iconsButton = new TQCheckBox(i18n("Use icon buttons"), page1);
TQToolTip::add(iconsButton, i18n("Use icons instead of text on the top-right buttons. The third state uses the style setting for icons on buttons."));
iconsButton->setTristate(true);
vbox->addWidget(iconsButton);
fetchExchangeRatesButton = new QCheckBox(i18n("Update exchange rates on start"), page1);
QToolTip::add(fetchExchangeRatesButton, i18n("If current exchange rates shall be downloaded from the internet at program start"));
fetchExchangeRatesButton = new TQCheckBox(i18n("Update exchange rates on start"), page1);
TQToolTip::add(fetchExchangeRatesButton, i18n("If current exchange rates shall be downloaded from the internet at program start"));
vbox->addWidget(fetchExchangeRatesButton);
saveModeButton = new QCheckBox(i18n("Save mode on exit"), page1);
QToolTip::add(saveModeButton, i18n("If the mode of the calculator shall be restored"));
saveModeButton = new TQCheckBox(i18n("Save mode on exit"), page1);
TQToolTip::add(saveModeButton, i18n("If the mode of the calculator shall be restored"));
vbox->addWidget(saveModeButton);
saveDefsButton = new QCheckBox(i18n("Save definitions on exit"), page1);
QToolTip::add(saveDefsButton, i18n("If changes to functions, units and variables shall be saved automatically"));
saveDefsButton = new TQCheckBox(i18n("Save definitions on exit"), page1);
TQToolTip::add(saveDefsButton, i18n("If changes to functions, units and variables shall be saved automatically"));
vbox->addWidget(saveDefsButton);
rpnKeypadOnlyButton = new QCheckBox(i18n("Use only keypad keys for RPN"), page1);
QToolTip::add(rpnKeypadOnlyButton, i18n("Use only keypad keys for RPN operations (+-*/^) and use the rest of the keyboard for expression entry"));
rpnKeypadOnlyButton = new TQCheckBox(i18n("Use only keypad keys for RPN"), page1);
TQToolTip::add(rpnKeypadOnlyButton, i18n("Use only keypad keys for RPN operations (+-*/^) and use the rest of the keyboard for expression entry"));
vbox->addWidget(rpnKeypadOnlyButton);
dotAsSeparatorButton = new QCheckBox(i18n("Ignores dots in numbers"), page1);
QToolTip::add(dotAsSeparatorButton, i18n("Allow dots, '.', to be used as thousands separator instead of as an alternative to decimal sign"));
dotAsSeparatorButton = new TQCheckBox(i18n("Ignores dots in numbers"), page1);
TQToolTip::add(dotAsSeparatorButton, i18n("Allow dots, '.', to be used as thousands separator instead of as an alternative to decimal sign"));
if(CALCULATOR->getDecimalPoint() == ".") dotAsSeparatorButton->hide();
vbox->addWidget(dotAsSeparatorButton);
unicodeButton = new QCheckBox(i18n("Enable unicode signs"), page1);
QToolTip::add(unicodeButton, i18n("Disable this if you have problems with some fancy characters"));
unicodeButton = new TQCheckBox(i18n("Enable unicode signs"), page1);
TQToolTip::add(unicodeButton, i18n("Disable this if you have problems with some fancy characters"));
vbox->addWidget(unicodeButton);
lowerCaseButton = new QCheckBox(i18n("Use lower case in numbers"), page1);
QToolTip::add(lowerCaseButton, i18n("If lower case letters should be used in numbers with non-decimal base"));
lowerCaseButton = new TQCheckBox(i18n("Use lower case in numbers"), page1);
TQToolTip::add(lowerCaseButton, i18n("If lower case letters should be used in numbers with non-decimal base"));
vbox->addWidget(lowerCaseButton);
lowerCaseEButton = new QCheckBox(i18n("Use lower case \"e\""), page1);
QToolTip::add(lowerCaseEButton, i18n("If \"e\"; shall be used instead of \"E\" in numbers"));
lowerCaseEButton = new TQCheckBox(i18n("Use lower case \"e\""), page1);
TQToolTip::add(lowerCaseEButton, i18n("If \"e\"; shall be used instead of \"E\" in numbers"));
vbox->addWidget(lowerCaseEButton);
alternativeBasePrefixButton = new QCheckBox(i18n("Alternative base prefixes"), page1);
QToolTip::add(alternativeBasePrefixButton, i18n("If hexadecimal numbers shall be displayed with \"0x0\" and binary numbers with \"0b00\" as prefixes"));
alternativeBasePrefixButton = new TQCheckBox(i18n("Alternative base prefixes"), page1);
TQToolTip::add(alternativeBasePrefixButton, i18n("If hexadecimal numbers shall be displayed with \"0x0\" and binary numbers with \"0b00\" as prefixes"));
vbox->addWidget(alternativeBasePrefixButton);
spellOutLogicalOperatorsButton = new QCheckBox(i18n("Spell out logical operators"), page1);
QToolTip::add(spellOutLogicalOperatorsButton, i18n("If logical and/or shall be displayed as \"&&\"/\"||\" or \"and\"/\"or\""));
spellOutLogicalOperatorsButton = new TQCheckBox(i18n("Spell out logical operators"), page1);
TQToolTip::add(spellOutLogicalOperatorsButton, i18n("If logical and/or shall be displayed as \"&&\"/\"||\" or \"and\"/\"or\""));
vbox->addWidget(spellOutLogicalOperatorsButton);
QGridLayout *grid = new QGridLayout(vbox);
multiplicationLabel = new QLabel(i18n("Multiplication sign:"), page1);
TQGridLayout *grid = new TQGridLayout(vbox);
multiplicationLabel = new TQLabel(i18n("Multiplication sign:"), page1);
grid->addWidget(multiplicationLabel, 0, 0);
QButtonGroup *group = new QButtonGroup();
dotButton = new QRadioButton(SIGN_MULTIDOT, page1);
TQButtonGroup *group = new TQButtonGroup();
dotButton = new TQRadioButton(SIGN_MULTIDOT, page1);
group->insert(dotButton, 0);
grid->addWidget(dotButton, 0, 1);
exButton = new QRadioButton(SIGN_MULTIPLICATION, page1);
exButton = new TQRadioButton(SIGN_MULTIPLICATION, page1);
group->insert(exButton, 1);
grid->addWidget(exButton, 0, 2);
asteriskButton = new QRadioButton("*", page1);
asteriskButton = new TQRadioButton("*", page1);
group->insert(asteriskButton, 2);
grid->addWidget(asteriskButton, 0, 3);
divisionLabel = new QLabel(i18n("Division sign:"), page1);
divisionLabel = new TQLabel(i18n("Division sign:"), page1);
grid->addWidget(divisionLabel, 1, 0);
group = new QButtonGroup();
divisionSlashButton = new QRadioButton(" " SIGN_DIVISION_SLASH " ", page1);
group = new TQButtonGroup();
divisionSlashButton = new TQRadioButton(" " SIGN_DIVISION_SLASH " ", page1);
group->insert(divisionSlashButton, 0);
grid->addWidget(divisionSlashButton, 1, 1);
divisionButton = new QRadioButton(SIGN_DIVISION, page1);
divisionButton = new TQRadioButton(SIGN_DIVISION, page1);
group->insert(divisionButton, 1);
grid->addWidget(divisionButton, 1, 2);
slashButton = new QRadioButton("/", page1);
slashButton = new TQRadioButton("/", page1);
group->insert(slashButton, 2);
grid->addWidget(slashButton, 1, 3);
vbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
vbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
vbox = new QVBoxLayout(page2, spacingHint());
useCustomResultFontButton = new QCheckBox(i18n("Custom result font"), page2);
vbox = new TQVBoxLayout(page2, spacingHint());
useCustomResultFontButton = new TQCheckBox(i18n("Custom result font"), page2);
vbox->addWidget(useCustomResultFontButton);
resultFontEdit = new KFontRequester(page2);
vbox->addWidget(resultFontEdit);
useCustomExpressionFontButton = new QCheckBox(i18n("Custom expression font"), page2);
useCustomExpressionFontButton = new TQCheckBox(i18n("Custom expression font"), page2);
vbox->addWidget(useCustomExpressionFontButton);
expressionFontEdit = new KFontRequester(page2);
vbox->addWidget(expressionFontEdit);
useCustomStatusFontButton = new QCheckBox(i18n("Custom status font"), page2);
useCustomStatusFontButton = new TQCheckBox(i18n("Custom status font"), page2);
vbox->addWidget(useCustomStatusFontButton);
statusFontEdit = new KFontRequester(page2);
vbox->addWidget(statusFontEdit);
grid = new QGridLayout(vbox);
grid->addWidget(new QLabel(i18n("Status error color:"), page2), 0, 0);
grid = new TQGridLayout(vbox);
grid->addWidget(new TQLabel(i18n("Status error color:"), page2), 0, 0);
#if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR < 1
statusErrorColorButton = new KColorButton(page2);
#else
statusErrorColorButton = new KColorButton("red", "red", page2);
#endif
grid->addWidget(statusErrorColorButton, 0, 1);
grid->addWidget(new QLabel(i18n("Status warning color:"), page2), 1, 0);
grid->addWidget(new TQLabel(i18n("Status warning color:"), page2), 1, 0);
#if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR < 1
statusWarningColorButton = new KColorButton(page2);
#else
statusWarningColorButton = new KColorButton("blue", "blue", page2);
#endif
grid->addWidget(statusWarningColorButton, 1, 1);
vbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
vbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
connect(useCustomResultFontButton, SIGNAL(toggled(bool)), resultFontEdit, SLOT(setEnabled(bool)));
@ -279,15 +279,15 @@ void QalculatePreferencesDialog::slotApply() {
close_to_systray = systrayButton->isChecked();
display_expression_status = statusButton->isChecked();
switch(iconsButton->state()) {
case QButton::Off: {
case TQButton::Off: {
use_icon_buttons = 0;
break;
}
case QButton::On: {
case TQButton::On: {
use_icon_buttons = 1;
break;
}
case QButton::NoChange: {
case TQButton::NoChange: {
use_icon_buttons = -1;
break;
}
@ -349,15 +349,15 @@ bool QalculatePreferencesDialog::editPreferences() {
useCustomResultFontButton->setChecked(use_custom_result_font);
useCustomExpressionFontButton->setChecked(use_custom_expression_font);
useCustomStatusFontButton->setChecked(use_custom_status_font);
QFont font1(resultWidget->font());
TQFont font1(resultWidget->font());
font1.fromString(custom_result_font);
resultFontEdit->setFont(font1);
resultFontEdit->setEnabled(use_custom_result_font);
QFont font2(expressionWidget->font());
TQFont font2(expressionWidget->font());
font2.fromString(custom_expression_font);
expressionFontEdit->setFont(font2);
expressionFontEdit->setEnabled(use_custom_expression_font);
QFont font3(statusWidget_l->font());
TQFont font3(statusWidget_l->font());
font3.fromString(custom_status_font);
statusFontEdit->setFont(font3);
statusFontEdit->setEnabled(use_custom_status_font);

@ -22,9 +22,9 @@
#include <kdialogbase.h>
class QCheckBox;
class QRadioButton;
class QLabel;
class TQCheckBox;
class TQRadioButton;
class TQLabel;
class KFontRequester;
class KColorButton;
@ -37,14 +37,14 @@ class QalculatePreferencesDialog : public KDialogBase {
public:
QalculatePreferencesDialog(QWidget *parent = 0, const char *name = 0);
QalculatePreferencesDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculatePreferencesDialog();
bool editPreferences();
QCheckBox *rpnKeypadOnlyButton, *systrayButton, *statusButton, *iconsButton, *fetchExchangeRatesButton, *saveModeButton, *saveDefsButton, *dotAsSeparatorButton, *unicodeButton, *lowerCaseButton, *lowerCaseEButton, *alternativeBasePrefixButton, *spellOutLogicalOperatorsButton, *useCustomResultFontButton, *useCustomExpressionFontButton, *useCustomStatusFontButton;
QRadioButton *dotButton, *exButton, *asteriskButton, *divisionSlashButton, *divisionButton, *slashButton;
QLabel *multiplicationLabel, *divisionLabel;
TQCheckBox *rpnKeypadOnlyButton, *systrayButton, *statusButton, *iconsButton, *fetchExchangeRatesButton, *saveModeButton, *saveDefsButton, *dotAsSeparatorButton, *unicodeButton, *lowerCaseButton, *lowerCaseEButton, *alternativeBasePrefixButton, *spellOutLogicalOperatorsButton, *useCustomResultFontButton, *useCustomExpressionFontButton, *useCustomStatusFontButton;
TQRadioButton *dotButton, *exButton, *asteriskButton, *divisionSlashButton, *divisionButton, *slashButton;
TQLabel *multiplicationLabel, *divisionLabel;
KFontRequester *resultFontEdit, *expressionFontEdit, *statusFontEdit;
KColorButton *statusErrorColorButton, *statusWarningColorButton;

@ -26,22 +26,22 @@
#include <kxmlguiclient.h>
#include <kaction.h>
#include <kmessagebox.h>
#include <qwhatsthis.h>
#include <qtooltip.h>
#include <tqwhatsthis.h>
#include <tqtooltip.h>
#include <klocale.h>
#include <kapplication.h>
#include <qsimplerichtext.h>
#include <tqsimplerichtext.h>
extern vector<mode_struct> modes;
extern QString parsed_text;
extern TQString parsed_text;
extern KQalculate *mainWin;
extern MathStructure *mstruct;
extern PrintOptions printops;
extern EvaluationOptions evalops;
QString linkInfo(const MathStructure *m, QWidget *w, bool full_length = false) {
QString str;
TQString linkInfo(const MathStructure *m, TQWidget *w, bool full_length = false) {
TQString str;
if(m) {
if(m->isSymbolic()) {
str = "\"";
@ -71,18 +71,18 @@ QString linkInfo(const MathStructure *m, QWidget *w, bool full_length = false) {
str += "\n";
str += i18n("Prefix");
str += ": ";
QString pstr;
TQString pstr;
switch(m->prefix()->type()) {
case PREFIX_DECIMAL: {
QTextOStream(&pstr) << m->prefix()->name(false, printops.use_unicode_signs, &can_display_unicode_string_function, (void*) w).c_str() << " (10e" << ((DecimalPrefix*) m->prefix())->exponent() << ")";
TQTextOStream(&pstr) << m->prefix()->name(false, printops.use_unicode_signs, &can_display_unicode_string_function, (void*) w).c_str() << " (10e" << ((DecimalPrefix*) m->prefix())->exponent() << ")";
break;
}
case PREFIX_BINARY: {
QTextOStream(&pstr) << m->prefix()->name(false, printops.use_unicode_signs, &can_display_unicode_string_function, (void*) w).c_str() << " (2e" << ((BinaryPrefix*) m->prefix())->exponent() << ")";
TQTextOStream(&pstr) << m->prefix()->name(false, printops.use_unicode_signs, &can_display_unicode_string_function, (void*) w).c_str() << " (2e" << ((BinaryPrefix*) m->prefix())->exponent() << ")";
break;
}
case PREFIX_NUMBER: {
QTextOStream(&pstr) << m->prefix()->name(false, printops.use_unicode_signs, &can_display_unicode_string_function, (void*) w).c_str();
TQTextOStream(&pstr) << m->prefix()->name(false, printops.use_unicode_signs, &can_display_unicode_string_function, (void*) w).c_str();
break;
}
}
@ -119,7 +119,7 @@ QString linkInfo(const MathStructure *m, QWidget *w, bool full_length = false) {
} else {
str += i18n("argument");
str += " ";
str += QString::number(i2);
str += TQString::number(i2);
}
if(i2 > f->minargs()) {
str += "]";
@ -144,7 +144,7 @@ QString linkInfo(const MathStructure *m, QWidget *w, bool full_length = false) {
if(f->subtype() == SUBTYPE_DATA_SET) {
str += "<br>";
str += "<br>";
QString str2;
TQString str2;
str2.sprintf(i18n("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, a dialog window will pop up with all properties of the object."), f->title().c_str());
str2.replace("<", "&lt;");
str2.replace(">", "&gt;");
@ -153,7 +153,7 @@ QString linkInfo(const MathStructure *m, QWidget *w, bool full_length = false) {
if(!f->description().empty()) {
str += "<br>";
str += "<br>";
QString str2 = f->description().c_str();
TQString str2 = f->description().c_str();
str2.replace("<", "&lt;");
str2.replace(">", "&gt;");
str += str2;
@ -165,9 +165,9 @@ QString linkInfo(const MathStructure *m, QWidget *w, bool full_length = false) {
}
QString linkInfo(const QString &link, QWidget *w, bool full_length = false) {
TQString linkInfo(const TQString &link, TQWidget *w, bool full_length = false) {
if(!link.isEmpty() && link[0] == '+') {
QString str = link;
TQString str = link;
str.remove(0, 1);
return str;
} else {
@ -175,68 +175,68 @@ QString linkInfo(const QString &link, QWidget *w, bool full_length = false) {
}
}
class QalculateExpressionToolTip : public QToolTip {
class QalculateExpressionToolTip : public TQToolTip {
public:
QalculateResultDisplay *qrd;
QalculateExpressionToolTip(QalculateResultDisplay *parent, QToolTipGroup *group = 0) : QToolTip(parent->viewport(), group) {
QalculateExpressionToolTip(QalculateResultDisplay *parent, TQToolTipGroup *group = 0) : TQToolTip(parent->viewport(), group) {
qrd = parent;
}
virtual ~QalculateExpressionToolTip() {}
protected:
void maybeTip(const QPoint &p) {
void maybeTip(const TQPoint &p) {
int cx = qrd->contentsX();
int cy = qrd->contentsY();
QString str = qrd->anchorAt(qrd->viewportToContents(p), Qt::AnchorName);
TQString str = qrd->anchorAt(qrd->viewportToContents(p), TQt::AnchorName);
if(str.isEmpty()) return;
int w = 5;
while(p.x() + w < qrd->visibleWidth() && qrd->anchorAt(QPoint(p.x() + cx + w, p.y() + cy), Qt::AnchorName) == str) {
while(p.x() + w < qrd->visibleWidth() && qrd->anchorAt(TQPoint(p.x() + cx + w, p.y() + cy), TQt::AnchorName) == str) {
w += 5;
}
int x = p.x() - 5;
w += 5;
while(x > 0 && qrd->anchorAt(QPoint(x + cx, p.y() + cy), Qt::AnchorName) == str) {
while(x > 0 && qrd->anchorAt(TQPoint(x + cx, p.y() + cy), TQt::AnchorName) == str) {
x -= 5;
w += 5;
}
if(x < 0) x = 0;
if(w + x > qrd->visibleWidth()) w = qrd->visibleWidth() - x;
int h = 5;
while(p.y() + h < qrd->visibleHeight() && qrd->anchorAt(QPoint(p.x() + cx, p.y() + cy + h), Qt::AnchorName) == str) {
while(p.y() + h < qrd->visibleHeight() && qrd->anchorAt(TQPoint(p.x() + cx, p.y() + cy + h), TQt::AnchorName) == str) {
h += 5;
}
int y = p.y() - 5;
h += 5;
while(y > 0 && qrd->anchorAt(QPoint(p.x() + cx, y + cy), Qt::AnchorName) == str) {
while(y > 0 && qrd->anchorAt(TQPoint(p.x() + cx, y + cy), TQt::AnchorName) == str) {
y -= 5;
h += 5;
}
if(y < 0) y = 0;
if(h + y > qrd->visibleHeight()) h = qrd->visibleHeight() - y;
tip(QRect(x, y, w, h), linkInfo(str, qrd, true));
tip(TQRect(x, y, w, h), linkInfo(str, qrd, true));
}
};
QalculateResultDisplay::QalculateResultDisplay(QWidget *parent, const char *name): QTextBrowser(parent, name) {
QalculateResultDisplay::QalculateResultDisplay(TQWidget *parent, const char *name): TQTextBrowser(parent, name) {
setResizePolicy(AutoOneFit);
setVScrollBarMode(Auto);
setHScrollBarMode(Auto);
setTextFormat(Qt::RichText);
setFrameStyle(QFrame::NoFrame);
//setFocusPolicy(QWidget::TabFocus);
setTextFormat(TQt::RichText);
setFrameStyle(TQFrame::NoFrame);
//setFocusPolicy(TQWidget::TabFocus);
paletteChanged();
m_under_pointer = NULL;
QToolTipGroup *tgroup = new QToolTipGroup(viewport());
TQToolTipGroup *tgroup = new TQToolTipGroup(viewport());
tooltip = new QalculateExpressionToolTip(this, tgroup);
//connect(this, SIGNAL(anchorClicked(const QString&, const QString&)), this, SLOT(onAnchorClicked(const QString&, const QString&)));
//connect(this, SIGNAL(anchorClicked(const TQString&, const TQString&)), this, SLOT(onAnchorClicked(const TQString&, const TQString&)));
connect(this, SIGNAL(doubleClicked(int, int)), this, SLOT(onDoubleClicked(int, int)));
if(kapp) {
connect(kapp, SIGNAL(kdisplayPaletteChanged()), this, SLOT(paletteChanged()));
@ -250,16 +250,16 @@ void QalculateResultDisplay::setRightMargin(int i_margin) {
setMargins(0, 0, i_margin, 0);
}
void QalculateResultDisplay::onAnchorClicked(const QString&, const QString&) {
void QalculateResultDisplay::onAnchorClicked(const TQString&, const TQString&) {
/*if(name.isEmpty()) return;
QWhatsThis::display(linkInfo(name, this, true));*/
TQWhatsThis::display(linkInfo(name, this, true));*/
}
QPopupMenu *QalculateResultDisplay::createPopupMenu(const QPoint &pos) {
TQPopupMenu *QalculateResultDisplay::createPopupMenu(const TQPoint &pos) {
m_under_pointer = NULL;
QPopupMenu *menu = QTextBrowser::createPopupMenu(pos);
TQPopupMenu *menu = TQTextBrowser::createPopupMenu(pos);
menu->insertSeparator();
mainWin->ActionStoreResult->plug(menu);
mainWin->ActionSaveAsImage->plug(menu);
@ -322,8 +322,8 @@ QPopupMenu *QalculateResultDisplay::createPopupMenu(const QPoint &pos) {
mainWin->ActionEnableDenominatorPrefixes->plug(menu);
}
menu->insertSeparator();
QPopupMenu *modes_menu = new QPopupMenu(menu);
QObject::connect(modes_menu, SIGNAL(activated(int)), mainWin, SLOT(loadMode(int)));
TQPopupMenu *modes_menu = new TQPopupMenu(menu);
TQObject::connect(modes_menu, SIGNAL(activated(int)), mainWin, SLOT(loadMode(int)));
for(size_t i = 0; i < modes.size(); i++) {
modes_menu->insertItem(modes[i].name, i, i);
}
@ -334,7 +334,7 @@ QPopupMenu *QalculateResultDisplay::createPopupMenu(const QPoint &pos) {
if(parsed_text.isEmpty()) return menu;
menu->insertSeparator();
menu->insertItem(i18n("Show Parsed Expression"), this, SLOT(showParsedExpression()));
QString str = anchorAt(pos, Qt::AnchorName);
TQString str = anchorAt(pos, TQt::AnchorName);
if(!str.isEmpty()) {
if(str[0] == '+') {
name_under_pointer = str;
@ -379,16 +379,16 @@ void QalculateResultDisplay::displayScientific() {
}
void QalculateResultDisplay::showParsedExpression() {
QString str = i18n("Parsed expression:");
TQString str = i18n("Parsed expression:");
str += "\n";
str += parsed_text;
QWhatsThis::display(str, curpos);
TQWhatsThis::display(str, curpos);
}
void QalculateResultDisplay::showInfo() {
if(m_under_pointer) {
QWhatsThis::display(linkInfo(m_under_pointer, this, true), curpos);
TQWhatsThis::display(linkInfo(m_under_pointer, this, true), curpos);
} else {
QWhatsThis::display(linkInfo(name_under_pointer, this, true), curpos);
TQWhatsThis::display(linkInfo(name_under_pointer, this, true), curpos);
}
}
void QalculateResultDisplay::editVector() {
@ -399,30 +399,30 @@ void QalculateResultDisplay::editMatrix() {
}
void QalculateResultDisplay::paletteChanged() {
QPalette p = kapp ? kapp->palette() : palette();
p.setBrush(QColorGroup::Base, p.brush(QPalette::Normal, QColorGroup::Background));
p.setColor(QColorGroup::Text, p.color(QPalette::Normal, QColorGroup::Foreground));
TQPalette p = kapp ? kapp->palette() : palette();
p.setBrush(TQColorGroup::Base, p.brush(TQPalette::Normal, TQColorGroup::Background));
p.setColor(TQColorGroup::Text, p.color(TQPalette::Normal, TQColorGroup::Foreground));
setPalette(p);
}
void QalculateResultDisplay::virtual_hook(int, void*) {
}
void QalculateResultDisplay::focusInEvent(QFocusEvent* fe) {
QTextBrowser::focusInEvent(fe);
if(fe->reason() == QFocusEvent::Tab || fe->reason() == QFocusEvent::Backtab)
void QalculateResultDisplay::focusInEvent(TQFocusEvent* fe) {
TQTextBrowser::focusInEvent(fe);
if(fe->reason() == TQFocusEvent::Tab || fe->reason() == TQFocusEvent::Backtab)
selectAll(true);
}
void QalculateResultDisplay::focusOutEvent(QFocusEvent* fe) {
QTextBrowser::focusOutEvent(fe);
if(fe->reason() == QFocusEvent::Tab || fe->reason() == QFocusEvent::Backtab)
void QalculateResultDisplay::focusOutEvent(TQFocusEvent* fe) {
TQTextBrowser::focusOutEvent(fe);
if(fe->reason() == TQFocusEvent::Tab || fe->reason() == TQFocusEvent::Backtab)
selectAll(false);
}
void QalculateResultDisplay::onDoubleClicked(int, int) {
curpos = QCursor::pos();
QString str = anchorAt(viewportToContents(viewport()->mapFromGlobal(curpos)), Qt::AnchorName);
curpos = TQCursor::pos();
TQString str = anchorAt(viewportToContents(viewport()->mapFromGlobal(curpos)), TQt::AnchorName);
if(!str.isEmpty()) {
if(str[0] == '+') {
selectAll(false);
@ -447,26 +447,26 @@ void QalculateResultDisplay::onDoubleClicked(int, int) {
}
}
void QalculateResultDisplay::keyPressEvent(QKeyEvent *e) {
void QalculateResultDisplay::keyPressEvent(TQKeyEvent *e) {
switch (e->key()) {
case Key_Down:
case Key_Up:
case Key_Left:
case Key_Right:
// jump over QTextEdit's key navigation breakage.
// jump over TQTextEdit's key navigation breakage.
// we're not interested in keyboard navigation within the text
QWidget::keyPressEvent(e);
TQWidget::keyPressEvent(e);
break;
default:
QTextBrowser::keyPressEvent(e);
TQTextBrowser::keyPressEvent(e);
}
}
QSize QalculateResultDisplay::minimumSizeHint() const {
TQSize QalculateResultDisplay::minimumSizeHint() const {
QSize ms = minimumSize();
TQSize ms = minimumSize();
if((ms.width() > 0) && (ms.height() > 0))
return ms;
@ -474,9 +474,9 @@ QSize QalculateResultDisplay::minimumSizeHint() const {
if(ms.width() > 0)
w = ms.width();
QSimpleRichText rt("<font size=6>X</font>", font());
TQSimpleRichText rt("<font size=6>X</font>", font());
rt.setWidth(100);
QSimpleRichText rt2("<font size=2>X</font>", font());
TQSimpleRichText rt2("<font size=2>X</font>", font());
rt2.setWidth(100);
int h2 = (int) (rt2.height() / 1.5);
h2 += h2 % 2;
@ -484,10 +484,10 @@ QSize QalculateResultDisplay::minimumSizeHint() const {
if(h < ms.height())
h = ms.height();
return QSize(w, h);
return TQSize(w, h);
}
QSize QalculateResultDisplay::sizeHint() const {
TQSize QalculateResultDisplay::sizeHint() const {
return minimumSizeHint();
}

@ -20,45 +20,45 @@
#ifndef QALCULATERESULTDISPLAY_H
#define QALCULATERESULTDISPLAY_H
#include <qtextbrowser.h>
#include <tqtextbrowser.h>
class QPopupMenu;
class QToolTip;
class TQPopupMenu;
class TQToolTip;
class MathStructure;
/**
@author Niklas Knutsson
*/
class QalculateResultDisplay : public QTextBrowser {
class QalculateResultDisplay : public TQTextBrowser {
Q_OBJECT
public:
QalculateResultDisplay(QWidget *parent = 0, const char *name = 0);
QalculateResultDisplay(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateResultDisplay();
QPopupMenu *createPopupMenu(const QPoint & pos);
TQPopupMenu *createPopupMenu(const TQPoint & pos);
QToolTip *tooltip;
TQToolTip *tooltip;
const MathStructure *m_under_pointer;
QString name_under_pointer;
QPoint curpos;
TQString name_under_pointer;
TQPoint curpos;
QSize minimumSizeHint() const;
QSize sizeHint() const;
TQSize minimumSizeHint() const;
TQSize sizeHint() const;
void setRightMargin(int);
public slots:
void onAnchorClicked(const QString&, const QString&);
void onAnchorClicked(const TQString&, const TQString&);
void showParsedExpression();
private slots:
void paletteChanged();
void setSource(const QString &) {}
void setSource(const TQString &) {}
void showInfo();
void editVector();
void editMatrix();
@ -70,9 +70,9 @@ private slots:
protected:
void virtual_hook(int id, void* data);
void focusInEvent(QFocusEvent *fe);
void focusOutEvent(QFocusEvent *fe);
void keyPressEvent(QKeyEvent *e);
void focusInEvent(TQFocusEvent *fe);
void focusOutEvent(TQFocusEvent *fe);
void keyPressEvent(TQKeyEvent *e);
};

@ -19,40 +19,40 @@
***************************************************************************/
#include "qalculatesetbasedialog.h"
#include <qradiobutton.h>
#include <qvbuttongroup.h>
#include <qspinbox.h>
#include <tqradiobutton.h>
#include <tqvbuttongroup.h>
#include <tqspinbox.h>
#include <klocale.h>
#include <qvbox.h>
#include <tqvbox.h>
QalculateSetBaseDialog::QalculateSetBaseDialog(QWidget *parent, const char *name)
QalculateSetBaseDialog::QalculateSetBaseDialog(TQWidget *parent, const char *name)
: KDialogBase(parent, name, false, i18n("Number Bases"), Close, Close) {
QHBox *box = makeHBoxMainWidget();
TQHBox *box = makeHBoxMainWidget();
radiogroup_output = new QVButtonGroup(i18n("Result Base"), box);
radiogroup_output = new TQVButtonGroup(i18n("Result Base"), box);
radiogroup_output->setRadioButtonExclusive(true);
new QRadioButton(i18n("Binary"), radiogroup_output);
new QRadioButton(i18n("Octal"), radiogroup_output);
new QRadioButton(i18n("Decimal"), radiogroup_output);
new QRadioButton(i18n("Hexadecimal"), radiogroup_output);
new QRadioButton(i18n("Other:"), radiogroup_output);
outputBaseBox = new QSpinBox(2, 36, 1, radiogroup_output);
new TQRadioButton(i18n("Binary"), radiogroup_output);
new TQRadioButton(i18n("Octal"), radiogroup_output);
new TQRadioButton(i18n("Decimal"), radiogroup_output);
new TQRadioButton(i18n("Hexadecimal"), radiogroup_output);
new TQRadioButton(i18n("Other:"), radiogroup_output);
outputBaseBox = new TQSpinBox(2, 36, 1, radiogroup_output);
outputBaseBox->setValue(10);
new QRadioButton(i18n("Sexagesimal"), radiogroup_output);
new QRadioButton(i18n("Time format"), radiogroup_output);
new QRadioButton(i18n("Roman numerals"), radiogroup_output);
new TQRadioButton(i18n("Sexagesimal"), radiogroup_output);
new TQRadioButton(i18n("Time format"), radiogroup_output);
new TQRadioButton(i18n("Roman numerals"), radiogroup_output);
radiogroup_input = new QVButtonGroup(i18n("Expression Base"), box);
radiogroup_input = new TQVButtonGroup(i18n("Expression Base"), box);
radiogroup_input->setRadioButtonExclusive(true);
new QRadioButton(i18n("Binary"), radiogroup_input);
new QRadioButton(i18n("Octal"), radiogroup_input);
new QRadioButton(i18n("Decimal"), radiogroup_input);
new QRadioButton(i18n("Hexadecimal"), radiogroup_input);
new QRadioButton(i18n("Other:"), radiogroup_input);
inputBaseBox = new QSpinBox(2, 36, 1, radiogroup_input);
new TQRadioButton(i18n("Binary"), radiogroup_input);
new TQRadioButton(i18n("Octal"), radiogroup_input);
new TQRadioButton(i18n("Decimal"), radiogroup_input);
new TQRadioButton(i18n("Hexadecimal"), radiogroup_input);
new TQRadioButton(i18n("Other:"), radiogroup_input);
inputBaseBox = new TQSpinBox(2, 36, 1, radiogroup_input);
inputBaseBox->setValue(10);
new QRadioButton(i18n("Roman numerals"), radiogroup_input);
new TQRadioButton(i18n("Roman numerals"), radiogroup_input);
}

@ -22,8 +22,8 @@
#include <kdialogbase.h>
class QVButtonGroup;
class QSpinBox;
class TQVButtonGroup;
class TQSpinBox;
/**
@author Niklas Knutsson
@ -34,11 +34,11 @@ class QalculateSetBaseDialog : public KDialogBase {
public:
QalculateSetBaseDialog(QWidget *parent = 0, const char *name = 0);
QalculateSetBaseDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateSetBaseDialog();
QVButtonGroup *radiogroup_input, *radiogroup_output;
QSpinBox *inputBaseBox, *outputBaseBox;
TQVButtonGroup *radiogroup_input, *radiogroup_output;
TQSpinBox *inputBaseBox, *outputBaseBox;
};

@ -21,16 +21,16 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditunitdialog.h"
#include <kpushbutton.h>
#include <qsplitter.h>
#include <qvbox.h>
#include <qhbox.h>
#include <tqsplitter.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <klistview.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <kcombobox.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <tqlabel.h>
#include <tqgroupbox.h>
#include <klineedit.h>
#include <kiconloader.h>
#include <kapplication.h>
@ -41,7 +41,7 @@ extern vector<void*> ia_units;
extern PrintOptions printops;
extern EvaluationOptions evalops;
QalculateUnitsDialog::QalculateUnitsDialog(QWidget *parent, const char *name) : KDialog(parent, name, false) {
QalculateUnitsDialog::QalculateUnitsDialog(TQWidget *parent, const char *name) : KDialog(parent, name, false) {
unit_edit_dialog = NULL;
selected_category = "";
@ -49,14 +49,14 @@ QalculateUnitsDialog::QalculateUnitsDialog(QWidget *parent, const char *name) :
selected_to_unit = NULL;
block_unit_convert = true;
QHBoxLayout *layout = new QHBoxLayout(this, marginHint(), spacingHint());
TQHBoxLayout *layout = new TQHBoxLayout(this, marginHint(), spacingHint());
setCaption(i18n("Units"));
QVBoxLayout *leftLayout = new QVBoxLayout(layout, spacingHint());
TQVBoxLayout *leftLayout = new TQVBoxLayout(layout, spacingHint());
QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
splitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
TQSplitter *splitter = new TQSplitter(TQt::Horizontal, this);
splitter->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
leftLayout->addWidget(splitter);
categoryView = new KListView(splitter);
@ -69,43 +69,43 @@ QalculateUnitsDialog::QalculateUnitsDialog(QWidget *parent, const char *name) :
unitView->addColumn(i18n("Base"));
unitView->setRootIsDecorated(false);
convertGroup = new QGroupBox(3, Qt::Horizontal, i18n("Conversion"), this);
convertGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
convertGroup = new TQGroupBox(3, TQt::Horizontal, i18n("Conversion"), this);
convertGroup->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Minimum);
convertGroup->setInsideSpacing(spacingHint());
convertGroup->setInsideMargin(spacingHint());
convertButton = new KPushButton(QIconSet(SmallIcon("reload")), "", convertGroup);
convertButton = new KPushButton(TQIconSet(SmallIcon("reload")), "", convertGroup);
fromEdit = new KLineEdit("1", convertGroup);
fromEdit->setAlignment(Qt::AlignRight);
fromEdit->setAlignment(TQt::AlignRight);
fromEdit->setMinimumWidth(100);
fromLabel = new QLabel(convertGroup);
equalsLabel = new QLabel("=", convertGroup);
equalsLabel->setAlignment(Qt::AlignRight);
fromLabel = new TQLabel(convertGroup);
equalsLabel = new TQLabel("=", convertGroup);
equalsLabel->setAlignment(TQt::AlignRight);
toEdit = new KLineEdit("1", convertGroup);
toEdit->setAlignment(Qt::AlignRight);
toEdit->setAlignment(TQt::AlignRight);
toEdit->setMinimumWidth(100);
toCombo = new KComboBox(convertGroup);
leftLayout->addWidget(convertGroup);
QVBoxLayout *buttonLayout = new QVBoxLayout(layout, spacingHint());
TQVBoxLayout *buttonLayout = new TQVBoxLayout(layout, spacingHint());
newButton = new QPushButton(i18n("New"), this);
newButton = new TQPushButton(i18n("New"), this);
buttonLayout->addWidget(newButton);
editButton = new QPushButton(i18n("Edit"), this);
editButton = new TQPushButton(i18n("Edit"), this);
editButton->setEnabled(false);
buttonLayout->addWidget(editButton);
deleteButton = new QPushButton(i18n("Delete"), this);
deleteButton = new TQPushButton(i18n("Delete"), this);
deleteButton->setEnabled(false);
buttonLayout->addWidget(deleteButton);
deactivateButton = new QPushButton(i18n("Deactivate"), this);
deactivateButton = new TQPushButton(i18n("Deactivate"), this);
deactivateButton->setEnabled(false);
buttonLayout->addWidget(deactivateButton);
insertButton = new QPushButton(i18n("Insert"), this);
insertButton = new TQPushButton(i18n("Insert"), this);
insertButton->setEnabled(false);
buttonLayout->addWidget(insertButton);
convertResultButton = new QPushButton(i18n("Convert Result"), this);
convertResultButton = new TQPushButton(i18n("Convert Result"), this);
convertResultButton->setEnabled(false);
buttonLayout->addWidget(convertResultButton);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
buttonLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
helpButton = new KPushButton(KStdGuiItem::help(), this);
buttonLayout->addWidget(helpButton);
buttonClose = new KPushButton(KStdGuiItem::close(), this);
@ -113,7 +113,7 @@ QalculateUnitsDialog::QalculateUnitsDialog(QWidget *parent, const char *name) :
fromEdit->setFocus();
resize(QSize(675, 425).expandedTo(size()));
resize(TQSize(675, 425).expandedTo(size()));
connect(buttonClose, SIGNAL(clicked()), this, SLOT(close()));
connect(newButton, SIGNAL(clicked()), this, SLOT(newUnit()));
@ -123,7 +123,7 @@ QalculateUnitsDialog::QalculateUnitsDialog(QWidget *parent, const char *name) :
connect(insertButton, SIGNAL(clicked()), this, SLOT(insertUnit()));
connect(convertResultButton, SIGNAL(clicked()), this, SLOT(convertResult()));
connect(unitView, SIGNAL(selectionChanged()), this, SLOT(unitSelected()));
connect(unitView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(unitDoubleClicked(QListViewItem*)));
connect(unitView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(unitDoubleClicked(TQListViewItem*)));
connect(categoryView, SIGNAL(selectionChanged()), this, SLOT(categorySelected()));
connect(toCombo, SIGNAL(activated(int)), this, SLOT(toUnitSelected(int)));
connect(convertButton, SIGNAL(clicked()), this, SLOT(convertClicked()));
@ -147,10 +147,10 @@ void QalculateUnitsDialog::updateUnitTree() {
comboItems.clear();
categoryItems.clear();
categoryView->clear();
QListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
TQListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
categoryItems[i] = i18n("All");
i->setOpen(true);
QString str;
TQString str;
tree_struct *item, *item2;
unit_cats.it = unit_cats.items.begin();
if(unit_cats.it != unit_cats.items.end()) {
@ -213,13 +213,13 @@ void QalculateUnitsDialog::updateUnitTree() {
if(!categoryView->selectedItem()) {
//if no category has been selected (previously selected has been renamed/deleted), select "All"
selected_category = i18n("All");
QListViewItemIterator it(categoryView);
TQListViewItemIterator it(categoryView);
if(it.current())
categoryView->setSelected(it.current(), true);
}
}
#define UPDATE_SELECTED_UNIT QListViewItem *i = unitView->selectedItem(); if(!i) return; selected_unit = unitItems[i]; if(!selected_unit) return;
#define UPDATE_SELECTED_UNIT TQListViewItem *i = unitView->selectedItem(); if(!i) return; selected_unit = unitItems[i]; if(!selected_unit) return;
#define CHECK_IF_UNIT_STILL_THERE if(!CALCULATOR->stillHasUnit(selected_unit)) {KMessageBox::error(this, i18n("Unit does not exist anymore.")); emit unitsChanged(); return;}
void QalculateUnitsDialog::insertUnit() {
@ -264,7 +264,7 @@ void QalculateUnitsDialog::editUnit() {
if(!unit_edit_dialog) {
unit_edit_dialog = new QalculateEditUnitDialog(this);
}
Unit *u = unit_edit_dialog->editUnit(QString::null, selected_unit);
Unit *u = unit_edit_dialog->editUnit(TQString::null, selected_unit);
if(u) {
selected_unit = u;
if(!u->isActive()) {
@ -287,7 +287,7 @@ void QalculateUnitsDialog::newUnit() {
if(selected_category.isEmpty() || selected_category[0] != '/') {
u = unit_edit_dialog->editUnit();
} else {
QString str = selected_category;
TQString str = selected_category;
str.remove(0, 1);
u = unit_edit_dialog->editUnit(str);
}
@ -305,7 +305,7 @@ void QalculateUnitsDialog::newUnit() {
}
}
void QalculateUnitsDialog::unitDoubleClicked(QListViewItem*i) {
void QalculateUnitsDialog::unitDoubleClicked(TQListViewItem*i) {
selected_unit = unitItems[i];
if(!selected_unit)
return;
@ -313,7 +313,7 @@ void QalculateUnitsDialog::unitDoubleClicked(QListViewItem*i) {
if(!unit_edit_dialog) {
unit_edit_dialog = new QalculateEditUnitDialog(this);
}
Unit *u = unit_edit_dialog->editUnit(QString::null, selected_unit);
Unit *u = unit_edit_dialog->editUnit(TQString::null, selected_unit);
if(u) {
selected_unit = u;
if(!u->isActive()) {
@ -330,7 +330,7 @@ void QalculateUnitsDialog::unitDoubleClicked(QListViewItem*i) {
void QalculateUnitsDialog::unitSelected() {
QListViewItem *selected = unitView->selectedItem();
TQListViewItem *selected = unitView->selectedItem();
if(selected) {
Unit *u = unitItems[selected];
if(!CALCULATOR->stillHasUnit(u)) {
@ -365,7 +365,7 @@ void QalculateUnitsDialog::unitSelected() {
}
void QalculateUnitsDialog::addUnitTreeItem(Unit *u) {
QString snames, sbase;
TQString snames, sbase;
//display name, plural name and short name in the second column
AliasUnit *au;
for(size_t i = 1; i <= u->countNames(); i++) {
@ -384,7 +384,7 @@ void QalculateUnitsDialog::addUnitTreeItem(Unit *u) {
sbase = au->firstBaseUnit()->preferredDisplayName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) unitView).name.c_str();
if(au->firstBaseExponent() != 1) {
sbase += POWER;
sbase += QString::number(au->firstBaseExponent());
sbase += TQString::number(au->firstBaseExponent());
}
break;
}
@ -393,7 +393,7 @@ void QalculateUnitsDialog::addUnitTreeItem(Unit *u) {
break;
}
}
QListViewItem *i = new KListViewItem(unitView, u->title(true).c_str(), snames, sbase);
TQListViewItem *i = new KListViewItem(unitView, u->title(true).c_str(), snames, sbase);
unitItems[i] = u;
if(u == selected_unit) {
unitView->setSelected(i, true);
@ -403,7 +403,7 @@ void QalculateUnitsDialog::addUnitTreeItem(Unit *u) {
void QalculateUnitsDialog::categorySelected() {
block_unit_convert = true;
QListViewItem *selected = categoryView->selectedItem();
TQListViewItem *selected = categoryView->selectedItem();
bool no_cat = false, b_all = false, b_inactive = false;
unitView->clear();
unitItems.clear();
@ -437,7 +437,7 @@ void QalculateUnitsDialog::categorySelected() {
}
}
if(!selected_unit || !unitView->selectedItem()) {
QListViewItemIterator it(unitView);
TQListViewItemIterator it(unitView);
if(it.current())
unitView->setSelected(it.current(), true);
}
@ -447,7 +447,7 @@ void QalculateUnitsDialog::categorySelected() {
comboItems.clear();
int i = 0, h = -1;
//add all units in units tree to menu
QListViewItemIterator it(unitView);
TQListViewItemIterator it(unitView);
Unit *u;
while(it.current()) {
u = unitItems[it.current()];
@ -471,7 +471,7 @@ void QalculateUnitsDialog::categorySelected() {
//if no menu item was selected, select the first
if(h < 0) {
h = 0;
QListViewItemIterator it2(unitView);
TQListViewItemIterator it2(unitView);
if(it2.current()) {
selected_to_unit = unitItems[it2.current()];
} else {
@ -547,7 +547,7 @@ void QalculateUnitsDialog::convertReversed() {
}
}
void QalculateUnitsDialog::keyPressEvent(QKeyEvent *e) {
void QalculateUnitsDialog::keyPressEvent(TQKeyEvent *e) {
if(e->key() == Key_Return) {
convertClicked();
e->accept();

@ -21,18 +21,18 @@
#define QALCULATEUNITSDIALOG_H
#include <kdialog.h>
#include <qmap.h>
#include <qvaluevector.h>
#include <tqmap.h>
#include <tqvaluevector.h>
class Unit;
class QalculateEditUnitDialog;
class KListView;
class QListViewItem;
class QPushButton;
class TQListViewItem;
class TQPushButton;
class KLineEdit;
class QLabel;
class TQLabel;
class KComboBox;
class QGroupBox;
class TQGroupBox;
/**
@author Niklas Knutsson
@ -43,30 +43,30 @@ class QalculateUnitsDialog : public KDialog {
public:
QalculateUnitsDialog(QWidget *parent = 0, const char *name = 0);
QalculateUnitsDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateUnitsDialog();
QalculateEditUnitDialog *unit_edit_dialog;
QString selected_category;
TQString selected_category;
Unit *selected_unit, *selected_to_unit;
void addUnitTreeItem(Unit *f);
QMap<QListViewItem*, Unit*> unitItems;
QMap<QListViewItem*, QString> categoryItems;
QValueVector<Unit*> comboItems;
TQMap<TQListViewItem*, Unit*> unitItems;
TQMap<TQListViewItem*, TQString> categoryItems;
TQValueVector<Unit*> comboItems;
QGroupBox *convertGroup;
TQGroupBox *convertGroup;
KListView *categoryView;
KListView *unitView;
QPushButton *newButton;
QPushButton *editButton;
QPushButton *deleteButton;
QPushButton *deactivateButton;
QPushButton *insertButton;
QPushButton *helpButton;
QPushButton *buttonClose;
QPushButton *convertResultButton;
QPushButton *convertButton;
QLabel *fromLabel, *equalsLabel;
TQPushButton *newButton;
TQPushButton *editButton;
TQPushButton *deleteButton;
TQPushButton *deactivateButton;
TQPushButton *insertButton;
TQPushButton *helpButton;
TQPushButton *buttonClose;
TQPushButton *convertResultButton;
TQPushButton *convertButton;
TQLabel *fromLabel, *equalsLabel;
KLineEdit *toEdit, *fromEdit;
KComboBox *toCombo;
@ -75,7 +75,7 @@ public:
public slots:
void updateUnitTree();
void unitDoubleClicked(QListViewItem*);
void unitDoubleClicked(TQListViewItem*);
void unitSelected();
void categorySelected();
void insertUnit();
@ -101,7 +101,7 @@ signals:
protected:
void keyPressEvent(QKeyEvent *e);
void keyPressEvent(TQKeyEvent *e);
};

@ -24,20 +24,20 @@
#include "qalculateeditunknownvariabledialog.h"
#include "qalculateexportcsvdialog.h"
#include <kpushbutton.h>
#include <qsplitter.h>
#include <qvbox.h>
#include <qhbox.h>
#include <tqsplitter.h>
#include <tqvbox.h>
#include <tqhbox.h>
#include <klistview.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <qlayout.h>
#include <tqlayout.h>
#include <kapplication.h>
#include <kstdguiitem.h>
extern tree_struct variable_cats;
extern vector<void*> ia_variables;
QalculateVariablesDialog::QalculateVariablesDialog(QWidget *parent, const char *name) : KDialog(parent, name, false) {
QalculateVariablesDialog::QalculateVariablesDialog(TQWidget *parent, const char *name) : KDialog(parent, name, false) {
export_csv_dialog = NULL;
variable_edit_dialog = NULL;
@ -46,11 +46,11 @@ QalculateVariablesDialog::QalculateVariablesDialog(QWidget *parent, const char *
selected_category = "";
selected_variable = NULL;
QHBoxLayout *layout = new QHBoxLayout(this, marginHint(), spacingHint());
TQHBoxLayout *layout = new TQHBoxLayout(this, marginHint(), spacingHint());
setCaption(i18n("Variables"));
QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
TQSplitter *splitter = new TQSplitter(TQt::Horizontal, this);
layout->addWidget(splitter);
categoryView = new KListView(splitter);
@ -61,33 +61,33 @@ QalculateVariablesDialog::QalculateVariablesDialog(QWidget *parent, const char *
variableView->addColumn(i18n("Value"));
variableView->setRootIsDecorated(false);
QVBoxLayout *buttonLayout = new QVBoxLayout(layout, spacingHint());
TQVBoxLayout *buttonLayout = new TQVBoxLayout(layout, spacingHint());
newButton = new QPushButton(i18n("New"), this);
newButton = new TQPushButton(i18n("New"), this);
buttonLayout->addWidget(newButton);
editButton = new QPushButton(i18n("Edit"), this);
editButton = new TQPushButton(i18n("Edit"), this);
editButton->setEnabled(false);
buttonLayout->addWidget(editButton);
deleteButton = new QPushButton(i18n("Delete"), this);
deleteButton = new TQPushButton(i18n("Delete"), this);
deleteButton->setEnabled(false);
buttonLayout->addWidget(deleteButton);
deactivateButton = new QPushButton(i18n("Deactivate"), this);
deactivateButton = new TQPushButton(i18n("Deactivate"), this);
deactivateButton->setEnabled(false);
buttonLayout->addWidget(deactivateButton);
insertButton = new QPushButton(i18n("Insert"), this);
insertButton = new TQPushButton(i18n("Insert"), this);
insertButton->setEnabled(false);
buttonLayout->addWidget(insertButton);
exportButton = new QPushButton(i18n("Export"), this);
exportButton = new TQPushButton(i18n("Export"), this);
exportButton->setEnabled(false);
buttonLayout->addWidget(exportButton);
buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
buttonLayout->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding));
helpButton = new KPushButton(KStdGuiItem::help(), this);
buttonLayout->addWidget(helpButton);
buttonClose = new KPushButton(KStdGuiItem::close(), this);
buttonClose->setFocus();
buttonLayout->addWidget(buttonClose);
resize(QSize(675, 375).expandedTo(size()));
resize(TQSize(675, 375).expandedTo(size()));
connect(buttonClose, SIGNAL(clicked()), this, SLOT(close()));
connect(newButton, SIGNAL(clicked()), this, SLOT(newVariable()));
@ -97,7 +97,7 @@ QalculateVariablesDialog::QalculateVariablesDialog(QWidget *parent, const char *
connect(insertButton, SIGNAL(clicked()), this, SLOT(insertVariable()));
connect(exportButton, SIGNAL(clicked()), this, SLOT(exportVariable()));
connect(variableView, SIGNAL(selectionChanged()), this, SLOT(variableSelected()));
connect(variableView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(variableDoubleClicked(QListViewItem*)));
connect(variableView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(variableDoubleClicked(TQListViewItem*)));
connect(categoryView, SIGNAL(selectionChanged()), this, SLOT(categorySelected()));
connect(helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
@ -113,10 +113,10 @@ void QalculateVariablesDialog::updateVariableTree() {
variableItems.clear();
categoryItems.clear();
categoryView->clear();
QListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
TQListViewItem *i = new KListViewItem(categoryView, i18n("All")), *i2;
categoryItems[i] = i18n("All");
i->setOpen(true);
QString str;
TQString str;
tree_struct *item, *item2;
variable_cats.it = variable_cats.items.begin();
if(variable_cats.it != variable_cats.items.end()) {
@ -181,13 +181,13 @@ void QalculateVariablesDialog::updateVariableTree() {
if(!categoryView->selectedItem()) {
//if no category has been selected (previously selected has been renamed/deleted), select "All"
selected_category = i18n("All");
QListViewItemIterator it(categoryView);
TQListViewItemIterator it(categoryView);
if(it.current())
categoryView->setSelected(it.current(), true);
}
}
#define UPDATE_SELECTED_VARIABLE QListViewItem *i = variableView->selectedItem(); if(!i) return; selected_variable = variableItems[i]; if(!selected_variable) return;
#define UPDATE_SELECTED_VARIABLE TQListViewItem *i = variableView->selectedItem(); if(!i) return; selected_variable = variableItems[i]; if(!selected_variable) return;
#define CHECK_IF_VARIABLE_STILL_THERE if(!CALCULATOR->stillHasVariable(selected_variable)) {KMessageBox::error(this, i18n("Variable does not exist anymore.")); emit variablesChanged(); return;}
void QalculateVariablesDialog::exportVariable() {
@ -237,18 +237,18 @@ void QalculateVariablesDialog::editVariable() {
if(!matrix_edit_dialog) {
matrix_edit_dialog = new QalculateEditMatrixVectorDialog(this);
}
v = matrix_edit_dialog->editVariable(QString::null, (KnownVariable*) selected_variable);
v = matrix_edit_dialog->editVariable(TQString::null, (KnownVariable*) selected_variable);
} else {
if(!variable_edit_dialog) {
variable_edit_dialog = new QalculateEditVariableDialog(this);
}
v = variable_edit_dialog->editVariable(QString::null, (KnownVariable*) selected_variable);
v = variable_edit_dialog->editVariable(TQString::null, (KnownVariable*) selected_variable);
}
} else {
if(!unknown_edit_dialog) {
unknown_edit_dialog = new QalculateEditUnknownVariableDialog(this);
}
v = unknown_edit_dialog->editVariable(QString::null, (UnknownVariable*) selected_variable);
v = unknown_edit_dialog->editVariable(TQString::null, (UnknownVariable*) selected_variable);
}
if(v) {
selected_variable = v;
@ -272,7 +272,7 @@ void QalculateVariablesDialog::newVariable() {
if(selected_category.isEmpty() || selected_category[0] != '/') {
v = variable_edit_dialog->editVariable("");
} else {
QString str = selected_category;
TQString str = selected_category;
str.remove(0, 1);
v = variable_edit_dialog->editVariable(str);
}
@ -290,7 +290,7 @@ void QalculateVariablesDialog::newVariable() {
}
}
void QalculateVariablesDialog::variableDoubleClicked(QListViewItem*i) {
void QalculateVariablesDialog::variableDoubleClicked(TQListViewItem*i) {
selected_variable = variableItems[i];
if(!selected_variable)
return;
@ -301,18 +301,18 @@ void QalculateVariablesDialog::variableDoubleClicked(QListViewItem*i) {
if(!matrix_edit_dialog) {
matrix_edit_dialog = new QalculateEditMatrixVectorDialog(this);
}
v = matrix_edit_dialog->editVariable(QString::null, (KnownVariable*) selected_variable);
v = matrix_edit_dialog->editVariable(TQString::null, (KnownVariable*) selected_variable);
} else {
if(!variable_edit_dialog) {
variable_edit_dialog = new QalculateEditVariableDialog(this);
}
v = variable_edit_dialog->editVariable(QString::null, (KnownVariable*) selected_variable);
v = variable_edit_dialog->editVariable(TQString::null, (KnownVariable*) selected_variable);
}
} else {
if(!unknown_edit_dialog) {
unknown_edit_dialog = new QalculateEditUnknownVariableDialog(this);
}
v = unknown_edit_dialog->editVariable(QString::null, (UnknownVariable*) selected_variable);
v = unknown_edit_dialog->editVariable(TQString::null, (UnknownVariable*) selected_variable);
}
if(v) {
selected_variable = v;
@ -330,7 +330,7 @@ void QalculateVariablesDialog::variableDoubleClicked(QListViewItem*i) {
void QalculateVariablesDialog::variableSelected() {
QListViewItem *selected = variableView->selectedItem();
TQListViewItem *selected = variableView->selectedItem();
if(selected) {
Variable *v = variableItems[selected];
if(!CALCULATOR->stillHasVariable(v)) {
@ -361,7 +361,7 @@ void QalculateVariablesDialog::variableSelected() {
}
void QalculateVariablesDialog::addVariableTreeItem(Variable *v) {
QString value;
TQString value;
if(is_answer_variable(v)) {
value = i18n("a previous result");
} else if(v->isKnown()) {
@ -440,7 +440,7 @@ void QalculateVariablesDialog::addVariableTreeItem(Variable *v) {
value = i18n("default assumptions");
}
}
QListViewItem *i = new KListViewItem(variableView, v->title(true).c_str(), value);
TQListViewItem *i = new KListViewItem(variableView, v->title(true).c_str(), value);
variableItems[i] = v;
if(v == selected_variable) {
variableView->setSelected(i, true);
@ -449,7 +449,7 @@ void QalculateVariablesDialog::addVariableTreeItem(Variable *v) {
void QalculateVariablesDialog::categorySelected() {
QListViewItem *selected = categoryView->selectedItem();
TQListViewItem *selected = categoryView->selectedItem();
bool no_cat = false, b_all = false, b_inactive = false;
variableView->clear();
variableItems.clear();
@ -483,7 +483,7 @@ void QalculateVariablesDialog::categorySelected() {
}
}
if(!selected_variable || !variableView->selectedItem()) {
QListViewItemIterator it(variableView);
TQListViewItemIterator it(variableView);
if(it.current())
variableView->setSelected(it.current(), true);
}

@ -21,7 +21,7 @@
#define QALCULATEVARIABLESDIALOG_H
#include <kdialog.h>
#include <qmap.h>
#include <tqmap.h>
class Variable;
class QalculateEditVariableDialog;
@ -29,8 +29,8 @@ class QalculateEditMatrixVectorDialog;
class QalculateEditUnknownVariableDialog;
class QalculateExportCSVDialog;
class KListView;
class QListViewItem;
class QPushButton;
class TQListViewItem;
class TQPushButton;
/**
@author Niklas Knutsson
@ -41,34 +41,34 @@ class QalculateVariablesDialog : public KDialog {
public:
QalculateVariablesDialog(QWidget *parent = 0, const char *name = 0);
QalculateVariablesDialog(TQWidget *parent = 0, const char *name = 0);
virtual ~QalculateVariablesDialog();
QalculateEditVariableDialog *variable_edit_dialog;
QalculateEditMatrixVectorDialog *matrix_edit_dialog;
QalculateEditUnknownVariableDialog *unknown_edit_dialog;
QalculateExportCSVDialog *export_csv_dialog;
QString selected_category;
TQString selected_category;
Variable *selected_variable;
void addVariableTreeItem(Variable *v);
QMap<QListViewItem*, Variable*> variableItems;
QMap<QListViewItem*, QString> categoryItems;
TQMap<TQListViewItem*, Variable*> variableItems;
TQMap<TQListViewItem*, TQString> categoryItems;
KListView *categoryView;
KListView *variableView;
QPushButton *newButton;
QPushButton *editButton;
QPushButton *deleteButton;
QPushButton *deactivateButton;
QPushButton *insertButton;
QPushButton *exportButton;
QPushButton *helpButton;
QPushButton *buttonClose;
TQPushButton *newButton;
TQPushButton *editButton;
TQPushButton *deleteButton;
TQPushButton *deactivateButton;
TQPushButton *insertButton;
TQPushButton *exportButton;
TQPushButton *helpButton;
TQPushButton *buttonClose;
public slots:
void updateVariableTree();
void variableDoubleClicked(QListViewItem*);
void variableDoubleClicked(TQListViewItem*);
void variableSelected();
void categorySelected();
void exportVariable();

Loading…
Cancel
Save