Drag and Drop difference between GTK and Qt

Post bugreports for the Linux version here
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Drag and Drop difference between GTK and Qt

Post by wombats »

When using the Qt subsystem, it seems like GetGadgetState() when used in a drop event doesn't take into account collapsed items. With GTK, dropping on "Item 4" returns correctly returns 4, whereas when using Qt, it incorrectly returns 2. There's also no indicator for the user to show which item is the target (I don't know if Qt supports this).

Code: Select all

Procedure OnDragStart()
  DragText(GetGadgetItemText(0, GetGadgetState(0)), #PB_Drag_Move)
EndProcedure

Procedure OnGadgetDrop()
  Debug GetGadgetState(0)
EndProcedure

OpenWindow(0, 100, 100, 350, 400, "", #PB_Window_SystemMenu)

TreeGadget(0, 10, 10, 330, 380)

AddGadgetItem(0, -1, "Item 0")
AddGadgetItem(0, -1, "Item 1")
AddGadgetItem(0, -1, "Item 2", 0, 1)
AddGadgetItem(0, -1, "Item 3", 0, 1)
AddGadgetItem(0, -1, "Item 4", 0, 0)
AddGadgetItem(0, -1, "Item 5", 0, 0)

EnableGadgetDrop(0, #PB_Drop_Text, #PB_Drag_Move)

BindGadgetEvent(0, @OnDragStart(), #PB_EventType_DragStart)
BindEvent(#PB_Event_GadgetDrop, @OnGadgetDrop(), 0, 0)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow