dridk / qjsonmodel Goto Github PK
View Code? Open in Web Editor NEWQt Json Tree Model
License: MIT License
Qt Json Tree Model
License: MIT License
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
out_printpoints.json.txt
ou
how to add child to the tree?
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. :)
This trouble is a little annoying. My python env is Python3.5
When trying to get the json string from the QJsonModel via the json() method it doesn't provide a means to get the compact formatting like arrayToJson() and objectToJson() methods do.
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!
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.
Lines 97 to 124 in 1386e40
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!!
Out of curiosity, why do you use your own functions to generate JSON (arrayContentToJson
, objectContentToJson
and valueToJson
) instead of the QJsonDocument::toJson()
function?
Thank you for the great library :o)
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").
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;
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!
Hi and thanks for the library
It would be great if this model were editable.
HI,
I have a qtreeview and set your model
But i want to remove & insert node.
How can i do fot this issues?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.