Skip to content
  • Creating json file with subroot

    Unsolved General and Desktop
    13
    0 Votes
    13 Posts
    1k Views
    D

    @KroMignon thank you

  • 0 Votes
    2 Posts
    1k Views
    pauleddP

    I somehow workaround it.
    On the RaspberryPi I created a bash script in /usr/bin:

    /usr/bin/x5

    #!/bin/bash xhost +local: sudo /home/pi/adas0002 --platform xcb

    I made it executable and then on my Desktop-Pc in Qt-Creator
    I have "/usr/bin/x5" in "Alternate executable on device".

    Now my application starts with root even without invoking any terminal.
    I know this is very bad in security point of view but I dont care on my little offline
    Raspi...

  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    7 Posts
    5k Views
    fcarneyF

    I had issues making these solutions work for the QML TreeView. I ended up setting the root path of my QFileSystemModel to the directory I wanted to view. Then I set the rootIndex in the TreeView to the parent of the index for that directory. This is of course showed its siblings. Then I did the following to filter those siblings away. I also made this optional through a property as there are times when I want that behavior:

    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { FileSystemModel* tmodel = qobject_cast<FileSystemModel*>(parent()); if(tmodel){ QModelIndex index = tmodel->index(source_row, 0, source_parent); QModelIndex rootIndex = tmodel->index(tmodel->rootPath()); if(!rootIndex.isValid() || !index.isValid()) return false; return ((index == rootIndex) || !(tmodel->filtersiblings() && isSiblingOf(index, rootIndex))); } return false; } bool isSiblingOf(const QModelIndex& index, const QModelIndex& parent) const { if(!index.isValid() || !parent.isValid()) return false; QModelIndex sibling; int row=0; do{ sibling = parent.sibling(row,0); if(sibling == index) return true; ++row; }while(sibling.isValid()); return false; }

    I took more of a blacklist approach versus a whitelist approach.

  • 0 Votes
    10 Posts
    2k Views
    jsulmJ

    "It is possible to get that kind of information from the application executable?" - it's easy.
    Call ldd PATH_TO_EXECUTABLE in a terminal

  • 0 Votes
    20 Posts
    5k Views
    SGaistS

    AFAIC Qt Creator assumes that examples are self contained. These are a bit of a special case