Changeset View
Changeset View
Standalone View
Standalone View
src/widget/relations/KexiRelationsTableContainer_p.cpp
Show All 14 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this program; see the file COPYING. If not, write to | 16 | along with this program; see the file COPYING. If not, write to | ||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "KexiRelationsTableContainer_p.h" | 21 | #include "KexiRelationsTableContainer_p.h" | ||
22 | #include "KexiRelationsScrollArea.h" | 22 | #include "KexiRelationsScrollArea.h" | ||
23 | //! @todo KEXI3 Port #include <kexidragobjects.h> | 23 | #include <kexidragobjects.h> | ||
24 | #include <kexiutils/utils.h> | 24 | #include <kexiutils/utils.h> | ||
25 | 25 | | |||
26 | #include <KDbTableSchema> | 26 | #include <KDbTableSchema> | ||
27 | #include <KDbTableOrQuerySchema> | ||||
27 | #include <KDbUtils> | 28 | #include <KDbUtils> | ||
28 | 29 | | |||
29 | #include <QLabel> | 30 | #include <QLabel> | ||
30 | #include <QPushButton> | 31 | #include <QPushButton> | ||
31 | #include <QPoint> | 32 | #include <QPoint> | ||
32 | #include <QStyle> | 33 | #include <QStyle> | ||
33 | #include <QEvent> | 34 | #include <QEvent> | ||
34 | #include <QDropEvent> | 35 | #include <QDropEvent> | ||
▲ Show 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | |||||
207 | void KexiRelationsTableFieldList::dragEnterEvent(QDragEnterEvent* event) | 208 | void KexiRelationsTableFieldList::dragEnterEvent(QDragEnterEvent* event) | ||
208 | { | 209 | { | ||
209 | 210 | | |||
210 | KexiFieldListView::dragEnterEvent(event); | 211 | KexiFieldListView::dragEnterEvent(event); | ||
211 | } | 212 | } | ||
212 | 213 | | |||
213 | void KexiRelationsTableFieldList::dragMoveEvent(QDragMoveEvent* event) | 214 | void KexiRelationsTableFieldList::dragMoveEvent(QDragMoveEvent* event) | ||
214 | { | 215 | { | ||
215 | //! @todo KEXI3 Port kexidragobjects.cpp | | |||
216 | Q_UNUSED(event); | | |||
217 | #if 0 | | |||
218 | QModelIndex receiver = indexAt(event->pos()); | 216 | QModelIndex receiver = indexAt(event->pos()); | ||
219 | if (!receiver.isValid() || !KexiFieldDrag::canDecode(event)) | 217 | if (!receiver.isValid() || !KexiFieldDrag::canDecode(event)) | ||
220 | return; | 218 | return; | ||
221 | QString sourceMimeType; | 219 | QString sourceMimeType; | ||
222 | QString srcTable; | 220 | QString srcTable; | ||
223 | QStringList srcFields; | 221 | QStringList srcFields; | ||
224 | QString srcField; | 222 | QString srcField; | ||
225 | 223 | | |||
Show All 19 Lines | 241 | if (srcTable == schema()->name()) { | |||
245 | return; | 243 | return; | ||
246 | } | 244 | } | ||
247 | 245 | | |||
248 | QString f = model()->data(receiver, Qt::DisplayRole).toString(); | 246 | QString f = model()->data(receiver, Qt::DisplayRole).toString(); | ||
249 | 247 | | |||
250 | //qDebug() << "Source:" << srcTable << "Dest:" << schema()->name(); | 248 | //qDebug() << "Source:" << srcTable << "Dest:" << schema()->name(); | ||
251 | if (!srcField.trimmed().startsWith('*') && !f.startsWith('*')) | 249 | if (!srcField.trimmed().startsWith('*') && !f.startsWith('*')) | ||
252 | event->acceptProposedAction(); | 250 | event->acceptProposedAction(); | ||
253 | #endif | | |||
254 | } | 251 | } | ||
255 | 252 | | |||
256 | void KexiRelationsTableFieldList::dropEvent(QDropEvent *event) | 253 | void KexiRelationsTableFieldList::dropEvent(QDropEvent *event) | ||
257 | { | 254 | { | ||
258 | //qDebug(); | | |||
259 | //! @todo KEXI3 Port kexidragobjects.cpp | | |||
260 | Q_UNUSED(event); | | |||
261 | #if 0 | | |||
262 | QModelIndex idx = indexAt(event->pos()); | 255 | QModelIndex idx = indexAt(event->pos()); | ||
263 | 256 | | |||
264 | if (!idx.isValid() || !KexiFieldDrag::canDecode(event)) { | 257 | if (!idx.isValid() || !KexiFieldDrag::canDecode(event)) { | ||
265 | event->ignore(); | 258 | event->ignore(); | ||
266 | return; | 259 | return; | ||
267 | } | 260 | } | ||
268 | QString sourceMimeType; | 261 | QString sourceMimeType; | ||
269 | QString srcTable; | 262 | QString srcTable; | ||
Show All 21 Lines | 278 | // qDebug() << "srcfield:" << srcField; | |||
291 | s.detailsTable = schema()->name(); | 284 | s.detailsTable = schema()->name(); | ||
292 | s.masterField = srcField; | 285 | s.masterField = srcField; | ||
293 | s.detailsField = rcvField; | 286 | s.detailsField = rcvField; | ||
294 | 287 | | |||
295 | m_scrollArea->addConnection(s); | 288 | m_scrollArea->addConnection(s); | ||
296 | 289 | | |||
297 | //qDebug() << srcTable << ":" << srcField << schema()->name() << ":" << rcvField; | 290 | //qDebug() << srcTable << ":" << srcField << schema()->name() << ":" << rcvField; | ||
298 | event->accept(); | 291 | event->accept(); | ||
299 | #endif | | |||
300 | } | 292 | } | ||
301 | 293 | | |||
302 | void KexiRelationsTableFieldList::slotContentsMoving() | 294 | void KexiRelationsTableFieldList::slotContentsMoving() | ||
303 | { | 295 | { | ||
304 | emit tableScrolling(); | 296 | emit tableScrolling(); | ||
305 | } | 297 | } | ||
306 | 298 | | |||
307 | void KexiRelationsTableFieldList::contentsMousePressEvent(QMouseEvent *ev) | 299 | void KexiRelationsTableFieldList::contentsMousePressEvent(QMouseEvent *ev) | ||
Show All 14 Lines |