summaryrefslogtreecommitdiffstats
path: root/kommander/editor/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/mainwindow.cpp')
-rw-r--r--kommander/editor/mainwindow.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/kommander/editor/mainwindow.cpp b/kommander/editor/mainwindow.cpp
index 0abb7de2..497be25b 100644
--- a/kommander/editor/mainwindow.cpp
+++ b/kommander/editor/mainwindow.cpp
@@ -179,16 +179,16 @@ MainWindow::MainWindow(bool asClient)
readConfig();
// hack to make WidgetFactory happy (so it knows TQWidget and TQDialog for resetting properties)
- TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQWIDGET_OBJECT_NAME_STRING), this, 0, false);
+ TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQWidget"), this, 0, false);
delete w;
w = WidgetFactory::create(WidgetDatabase::idFromClassName("Dialog"), this, 0, false);
delete w;
- w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQLABEL_OBJECT_NAME_STRING), this, 0, false);
+ w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQLabel"), this, 0, false);
delete w;
- w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQTABWIDGET_OBJECT_NAME_STRING), this, 0, false);
+ w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQTabWidget"), this, 0, false);
delete w;
- w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQFRAME_OBJECT_NAME_STRING), this, 0, false);
+ w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQFrame"), this, 0, false);
delete w;
assistant = new AssistProc(TQT_TQOBJECT(this), "Internal Assistant", assistantPath());
@@ -630,28 +630,28 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
break;
if (o && currentTool() == POINTER_TOOL && (o->inherits("QDesignerMenuBar") ||
o->inherits("QDesignerToolBar") ||
- (o->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) || o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) || o->inherits("QDesignerToolBarSeparator")) &&
+ (o->inherits("TQComboBox") || o->inherits("TQToolButton") || o->inherits("QDesignerToolBarSeparator")) &&
o->parent() && o->parent()->inherits("QDesignerToolBar"))) {
TQWidget *w = (TQWidget*)o;
- if (w->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) || w->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) || w->inherits("QDesignerToolBarSeparator"))
+ if (w->inherits("TQToolButton") || w->inherits("TQComboBox") || w->inherits("QDesignerToolBarSeparator"))
w = w->parentWidget();
TQWidget *pw = w->parentWidget();
while (pw) {
if (pw->inherits("FormWindow")) {
((FormWindow*)pw)->emitShowProperties(TQT_TQOBJECT(w));
if (!o->inherits("QDesignerToolBar"))
- return !o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) && !o->inherits(TQMENUBAR_OBJECT_NAME_STRING) &&
- !o->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) && !o->inherits("QDesignerToolBarSeparator");
+ return !o->inherits("TQToolButton") && !o->inherits("TQMenuBar") &&
+ !o->inherits("TQComboBox") && !o->inherits("QDesignerToolBarSeparator");
}
pw = pw->parentWidget();
}
}
- if (o && (o->inherits("QDesignerToolBar") || o->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING))
+ if (o && (o->inherits("QDesignerToolBar") || o->inherits("TQDockWindowHandle"))
&& e->type() == TQEvent::ContextMenu)
break;
if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL)
break;
- if (o && o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
+ if (o && o->inherits("TQSizeGrip"))
break;
if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator"))
break;
@@ -677,7 +677,7 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
lastPressWidget = 0;
if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL)
break;
- if (o && o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
+ if (o && o->inherits("TQSizeGrip"))
break;
if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator"))
break;
@@ -694,10 +694,10 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
w = isAFormWindowChild(o);
if (lastPressWidget != (TQWidget*)o && w &&
!o->inherits("SizeHandle") && !o->inherits("OrderIndicator") &&
- !o->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) && !o->inherits(TQMENUBAR_OBJECT_NAME_STRING) &&
- !o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
+ !o->inherits("TQPopupMenu") && !o->inherits("TQMenuBar") &&
+ !o->inherits("TQSizeGrip"))
return true;
- if (o && o->inherits(TQSIZEGRIP_OBJECT_NAME_STRING))
+ if (o && o->inherits("TQSizeGrip"))
break;
if (lastPressWidget != (TQWidget*)o ||
(!w || o->inherits("SizeHandle") || o->inherits("OrderIndicator")))
@@ -718,8 +718,8 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
break;
case TQEvent::MouseButtonDblClick:
if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) {
- if (o && o->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) && ((TQToolButton*)o)->isOn() &&
- o->parent() && o->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING) && formWindow())
+ if (o && o->inherits("TQToolButton") && ((TQToolButton*)o)->isOn() &&
+ o->parent() && o->parent()->inherits("TQToolBar") && formWindow())
formWindow()->setToolFixed();
break;
}
@@ -808,7 +808,7 @@ bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
TQWidget *MainWindow::isAFormWindowChild(TQObject *o) const
{
- if (o->parent() && o->parent()->inherits(TQWIZARD_OBJECT_NAME_STRING) && !o->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING))
+ if (o->parent() && o->parent()->inherits("TQWizard") && !o->inherits("TQPushButton"))
return 0;
while (o) {
if (o->inherits("FormWindow"))
@@ -1013,18 +1013,18 @@ void MainWindow::popupWidgetMenu(const TQPoint &gp, FormWindow * /*fw*/, TQWidge
void MainWindow::setupRMBProperties(TQValueList<int> &ids, TQMap<TQString, int> &props, TQWidget *w)
{
const TQMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true);
- if (text && qstrcmp(text->type(), TQSTRING_OBJECT_NAME_STRING) != 0)
+ if (text && qstrcmp(text->type(), "TQString") != 0)
text = 0;
const TQMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true);
- if (title && qstrcmp(title->type(), TQSTRING_OBJECT_NAME_STRING) != 0)
+ if (title && qstrcmp(title->type(), "TQString") != 0)
title = 0;
const TQMetaProperty* pagetitle =
w->metaObject()->property(w->metaObject()->findProperty("pageTitle", true), true);
- if (pagetitle && qstrcmp(pagetitle->type(), TQSTRING_OBJECT_NAME_STRING) != 0)
+ if (pagetitle && qstrcmp(pagetitle->type(), "TQString") != 0)
pagetitle = 0;
const TQMetaProperty* pixmap =
w->metaObject()->property(w->metaObject()->findProperty("pixmap", true), true);
- if (pixmap && qstrcmp(pixmap->type(), TQPIXMAP_OBJECT_NAME_STRING) != 0)
+ if (pixmap && qstrcmp(pixmap->type(), "TQPixmap") != 0)
pixmap = 0;
if (text && text->designable(w) ||
@@ -1038,7 +1038,7 @@ void MainWindow::setupRMBProperties(TQValueList<int> &ids, TQMap<TQString, int>
ids << (id = rmbWidgets->insertItem(i18n("Choose Pixmap..."), -1, 0));
props.insert("pixmap", id);
}
- if (text && text->designable(w) && !w->inherits(TQTEXTEDIT_OBJECT_NAME_STRING)) {
+ if (text && text->designable(w) && !w->inherits("TQTextEdit")) {
ids << (id = rmbWidgets->insertItem(i18n("Edit Text..."), -1, 0));
props.insert("text", id);
}
@@ -1068,7 +1068,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
commands.insert("assoc", id);
}
- if (w->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) {
+ if (w->inherits("TQTabWidget")) {
if (ids.isEmpty())
ids << rmbWidgets->insertSeparator(0);
if (((QDesignerTabWidget*)w)->count() > 1) {
@@ -1078,7 +1078,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
ids << (id = rmbWidgets->insertItem(i18n("Add Page"), -1, 0));
commands.insert("add", id);
}
- if (w->inherits(TQTOOLBOX_OBJECT_NAME_STRING)) {
+ if (w->inherits("TQToolBox")) {
if (ids.isEmpty())
ids << rmbWidgets->insertSeparator(0);
if (((TQToolBox*)w)->count() > 1) {
@@ -1113,7 +1113,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
commands.insert("assoc", id);
}
- if (fw->mainContainer()->inherits(TQWIZARD_OBJECT_NAME_STRING)) {
+ if (fw->mainContainer()->inherits("TQWizard")) {
if (ids.isEmpty())
ids << rmbFormWindow->insertSeparator(0);
@@ -1131,7 +1131,7 @@ void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString,
ids << (id = rmbFormWindow->insertItem(i18n("Edit Pages..."), -1, 0));
commands.insert("edit", id);
- } else if (fw->mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) {
+ } else if (fw->mainContainer()->inherits("TQMainWindow")) {
if (ids.isEmpty())
ids << rmbFormWindow->insertSeparator(0);
ids << (id = rmbFormWindow->insertItem(i18n("Add Menu Item"), -1, 0));
@@ -1146,7 +1146,7 @@ void MainWindow::handleRMBProperties(int id, TQMap<TQString, int> &props, TQWidg
if (id == props[ "text" ]) {
bool ok = false;
TQString text;
- if (w->inherits(TQTEXTVIEW_OBJECT_NAME_STRING) || w->inherits(TQLABEL_OBJECT_NAME_STRING)) {
+ if (w->inherits("TQTextView") || w->inherits("TQLabel")) {
text = TextEditor::getText(this, w->property("text").toString());
ok = !text.isEmpty();
} else {
@@ -1211,7 +1211,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
editor->show();
}
- if (w->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) {
+ if (w->inherits("TQTabWidget")) {
TQTabWidget *tw = (TQTabWidget*)w;
if (id == commands[ "add" ]) {
AddTabPageCommand *cmd = new AddTabPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(),
@@ -1229,7 +1229,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
}
}
}
- if (w->inherits(TQTOOLBOX_OBJECT_NAME_STRING)) {
+ if (w->inherits("TQToolBox")) {
TQToolBox *tw = (TQToolBox*)w;
if (id == commands[ "add" ]) {
AddToolBoxPageCommand *cmd = new AddToolBoxPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(),
@@ -1264,7 +1264,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
}
- if (fw->mainContainer()->inherits(TQWIZARD_OBJECT_NAME_STRING)) {
+ if (fw->mainContainer()->inherits("TQWizard")) {
TQWizard *wiz = (TQWizard*)fw->mainContainer();
if (id == commands[ "add" ]) {
AddWizardPageCommand *cmd = new AddWizardPageCommand(i18n("Add Page to %1").arg(wiz->name()), formWindow(),
@@ -1297,7 +1297,7 @@ void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands
cmd->execute();
}
}
- } else if (fw->mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) {
+ } else if (fw->mainContainer()->inherits("TQMainWindow")) {
TQMainWindow *mw = (TQMainWindow*)fw->mainContainer();
if (id == commands[ "add_toolbar" ]) {
AddToolBarCommand *cmd = new AddToolBarCommand(i18n("Add Toolbar to '%1'").arg(formWindow()->name()), formWindow(), mw);
@@ -1632,7 +1632,7 @@ bool MainWindow::openEditor(TQWidget* w, FormWindow*)
if (text && text->designable(w)) {
bool ok = false;
TQString text;
- if (w->inherits(TQTEXTVIEW_OBJECT_NAME_STRING) || w->inherits(TQLABEL_OBJECT_NAME_STRING)) {
+ if (w->inherits("TQTextView") || w->inherits("TQLabel")) {
text = TextEditor::getText(this, w->property("text").toString());
ok = !text.isEmpty();
} else {