Commit Graph

85 Commits

Author SHA1 Message Date
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk bca1dbef87 Don't insert literal tab if accepting tabs, emit keypress event
* This lets the user decide if they want to do something special with
  tab or just insert the character
2017-12-25 12:53:42 +00:00
baldurk 80cb5b093a Ensure RDHeaderView remains valid when deferring work 2017-12-07 15:09:51 +00:00
baldurk dff6ce1245 Fix missing #include 2017-11-29 20:10:18 +00:00
baldurk 8931ed4086 Move leave and keyPress events from RDTreeWidget to RDTreeView 2017-11-29 19:01:23 +00:00
baldurk af7373fb54 Handle root index changing in RDHeaderView - refresh section sizes 2017-11-29 19:01:23 +00:00
baldurk cadc0f3855 Fix issue chaining RDTreeWidgetDelegate onto RDTreeViewDelegate
* We need to inherit to chain these two, as otherwise when the tree view
  delegate calls sizeHint() it passes to the tree widget delegate, but
  then has no way to return back to the tree view for the overridden
  initStyleOption.
* If there was a built-in way to chain delegates like styles (which
  solve this problem by calling back to baseStyle when going from one
  function to another), or better yet a way to avoid the base
  QStyledItemDelegate initStyleOption from completely trampling all over
  the option passed in to any function, this wouldn't be necessary.
2017-11-22 19:11:24 +00:00
baldurk 43d561a4c0 Fix NULL checking and NULL dereferencing issues
* Reported by Coverity Scan - most of these are not an issue and a
  couple of them are coverity getting really confused (like seeing a
  pointer being assigned to NULL and a count to 0, then a few lines
  later declaring that a loop 0..count will dereference the pointer).
* However it's harmless in all cases to add a bit of robustness to keep
  the analysis happy.
2017-11-22 19:11:21 +00:00
baldurk 2514ad4126 Remove some dead code that's no longer needed
* Reported by Coverity Scan
2017-11-22 19:11:18 +00:00
baldurk 25ea14c965 Fix possible division by zero in edge cases
* Reported by Coverity Scan
2017-11-22 12:05:59 +00:00
baldurk c860d8baa3 Fix uninitialized variable warnings from static analysis
* Reported by Coverity Scan
2017-11-22 11:31:07 +00:00
baldurk a738c7726a Compile fixes on linux 2017-11-21 22:32:39 +00:00
baldurk 1f9a2e340c Add an extra minimum size hint, since Qt behaviour is broken by design
* The Qt behaviour is that if you call setMinimumSize on a widget, then
  the minimumSizeHint is IGNORED. So it is impossible to say "use this
  minimum size, unless the widget wants a higher minimum size".
* So instead we do this ourselves in RDLabel. Sigh.
2017-11-21 19:10:33 +00:00
baldurk f65d93cd68 Add support for RichResourceText in RDLabel 2017-11-21 19:10:31 +00:00
baldurk 32a74e20e1 Extract out most code for text-with-ResourceId-links from RDTreeWidget
* The RDTreeWidget items still use this code, but it can now be reused
  on other widgets like RDLabel.
2017-11-21 14:45:22 +00:00
baldurk ec8a4e82fb Add includes needed for RDLineEdit on linux 2017-11-21 09:56:14 +00:00
baldurk 657c343ac8 Support multi-line input in the python shell 2017-11-20 20:01:02 +00:00
baldurk 31b7662db1 Fix adding empty tree widget items in performance counter selection 2017-11-20 20:01:01 +00:00
Cory Bloor 58b628ee8b Fix unused variables
In almost all cases these can be removed. The only exception is in
ShaderViewer.cpp, where regIdx should have been used.
2017-11-18 00:17:06 +01:00
baldurk e790555914 Fix another case with not enough column data and protect against crashes 2017-11-17 17:06:51 +00:00
baldurk d206a012f3 Fix incorrect data-to-column count when adding data to treewidget
* We also add an error in case it happens again.
2017-11-17 16:33:00 +00:00
baldurk 200f0799a4 Generate clickable links to resource inspector in RDTreeWidget 2017-11-17 16:30:56 +00:00
baldurk fb6211a3db Return user data from RDTreeWidget for UserRole variants 2017-11-17 16:30:47 +00:00
baldurk 79b51591c2 Add ForwardingDelegate for use in RD extended widgets.
* This item delegate will forward on either to a specified other
  delegate or to the base implementation. This allows chaining delegates
  (i.e. having one built-in to the widget, which forwards to a user-set
  delegate).
2017-11-17 16:30:47 +00:00
baldurk 62260a6404 Add column alignment function to RDTreeWidget 2017-10-27 12:26:01 +01:00
baldurk 01b1260734 Make sure to refresh model if only children were added 2017-08-31 18:34:16 +01:00
baldurk d68f00ca72 Reset hover index when widget is cleared, don't leave it to be stale 2017-08-28 18:50:18 +01:00
baldurk f295df15f4 Add missing override specifier 2017-08-24 22:38:16 +01:00
baldurk 2a0fac1ad6 Compile fixes on linux 2017-08-24 19:15:28 +01:00
baldurk 5619ed66b4 Fix RDTreeWidget to allow for checkable items 2017-08-24 16:33:39 +01:00
baldurk 81ec99b58a Don't crash in data() if no data has ever been set. Allow adding columns 2017-08-24 16:04:26 +01:00
baldurk c0b123c575 Add itemChanged signal for RDTreeWidget 2017-08-24 16:03:49 +01:00
baldurk 1f13a1466e Add RDTreeWidgetItemIterator for depth-first forward-only iteration 2017-08-24 16:03:01 +01:00
baldurk 15ecaf167c Select rows at once in perf viewer, and add copy-paste handler 2017-08-24 15:00:05 +01:00
baldurk 1b88a39339 Optimise tree widget clearing and child adding by batching updates
* This takes a nice chunk of time off the pipeline state view in
  particular when changing between events.
2017-08-21 17:14:21 +01:00
baldurk 247382af51 Fix a few widgets to properly respond to and use style changes 2017-07-28 19:06:41 +01:00
baldurk b6a73a4bb0 Draw custom coloured tree widget lines over the top of built-in style 2017-07-28 19:06:40 +01:00
baldurk 371c1f9f8c Update currently hovered item on scroll events too. 2017-07-25 09:23:09 +01:00
baldurk e005522152 Give better default sizing on startup to VTX/IDX columns 2017-07-25 09:22:51 +01:00
baldurk df9f72b857 Add option to ignore icon size when sizing rows in a RDTreeView 2017-07-13 13:57:33 +01:00
baldurk 5f94f4a71b Add <QDebug> include file 2017-07-12 23:36:46 +01:00
baldurk 24e1a8fc42 Add a new 'stretchy size hint' mode for RDHeaderView
* The basic idea here is to have a reasonable middleground between
  ResizeToContents and Stretch. We want to show at *least* enough for
  the contents, but the remaining space should be shared between the
  columns according to some proportions.
* That way you don't end up with one huge column and several tiny ones
  that are just big enough but no more, but all data is still visible.
2017-07-12 19:50:29 +01:00
baldurk 79979b60c7 Remove contents margins from sizehint when preserving aspect ratio
* This prevents a feedback loop where the label resizes wider to make
  room for the margins, then the margins get bigger to keep the image
  centred/scaled properly, etc.
2017-07-12 18:26:05 +01:00
baldurk c211df25be Add custom painting and section handling to RDTableView & RDHeaderView
* This is used primarily for the buffer/mesh viewer to be able to pin
  the index/element column to the left side, group columns together with
  a noticeable separator, and other minor tweaks.
* Unfortunately due to tight private coupling and lack of virtual
  functions in the QTableView and QHeaderView, a few unrelated functions
  have to be re-implemented to point to our own header.
2017-06-23 21:44:21 +01:00
baldurk f81876335f Emit click events after processing parent widget
* This means that e.g. right clicking on an item in a list/tree widget
  will make sure it's selected before trying to display a context menu
  or anything.
2017-06-13 18:13:11 +01:00
baldurk b59f03c198 Make sure to pass object parent along
* Missing parents will cause automatic slots not to be connected, which
  was breaking the remote host manager.
2017-06-13 14:56:40 +01:00
baldurk a292838f43 Add a custom tooltip to display elided data in RDTreeViews 2017-06-09 18:41:21 +01:00
Peter Gal 4263b55ffa Fix enum flag usages in the qrenderdoc
There are a few places where the logical 'and' operator
was used to check if a given flag is enabled however
that is not the correct operator.

The binary 'and' operator should be used where
the enum acts as a flag.
2017-06-08 08:34:54 -07:00
baldurk 231c07d390 Make sure to initialise update queueing variable to false 2017-06-03 00:49:16 +01:00
baldurk 3b6f63be0d Make event browser columns properly resizable and re-orderable
* Annoyingly although Qt has an internal bool allowUserMoveOfSection0
  which does exactly what we want allowing the tree column to be
  movable, we can't enable it because it's private. So instead we have
  to re-implement section moving ourselves.
* Minor tweak - also made RDTreeWidgets non-movable by default since
  usually we don't want to allow it.
2017-06-03 00:38:02 +01:00