question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make Variable Explorer column headers movable

See original GitHub issue

The variable explorer currently has the columns as Name -> Type -> Size -> Value, which is kind of annoying as the main thing I usually care about is Value which is way off at the end. There is no way to change this order but a simple one-liner in Qt could make the column headers draggable. In collectionseditor.py, in class BaseTableView’s def setup_table(self), simply add the one line

    def setup_table(self):
        """Setup table"""
        self.horizontalHeader().setStretchLastSection(True)
        self.horizontalHeader().setSectionsMovable(True) # <--- NEW LINE HERE
        self.adjust_columns()
        # Sorting columns
        self.setSortingEnabled(True)
        self.sortByColumn(0, Qt.AscendingOrder)

and you’re done. Note this is for BaseTableView; you could also do this instead in RemoteCollectionsEditorTableView and CollectionsEditorTableView (not sure which subclass is the best to do this in, or what other things subclass BaseTableView).

FWIW, I’d much prefer it if the default were changed to Name -> Value -> Type -> Size, but that seems more involved and I’d be happy enough with this.

Versions

Spyder: 5.0.5 | Python 3.9.5 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Darwin 17.7.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
battaglia01commented, Sep 21, 2021

Thank you all! I will submit when I get the chance.

1reaction
battaglia01commented, Dec 14, 2021

OK, implemented in #17022.

Read more comments on GitHub >

github_iconTop Results From Across the Web

spyder variable explorer to auto-adjust the column header
I have installed spyder via Anaconda and when I viewed the dataframe in the variable explorer, the column headers are squashed / too...
Read more >
Dynamically set column names in data flows - Azure
This tutorial provides steps for dynamically setting column names in ... In the Activities pane, expand the Move and Transform accordion.
Read more >
Blog | Variable Explorer improvements in Spyder 4
Is there a way to reorder/remove the columns in the variable explorer? I would to remove or move the Type column at the...
Read more >
Visual Explorer | Visualize and present data - Mode Support
By default, Measure Names and Measure Values will be empty variables for you to fill. The combination of these two fields allow you...
Read more >
Using the SAS Explorer Window - Lex Jansen
The first tab gives the information on variables in the set (although “variable” appears as “column name”). It appears to open with thee...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found