summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/container.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-11-05 11:54:26 +0900
committerMichele Calgaro <[email protected]>2023-11-16 23:40:13 +0900
commitc8c5e11f05f023849896d09cf06917e9a2c016ca (patch)
treea62f00b0249b967528e115e2123b56d40633c17a /kexi/formeditor/container.cpp
parentc9973bfbf1091ef91f30b5ab456015676123aa47 (diff)
downloadkoffice-c8c5e11f05f023849896d09cf06917e9a2c016ca.tar.gz
koffice-c8c5e11f05f023849896d09cf06917e9a2c016ca.zip
Replace Qt with TQt
Signed-off-by: Michele Calgaro <[email protected]> (cherry picked from commit ef06f14f2475bd08d3ea2ceec54a7b2238f3554e)
Diffstat (limited to 'kexi/formeditor/container.cpp')
-rw-r--r--kexi/formeditor/container.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/kexi/formeditor/container.cpp b/kexi/formeditor/container.cpp
index 89269b14..17f1ced8 100644
--- a/kexi/formeditor/container.cpp
+++ b/kexi/formeditor/container.cpp
@@ -64,7 +64,7 @@ EventEater::eventFilter(TQObject *, TQEvent *ev)
if(ev->type() == TQEvent::MouseButtonRelease && m_widget->inherits("TQTabWidget"))
{
TQMouseEvent *mev = TQT_TQMOUSEEVENT(ev);
- if(mev->button() == Qt::LeftButton)
+ if(mev->button() == TQt::LeftButton)
{
TQMouseEvent *myev = new TQMouseEvent(TQEvent::MouseButtonPress, mev->pos(), mev->button(), mev->state());
m_container->eventFilter(m_widget, myev);
@@ -171,7 +171,7 @@ Container::eventFilter(TQObject *s, TQEvent *e)
return true;
}
- if(((mev->state() == ControlButton) || (mev->state() == ShiftButton))
+ if(((mev->state() == TQt::ControlButton) || (mev->state() == TQt::ShiftButton))
&& (!FormManager::self()->isInserting())) // multiple selection mode
{
if(m_form->selectedWidgets()->findRef(m_moving) != -1) // widget is already selected
@@ -187,22 +187,22 @@ Container::eventFilter(TQObject *s, TQEvent *e)
}
}
else // the widget is not yet selected, we add it
- setSelectedWidget(m_moving, true, (mev->button() == Qt::RightButton));
+ setSelectedWidget(m_moving, true, (mev->button() == TQt::RightButton));
}
else if((m_form->selectedWidgets()->count() > 1))//&& (!m_form->manager()->isInserting())) // more than one widget selected
{
if(m_form->selectedWidgets()->findRef(m_moving) == -1) // widget is not selected, it becomes the only selected widget
- setSelectedWidget(m_moving, false, (mev->button() == Qt::RightButton));
+ setSelectedWidget(m_moving, false, (mev->button() == TQt::RightButton));
// If the widget is already selected, we do nothing (to ease widget moving, etc.)
}
else// if(!m_form->manager()->isInserting())
- setSelectedWidget(m_moving, false, (mev->button() == Qt::RightButton));
+ setSelectedWidget(m_moving, false, (mev->button() == TQt::RightButton));
// we are inserting a widget or drawing a selection rect in the form
if((/*s == m_container &&*/ FormManager::self()->isInserting()) || ((s == m_container) && !m_toplevel))
{
int tmpx,tmpy;
- if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (Qt::LeftButton|ControlButton|AltButton)))
+ if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (TQt::LeftButton|TQt::ControlButton|TQt::AltButton)))
{
tmpx = mev->x();
tmpy = mev->y();
@@ -253,8 +253,8 @@ Container::eventFilter(TQObject *s, TQEvent *e)
case TQEvent::MouseMove:
{
TQMouseEvent *mev = TQT_TQMOUSEEVENT(e);
- if(m_insertBegin!=TQPoint(-1,-1) && FormManager::self()->isInserting() && ((mev->state() == Qt::LeftButton) || (mev->state() == (Qt::LeftButton|ControlButton)) ||
- (mev->state() == (Qt::LeftButton|ControlButton|AltButton)) || (mev->state() == (Qt::LeftButton|ShiftButton)) ) )
+ if(m_insertBegin!=TQPoint(-1,-1) && FormManager::self()->isInserting() && ((mev->state() == TQt::LeftButton) || (mev->state() == (TQt::LeftButton|TQt::ControlButton)) ||
+ (mev->state() == (TQt::LeftButton|TQt::ControlButton|TQt::AltButton)) || (mev->state() == (TQt::LeftButton|TQt::ShiftButton)) ) )
// draw the insert rect
{
drawInsertRect(mev, s);
@@ -270,9 +270,9 @@ Container::eventFilter(TQObject *s, TQEvent *e)
if(m_form->formWidget() && (tree->widget() != s))
m_form->formWidget()->highlightWidgets(tree->widget(), TQT_TQWIDGET(s));
}
- else if(m_insertBegin!=TQPoint(-1,-1) && s == m_container && !m_toplevel && (mev->state() != ControlButton) && !FormManager::self()->isCreatingConnection()) // draw the selection rect
+ else if(m_insertBegin!=TQPoint(-1,-1) && s == m_container && !m_toplevel && (mev->state() != TQt::ControlButton) && !FormManager::self()->isCreatingConnection()) // draw the selection rect
{
- if((mev->state() != Qt::LeftButton) || /*m_inlineEditing*/ m_state == InlineEditing)
+ if((mev->state() != TQt::LeftButton) || /*m_inlineEditing*/ m_state == InlineEditing)
return true;
int topx = (m_insertBegin.x() < mev->x()) ? m_insertBegin.x() : mev->x();
int topy = (m_insertBegin.y() < mev->y()) ? m_insertBegin.y() : mev->y();
@@ -287,14 +287,14 @@ Container::eventFilter(TQObject *s, TQEvent *e)
m_state = DoingNothing;
return true;
}
- else if(mev->state() == (Qt::LeftButton|ControlButton)) // draw the insert rect for the copied widget
+ else if(mev->state() == (TQt::LeftButton|TQt::ControlButton)) // draw the insert rect for the copied widget
{
if(s == m_container)// || (m_form->selectedWidgets()->count() > 1))
return true;
drawCopiedWidgetRect(mev);
return true;
}
- else if( ( (mev->state() == Qt::LeftButton) || (mev->state() == (Qt::LeftButton|ControlButton|AltButton)) )
+ else if( ( (mev->state() == TQt::LeftButton) || (mev->state() == (TQt::LeftButton|TQt::ControlButton|TQt::AltButton)) )
&& !FormManager::self()->isInserting() && (m_state != CopyingWidget)) // we are dragging the widget(s) to move it
{
if(!m_toplevel && m_moving == m_container) // no effect for form
@@ -372,8 +372,8 @@ Container::eventFilter(TQObject *s, TQEvent *e)
if(!m_moving)
return true;
// we simulate a mouse move event to update screen
- TQMouseEvent *mev = new TQMouseEvent(TQEvent::MouseMove, m_moving->mapFromGlobal(TQCursor::pos()), Qt::NoButton,
- Qt::LeftButton|ControlButton );
+ TQMouseEvent *mev = new TQMouseEvent(TQEvent::MouseMove, m_moving->mapFromGlobal(TQCursor::pos()), TQt::NoButton,
+ TQt::LeftButton|TQt::ControlButton );
eventFilter(TQT_TQOBJECT(m_moving), TQT_TQEVENT(mev));
delete mev;
}
@@ -487,16 +487,16 @@ Container::handleMouseReleaseEvent(TQObject *s, TQMouseEvent *mev)
m_insertRect = TQRect();
return true;
}
- else if(s == m_container && !m_toplevel && (mev->button() != Qt::RightButton) && m_insertRect.isValid()) // we are drawing a rect to select widgets
+ else if(s == m_container && !m_toplevel && (mev->button() != TQt::RightButton) && m_insertRect.isValid()) // we are drawing a rect to select widgets
{
drawSelectionRect(mev);
return true;
}
- if(mev->button() == Qt::RightButton) // Right-click -> context menu
+ if(mev->button() == TQt::RightButton) // Right-click -> context menu
{
FormManager::self()->createContextMenu(TQT_TQWIDGET(s), this);
}
- else if(mev->state() == (Qt::LeftButton|TQt::ControlButton))// && (m_copyRect.isValid()))
+ else if(mev->state() == (TQt::LeftButton|TQt::ControlButton))// && (m_copyRect.isValid()))
{
// copying a widget by Ctrl+dragging
@@ -620,7 +620,7 @@ Container::setLayout(LayoutType type)
case HFlow:
{
KexiFlowLayout *flow = new KexiFlowLayout(m_container,m_margin, m_spacing);
- flow->setOrientation(Qt::Horizontal);
+ flow->setOrientation(TQt::Horizontal);
m_layout = (TQLayout*)flow;
createFlowLayout();
break;
@@ -628,7 +628,7 @@ Container::setLayout(LayoutType type)
case VFlow:
{
KexiFlowLayout *flow = new KexiFlowLayout(m_container,m_margin, m_spacing);
- flow->setOrientation(Qt::Vertical);
+ flow->setOrientation(TQt::Vertical);
m_layout = (TQLayout*)flow;
createFlowLayout();
break;
@@ -674,7 +674,7 @@ Container::createFlowLayout()
const int offset = 15;
WidgetList *list=0, *list2=0;
- if(flow->orientation() ==Qt::Horizontal) {
+ if(flow->orientation() ==TQt::Horizontal) {
list = new VerWidgetList(m_form->toplevelContainer()->widget());
list2 = new HorWidgetList(m_form->toplevelContainer()->widget());
}
@@ -688,7 +688,7 @@ Container::createFlowLayout()
list->append( tree->widget());
list->sort();
- if(flow->orientation() ==Qt::Horizontal) {
+ if(flow->orientation() ==TQt::Horizontal) {
int y = list->first()->y();
for(TQWidget *w = list->first(); w; w = list->next()) {
if( (w->y() > y +offset)) {
@@ -943,7 +943,7 @@ Container::stringToLayoutType(const TQString &name)
void
Container::drawConnection(TQMouseEvent *mev)
{
- if(mev->button() != Qt::LeftButton)
+ if(mev->button() != TQt::LeftButton)
{
FormManager::self()->resetCreatedConnection();
return;
@@ -1023,7 +1023,7 @@ Container::drawInsertRect(TQMouseEvent *mev, TQObject *s)
TQPoint pos = TQT_TQWIDGET(s)->mapTo(m_container, mev->pos());
int gridX = m_form->gridSize();
int gridY = m_form->gridSize();
- if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (Qt::LeftButton|ControlButton|AltButton)) )
+ if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (TQt::LeftButton|TQt::ControlButton|TQt::AltButton)) )
{
tmpx = pos.x();
tmpy = pos.y();
@@ -1144,7 +1144,7 @@ Container::moveSelectedWidgetsBy(int realdx, int realdy, TQMouseEvent *mev)
}
int tmpx, tmpy;
- if(!FormManager::self()->snapWidgetsToGrid() || (mev && mev->state() == (Qt::LeftButton|ControlButton|AltButton)) )
+ if(!FormManager::self()->snapWidgetsToGrid() || (mev && mev->state() == (TQt::LeftButton|TQt::ControlButton|TQt::AltButton)) )
{
tmpx = w->x() + dx;
tmpy = w->y() + dy;