Giter VIP home page Giter VIP logo

qjsonmodel's People

Contributors

adriaandegroot avatar davidlatwe avatar dridk avatar eduard-sukharev avatar eugesh avatar marcelino-m avatar mottosso avatar patrickelectric avatar siyuhong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qjsonmodel's Issues

Bad keys order

Hello,
I have a JSON file , that when processed with your code, it leads to a bad order of keys (see image and JSON file attached).
Could you fix this issue ?
Thank you
2021-09-22_09h30_51
out_printpoints.json.txt
ou

lose precesion when qtreeview show double value

my json contains double value like 32.6743408794, but when i load and show it ,it only shows 32.67。When debug in QJsonTreeItem* QJsonTreeItem::load(const QJsonValue& value, QJsonTreeItem* parent) fuction , i found the value in child is correct actually, so i think it's a treeview widget problem not jsonmodel. If someone could give me some advice, i'll appreciate. :)
1
2

Closing brackets analogue

I have 2 sided JSON navigator with text and tree view navigation. Good to add possibility (option) to append closing brackets } and ] analogue (or blank line) to objects or arrays to tree view model to have same tree view vertical size with QTextBrowser. Is this possible? Thanks! Very good model!

Versioning

From an open source consumption position, it would be beneficial if semantic versioning was instituted (i.e. releases). Tools like Black Duck will pick this up into their knowledge base, providing a more streamlined experience for those that are using your libraries.

Question about python version

QJsonModel/qjsonmodel.py

Lines 97 to 124 in 1386e40

def load(self, value, parent=None, sort=True):
rootItem = QJsonTreeItem(parent)
rootItem.key = "root"
if isinstance(value, dict):
items = (
sorted(value.items())
if sort else value.items()
)
for key, value in items:
child = self.load(value, rootItem)
child.key = key
child.type = type(value)
rootItem.appendChild(child)
elif isinstance(value, list):
for index, value in enumerate(value):
child = self.load(value, rootItem)
child.key = str(index)
child.type = type(value)
rootItem.appendChild(child)
else:
rootItem.value = value
rootItem.type = type(value)
return rootItem

Hi,
Great work, your new model is so helpful! Quick question, in the "load" method there are some recursive calls like this:

child = self.load(value, rootItem)

although the function signature is like this:
def load(self, value, parent=None, sort=True):

Just wanted to confim, is this root item meant to be a "parent" in the function call?

Thanks again!!

QJsonData is not displayed correctly if root object of JSON data is array

When QJsonData is preloaded with following data:

[
        {
        "name" : "FOO"
    },
        {
        "name" : "BAR"
    }
]

then TreeView is unable to show any structure (note that parent structure is JSON array), while loading a following works just fine:

{
    "object1": {
        "name": "FOO"
    },
    "object2": {
        "name": "BAR"
    }
}

works just fine (parent structure is JSON "object", or "dictionary").

Question: Calculating QTreeView height

I've tried this a few ways, but haven't sorted it yet. Do you know an easy way to calculate the entire height for the container widget that is the QTreeView? I've tried to use QFontMetrics and the number of rows, but it's incomplete. Just getting a size on the view returns 480 no matter what.

This example is what I current do to set the view. It's my current height calculation, though it ignores a lot of details. I'm just hoping you may know a better way than to calculate all the internals.

    m_layout = new QVBoxLayout();
    m_data = new QJsonModel();
    m_view = new QTreeView();

    m_data->load(obj);
    m_view->setModel(m_data);
    m_layout->addWidget(m_view);
    QFontMetrics fm = m_view->fontMetrics();
    int r = m_data->rowCount();
    int h = fm.height() * r;

main.cpp still as GNU General Public License

Hello!
I see that long ago in this commit 5b35024 the license was changed to MIT but looks like this file still with the old one.

Is it possible to change it? I am using the QjsonModel python version in mGear but some users have concerns when they found this file license.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.