summaryrefslogtreecommitdiffstats
path: root/kivio/kiviopart/ui/kiviooptionsdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kivio/kiviopart/ui/kiviooptionsdialog.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kivio/kiviopart/ui/kiviooptionsdialog.cpp')
-rw-r--r--kivio/kiviopart/ui/kiviooptionsdialog.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/kivio/kiviopart/ui/kiviooptionsdialog.cpp b/kivio/kiviopart/ui/kiviooptionsdialog.cpp
index d19dce6d..f6950f13 100644
--- a/kivio/kiviopart/ui/kiviooptionsdialog.cpp
+++ b/kivio/kiviopart/ui/kiviooptionsdialog.cpp
@@ -39,21 +39,21 @@
#include <kdebug.h>
#include <kfontdialog.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qtabwidget.h>
-
-// GuidesListViewItem::GuidesListViewItem(QListView* parent, KivioGuideLineData *gd, KoUnit::Unit u)
-// : KListViewItem(parent), m_data(gd)
+#include <tqlabel.h>
+#include <tqbuttongroup.h>
+#include <tqgroupbox.h>
+#include <tqcombobox.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqlayout.h>
+#include <tqtabwidget.h>
+
+// GuidesListViewItem::GuidesListViewItem(TQListView* tqparent, KivioGuideLineData *gd, KoUnit::Unit u)
+// : KListViewItem(tqparent), m_data(gd)
// {
// setPixmap(0, BarIcon(m_data->orientation() == Qt::Vertical ?
// "guides_vertical":"guides_horizontal"));
-// QString s = KGlobal::_locale->formatNumber(KoUnit::toUserValue(m_data->position(), u), 2);
+// TQString s = KGlobal::_locale->formatNumber(KoUnit::toUserValue(m_data->position(), u), 2);
// s += " " + KoUnit::unitName(u);
// setText(1, s);
// }
@@ -65,7 +65,7 @@
//
// void GuidesListViewItem::setUnit(KoUnit::Unit u)
// {
-// QString s = KGlobal::_locale->formatNumber(KoUnit::toUserValue(m_data->position(), u), 2);
+// TQString s = KGlobal::_locale->formatNumber(KoUnit::toUserValue(m_data->position(), u), 2);
// s += " " + KoUnit::unitName(u);
// setText(1, s);
// }
@@ -73,7 +73,7 @@
// void GuidesListViewItem::setPosition(double p, KoUnit::Unit u)
// {
// m_data->setPosition(KoUnit::fromUserValue(p, u));
-// QString s = KGlobal::_locale->formatNumber(p, 2);
+// TQString s = KGlobal::_locale->formatNumber(p, 2);
// s += " " + KoUnit::unitName(u);
// setText(1, s);
// }
@@ -87,79 +87,79 @@
/*****************************************************************************/
-KivioOptionsDialog::KivioOptionsDialog(KivioView* parent, const char* name)
- : KDialogBase(IconList, i18n("Settings"), Ok|Cancel|Apply|Default, Ok, parent, name)
+KivioOptionsDialog::KivioOptionsDialog(KivioView* tqparent, const char* name)
+ : KDialogBase(IconList, i18n("Settings"), Ok|Cancel|Apply|Default, Ok, tqparent, name)
{
initPage();
initGrid();
- unitChanged(parent->doc()->unit());
+ unitChanged(tqparent->doc()->unit());
}
void KivioOptionsDialog::initPage()
{
- QFrame* page = addPage(i18n("Page"), i18n("Page Settings"),
+ TQFrame* page = addPage(i18n("Page"), i18n("Page Settings"),
kapp->iconLoader()->loadIcon("empty", KIcon::Toolbar, 32));
m_pageIndex = pageIndex(page);
- KivioView* view = static_cast<KivioView*>(parent());
+ KivioView* view = static_cast<KivioView*>(TQT_TQWIDGET(tqparent()));
KoUnit::Unit unit = KoUnit::unit(Kivio::Config::unit());
m_layout = Kivio::Config::defaultPageLayout();
m_font = Kivio::Config::font();
- QLabel* unitLbl = new QLabel(i18n("Default &units:"), page);
- m_unitCombo = new QComboBox(page);
+ TQLabel* unitLbl = new TQLabel(i18n("Default &units:"), page);
+ m_unitCombo = new TQComboBox(page);
m_unitCombo->insertStringList(KoUnit::listOfUnitName());
m_unitCombo->setCurrentItem(unit);
unitLbl->setBuddy(m_unitCombo);
- QLabel* layoutLbl = new QLabel(i18n("Default layout:"), page);
- m_layoutTxtLbl = new QLabel(page);
- m_layoutTxtLbl->setFrameStyle(QFrame::LineEditPanel | QFrame::Sunken);
- m_layoutTxtLbl->setSizePolicy(QSizePolicy(
- QSizePolicy::Minimum, QSizePolicy::Fixed));
+ TQLabel* tqlayoutLbl = new TQLabel(i18n("Default tqlayout:"), page);
+ m_layoutTxtLbl = new TQLabel(page);
+ m_layoutTxtLbl->setFrameStyle(TQFrame::LineEditPanel | TQFrame::Sunken);
+ m_layoutTxtLbl->tqsetSizePolicy(TQSizePolicy(
+ TQSizePolicy::Minimum, TQSizePolicy::Fixed));
setLayoutText(m_layout);
- KPushButton* layoutBtn = new KPushButton(i18n("Change..."), page);
- layoutBtn->setSizePolicy(QSizePolicy(
- QSizePolicy::Fixed, QSizePolicy::Fixed));
- QLabel* fontLbl = new QLabel(i18n("Default font:"), page);
- m_fontTxtLbl = new QLabel(page);
- m_fontTxtLbl->setFrameStyle(QFrame::LineEditPanel | QFrame::Sunken);
- m_fontTxtLbl->setSizePolicy(QSizePolicy(
- QSizePolicy::Minimum, QSizePolicy::Fixed));
+ KPushButton* tqlayoutBtn = new KPushButton(i18n("Change..."), page);
+ tqlayoutBtn->tqsetSizePolicy(TQSizePolicy(
+ TQSizePolicy::Fixed, TQSizePolicy::Fixed));
+ TQLabel* fontLbl = new TQLabel(i18n("Default font:"), page);
+ m_fontTxtLbl = new TQLabel(page);
+ m_fontTxtLbl->setFrameStyle(TQFrame::LineEditPanel | TQFrame::Sunken);
+ m_fontTxtLbl->tqsetSizePolicy(TQSizePolicy(
+ TQSizePolicy::Minimum, TQSizePolicy::Fixed));
setFontText(m_font);
KPushButton* fontBtn = new KPushButton(i18n("Change..."), page);
- layoutBtn->setSizePolicy(QSizePolicy(
- QSizePolicy::Fixed, QSizePolicy::Fixed));
- m_marginsChBox = new QCheckBox(i18n("Show page &margins"), page);
+ tqlayoutBtn->tqsetSizePolicy(TQSizePolicy(
+ TQSizePolicy::Fixed, TQSizePolicy::Fixed));
+ m_marginsChBox = new TQCheckBox(i18n("Show page &margins"), page);
m_marginsChBox->setChecked(view->isShowPageMargins());
- m_rulersChBox = new QCheckBox(i18n("Show page &rulers"), page);
+ m_rulersChBox = new TQCheckBox(i18n("Show page &rulers"), page);
m_rulersChBox->setChecked(view->isShowRulers());
- QGridLayout* gl = new QGridLayout(page);
+ TQGridLayout* gl = new TQGridLayout(page);
gl->setSpacing(KDialog::spacingHint());
gl->addWidget(unitLbl, 0, 0);
gl->addMultiCellWidget(m_unitCombo, 0, 0, 1, 2);
- gl->addWidget(layoutLbl, 1, 0);
+ gl->addWidget(tqlayoutLbl, 1, 0);
gl->addWidget(m_layoutTxtLbl, 1, 1);
- gl->addWidget(layoutBtn, 1, 2);
+ gl->addWidget(tqlayoutBtn, 1, 2);
gl->addWidget(fontLbl, 2, 0);
gl->addWidget(m_fontTxtLbl, 2, 1);
gl->addWidget(fontBtn, 2, 2);
gl->addMultiCellWidget(m_marginsChBox, 3, 3, 0, 2);
gl->addMultiCellWidget(m_rulersChBox, 4, 4, 0, 2);
- gl->addMultiCell(new QSpacerItem(0, 0), 5, 5, 0, 2);
+ gl->addMultiCell(new TQSpacerItem(0, 0), 5, 5, 0, 2);
- connect(layoutBtn, SIGNAL(clicked()), SLOT(pageLayoutDlg()));
- connect(fontBtn, SIGNAL(clicked()), SLOT(fontDlg()));
- connect(m_unitCombo, SIGNAL(activated(int)), SLOT(unitChanged(int)));
+ connect(tqlayoutBtn, TQT_SIGNAL(clicked()), TQT_SLOT(pageLayoutDlg()));
+ connect(fontBtn, TQT_SIGNAL(clicked()), TQT_SLOT(fontDlg()));
+ connect(m_unitCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(unitChanged(int)));
}
void KivioOptionsDialog::initGrid()
{
- QFrame* page = addPage(i18n("Grid"), i18n("Grid Settings"), BarIcon( "grid", KIcon::SizeMedium ));
+ TQFrame* page = addPage(i18n("Grid"), i18n("Grid Settings"), BarIcon( "grid", KIcon::SizeMedium ));
m_gridIndex = pageIndex(page);
- KoUnit::Unit unit = static_cast<KivioView*>(parent())->doc()->unit();
- KivioGridData d = static_cast<KivioView*>(parent())->doc()->grid();
+ KoUnit::Unit unit = static_cast<KivioView*>(TQT_TQWIDGET(tqparent()))->doc()->unit();
+ KivioGridData d = static_cast<KivioView*>(TQT_TQWIDGET(tqparent()))->doc()->grid();
double pgw = m_layout.ptWidth;
double pgh = m_layout.ptHeight;
double fw = Kivio::Config::gridXSpacing();
@@ -167,50 +167,50 @@ void KivioOptionsDialog::initGrid()
double sw = Kivio::Config::gridXSnap();
double sh = Kivio::Config::gridYSnap();
- m_gridChBox = new QCheckBox(i18n("Show &grid"), page);
+ m_gridChBox = new TQCheckBox(i18n("Show &grid"), page);
m_gridChBox->setChecked(Kivio::Config::showGrid());
- m_snapChBox = new QCheckBox(i18n("Snap to g&rid"), page);
+ m_snapChBox = new TQCheckBox(i18n("Snap to g&rid"), page);
m_snapChBox->setChecked(Kivio::Config::snapGrid());
- QLabel* gridColorLbl = new QLabel(i18n("Grid &color:"), page);
+ TQLabel* gridColorLbl = new TQLabel(i18n("Grid &color:"), page);
m_gridColorBtn = new KColorButton(Kivio::Config::gridColor(), page);
gridColorLbl->setBuddy(m_gridColorBtn);
- QGroupBox* spacingGrp = new QGroupBox(2, Qt::Horizontal, i18n("Spacing"), page);
- QLabel* spaceHorizLbl = new QLabel(i18n("&Horizontal:"), spacingGrp);
+ TQGroupBox* spacingGrp = new TQGroupBox(2, Qt::Horizontal, i18n("Spacing"), page);
+ TQLabel* spaceHorizLbl = new TQLabel(i18n("&Horizontal:"), spacingGrp);
m_spaceHorizUSpin = new KoUnitDoubleSpinBox(spacingGrp, 0.0, pgw, 0.1,
fw, unit);
spaceHorizLbl->setBuddy(m_spaceHorizUSpin);
- QLabel* spaceVertLbl = new QLabel(i18n("&Vertical:"), spacingGrp);
+ TQLabel* spaceVertLbl = new TQLabel(i18n("&Vertical:"), spacingGrp);
m_spaceVertUSpin = new KoUnitDoubleSpinBox(spacingGrp, 0.0, pgh, 0.1,
fh, unit);
spaceVertLbl->setBuddy(m_spaceVertUSpin);
- QGroupBox* snapGrp = new QGroupBox(2, Qt::Horizontal, i18n("Snap Distance"), page);
- QLabel* snapHorizLbl = new QLabel(i18n("H&orizontal:"), snapGrp);
+ TQGroupBox* snapGrp = new TQGroupBox(2, Qt::Horizontal, i18n("Snap Distance"), page);
+ TQLabel* snapHorizLbl = new TQLabel(i18n("H&orizontal:"), snapGrp);
m_snapHorizUSpin = new KoUnitDoubleSpinBox(snapGrp, 0.0, fw, 0.1,
sw, unit);
snapHorizLbl->setBuddy(m_snapHorizUSpin);
- QLabel* snapVertLbl = new QLabel(i18n("V&ertical:"), snapGrp);
+ TQLabel* snapVertLbl = new TQLabel(i18n("V&ertical:"), snapGrp);
m_snapVertUSpin = new KoUnitDoubleSpinBox(snapGrp, 0.0, fh, 0.1,
sh, unit);
snapVertLbl->setBuddy(m_snapVertUSpin);
- QGridLayout* gl = new QGridLayout(page);
+ TQGridLayout* gl = new TQGridLayout(page);
gl->setSpacing(KDialog::spacingHint());
gl->addMultiCellWidget(m_gridChBox, 0, 0, 0, 2);
gl->addMultiCellWidget(m_snapChBox, 1, 1, 0, 2);
gl->addWidget(gridColorLbl, 2, 0);
gl->addWidget(m_gridColorBtn, 2, 1);
- gl->addItem(new QSpacerItem(0, 0), 2, 2);
+ gl->addItem(new TQSpacerItem(0, 0), 2, 2);
gl->addMultiCellWidget(spacingGrp, 3, 3, 0, 2);
gl->addMultiCellWidget(snapGrp, 4, 4, 0, 2);
- gl->addMultiCell(new QSpacerItem(0, 0), 5, 5, 0, 2);
+ gl->addMultiCell(new TQSpacerItem(0, 0), 5, 5, 0, 2);
- connect(m_spaceHorizUSpin, SIGNAL(valueChanged(double)), SLOT(setMaxHorizSnap(double)));
- connect(m_spaceVertUSpin, SIGNAL(valueChanged(double)), SLOT(setMaxVertSnap(double)));
+ connect(m_spaceHorizUSpin, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(setMaxHorizSnap(double)));
+ connect(m_spaceVertUSpin, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(setMaxVertSnap(double)));
}
void KivioOptionsDialog::applyPage()
{
- KivioView* view = static_cast<KivioView*>(parent());
+ KivioView* view = static_cast<KivioView*>(TQT_TQWIDGET(tqparent()));
view->doc()->setUnit(static_cast<KoUnit::Unit>(m_unitCombo->currentItem()));
Kivio::Config::setUnit(KoUnit::unitName(view->doc()->unit()));
Kivio::Config::setDefaultPageLayout(m_layout);
@@ -230,7 +230,7 @@ void KivioOptionsDialog::applyGrid()
Kivio::Config::setShowGrid(m_gridChBox->isChecked());
Kivio::Config::setSnapGrid(m_snapChBox->isChecked());
Kivio::Config::setGridColor(m_gridColorBtn->color());
- KivioView* view = static_cast<KivioView*>(parent());
+ KivioView* view = static_cast<KivioView*>(TQT_TQWIDGET(tqparent()));
view->doc()->updateView(0);
}
@@ -260,9 +260,9 @@ void KivioOptionsDialog::defaultGrid()
void KivioOptionsDialog::setLayoutText(const KoPageLayout& l)
{
KoUnit::Unit unit = static_cast<KoUnit::Unit>(m_unitCombo->currentItem());
- QString txt = i18n("Format: %1, Width: %2 %4, Height: %3 %5").arg(
- KoPageFormat::formatString(l.format)).arg(KoUnit::toUserValue(l.ptWidth, unit))
- .arg(KoUnit::toUserValue(l.ptHeight, unit)).arg(KoUnit::unitName(unit)).arg(
+ TQString txt = i18n("Format: %1, Width: %2 %4, Height: %3 %5").tqarg(
+ KoPageFormat::formatString(l.format)).tqarg(KoUnit::toUserValue(l.ptWidth, unit))
+ .tqarg(KoUnit::toUserValue(l.ptHeight, unit)).tqarg(KoUnit::unitName(unit)).tqarg(
KoUnit::unitName(unit));
m_layoutTxtLbl->setText(txt);
}
@@ -322,15 +322,15 @@ void KivioOptionsDialog::setMaxVertSnap(double v)
m_snapVertUSpin->setMaxValue(KoUnit::fromUserValue(v, unit));
}
-void KivioOptionsDialog::setFontText(const QFont& f)
+void KivioOptionsDialog::setFontText(const TQFont& f)
{
- QString txt = f.family() + " " + QString::number(f.pointSize());
+ TQString txt = f.family() + " " + TQString::number(f.pointSize());
m_fontTxtLbl->setText(txt);
}
void KivioOptionsDialog::fontDlg()
{
- if(KFontDialog::getFont(m_font, false, this) == QDialog::Accepted) {
+ if(KFontDialog::getFont(m_font, false, this) == TQDialog::Accepted) {
setFontText(m_font);
}
}