Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. gridview
    Log in to post
    • All categories
    • R

      Unsolved How to stop GridView resetting its page/position?
      QML and Qt Quick • gridview • • rawfool

      1
      0
      Votes
      1
      Posts
      46
      Views

      No one has replied

    • T

      Unsolved QML Dynamically add/remove from GridView
      QML and Qt Quick • gridview loader qml • • TheLumbee

      1
      0
      Votes
      1
      Posts
      85
      Views

      No one has replied

    • N

      Unsolved Gridview / Grid - How to implement the following with a model
      QML and Qt Quick • qml gridview grid model flickable • • Nagarjun

      5
      0
      Votes
      5
      Posts
      419
      Views

      N

      Hi @LeLev,

      I tried your solution. Its showing the image. That is fine.
      Now if i have more elements then its filling in the same space.
      I need to scroll thorough the screen to see the elements.
      How to do that ? How should I use Flickable in this case.

      Note: For example: If the screen layout is 500x500, and each element size id 50x50,
      then i should only see 16 elements initially. I have to scroll down on the screen to see the remaining elements.

    • A

      Unsolved Dynamic gridLayout and QComboBox using a drop-down menu
      General and Desktop • layout drop-down grid gridview qgridlayout • • AliGB

      1
      0
      Votes
      1
      Posts
      248
      Views

      No one has replied

    • S

      Unsolved QML Items an einem ?Grid? anhäften und verschieben
      German • qml gridlayout gridview • • Slash200

      9
      0
      Votes
      9
      Posts
      488
      Views

      J.Hilk

      @Slash200

      Gibt es in QML eine View die das freie einfügen von Items in eine Zelle ermöglicht, ohne dass die vorherigen Zellen ein Item haben?

      Nein, nicht das ich es kennen würde. Da musst du dir was eigenes Schreiben, was sich die Postion von allem Items merkt und ach entsprechend neu positioniert, wenn sich die Fenstergröße ändert zum Beispiel.

      Übrigens, hab das Beispiel erweitert über den "Add" Knopf kann man jetzt eines der freien "Dummy"-Elemente ersetzen

      Hattest du dir das so gedacht?

    • AdrianJade

      Solved How to display the images in GridView in descending order ?
      QML and Qt Quick • qml gridview order display image local file • • AdrianJade

      2
      0
      Votes
      2
      Posts
      656
      Views

      AdrianJade

      I finally found the answer in my problem:

      FolderListModel {
      ...
      sortReversed: true
      }

    • devDawg

      Solved Grid vs GridLayout vs GridView
      QML and Qt Quick • grid gridlayout gridview • • devDawg

      4
      0
      Votes
      4
      Posts
      7014
      Views

      L

      First of all I am glad that you found a solution you're happy with.
      Nevertheless, I still recommend to use GridView. On the one hand, it probably reduces your amount of code, on the other hand, and most importantly, it's much more readable to you and every other developer, who might want to help you or needs some Inspiration, because he has the same problems as you have.

      To your question:

      On of the key features of Qml is property binding. So let's say you have

      import QtQuick.Controls 2.3 ApplicationWindow { id: root width: 600; height: 600 visible: true Rectangle { width: parent.width/2; height: parent.height/2 color: "blue" } MouseArea { anchors.fill: parent onClicked: { root.width -= 10; root.height += 10; } } }

      If you click the applicationWindow its width will be decreased by 10 and its height increased by 10. At the same time the rectangle's width will be decreased by 5 and its height increased by 5. That's because its size depends on the size of the applicationWindow and will be changed automatically.

      Same applies to your case. If the model changes its size, your ListView should notice this and update the list.

      Just in case you don't know (or if it's working in your case, didn't know how your model looks like) you can do:
      model: yourModelName.length
      or if it's a List of Arrays/Vectors
      model: yourModelName[index].length

      Index should be available through the outer ListView if I did understand you correctly.

      ListView { model: yourModel.length delegate: ListView { model: yourModel[index].length } }

      Probably there is no need to write an "getLengthOfDataVector" function, if you intended to do it like this. But maybe I missed something as I don't know how you model looks like exactly.

    • ekkescorner

      Unsolved Best way to display many Images in GridView (QtQuickControls2, iOS)
      QML and Qt Quick • qqc2 ios gridview • • ekkescorner

      3
      0
      Votes
      3
      Posts
      801
      Views

      ekkescorner

      @VRonin yes - it's a list of QObject*
      each entry describes a File:

      Folder, File Type (Image, Video, PDF, ...) Path Name (obsolet for iOS Photos) entries (if Folder) ...
      and I'm constructing the collection per ex. from PHFetchResult *smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil];
    • M

      Unsolved Grid View : draw outside of delagate limits
      QML and Qt Quick • gridview delegates z-order • • MoaMoaK

      3
      0
      Votes
      3
      Posts
      944
      Views

      M

      Ok thx, i've also found a very detailed solution on stackoverflow on how to use a parent above evrything to display a component on top.
      I didn't know about the ToolTip component. i might endup using it since it has the same purpose as what I did but probably more efficient and more weird-case-proof. So thank you for your answser.

    • M

      Solved Click on an element in GridView and invoke a function
      QML and Qt Quick • gridview onclicked qabstractitemmo • • MoaMoaK

      2
      0
      Votes
      2
      Posts
      1694
      Views

      sierdzio

      Please do not double-post. I'm closing this one.

    • Diego Donate

      Unsolved GridView in a ScrollView hangs when window is resized (cell width depends on window width)
      QML and Qt Quick • gridview scrollview hang • • Diego Donate

      1
      0
      Votes
      1
      Posts
      745
      Views

      No one has replied

    • L

      Unsolved Problem with GridView
      QML and Qt Quick • gridview qt quick • • lorow23

      4
      0
      Votes
      4
      Posts
      956
      Views

      p3c0

      @lorow23

      but how I should acces particular rectangles then?

      With the model approach it wont be required. The delegate items will get the data from model. Also when required you just need to update the model with new data from the delegate or from outside.
      For eg. ListModel has several methods to access the data.

    • M

      Unsolved Binding loop detected for width/height
      QML and Qt Quick • gridview binding loop align • • Mark81

      2
      0
      Votes
      2
      Posts
      1999
      Views

      p3c0

      @Mark81
      The cellHeight when changes updates the cellWidth in this line:

      cellWidth: Math.min(parent.width, parent.height) == parent.width ? parent.width / 3 : cellHeight

      this cellWidth change re-evaluates the binding and updates the cellHeight in this line:

      cellHeight: Math.min(parent.width, parent.height) == parent.width ? cellWidth : parent.height / 2

      And this goes on foreever and hence the error.

      By the way, how to center the GridView content? It fills the available space from left-to right.

      How do you want it to appear ? Can you share some image ?

    • A

      Solved How to center a gridview in the parent element?
      QML and Qt Quick • gridview • • Alex M

      2
      0
      Votes
      2
      Posts
      1093
      Views

      L

      Doing calculations is the best way. Please, see:

      https://forum.qt.io/topic/64977/alignment-questions-for-qml-gridview

    • C

      Solved displaying multiple columns using grid view
      QML and Qt Quick • gridview • • clarity

      3
      0
      Votes
      3
      Posts
      900
      Views

      C

      @clarity The Gridview is not a table. It's a list that wraps around

    • S

      Unsolved How to load ListModel to GridView depending on button clicked - QML
      General and Desktop • qml c++ to qml gridview listmodel buttons • • Stravinsky

      2
      0
      Votes
      2
      Posts
      1521
      Views

      S

      I create MyClass and pass 4 images to QML in main.cpp

      class.h

      #ifndef MYCLASS_H #define MYCLASS_H #include <QDebug> #include <QObject> class MyClass : public QObject { Q_OBJECT Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY pathChanged); public: explicit MyClass(QObject *parent = 0); MyClass(QString path) { m_imagePath = path; } QString imagePath(); void setImagePath(const QString & path); signals: void pathChanged(QString path); private: QString m_imagePath; }; #endif // MYCLASS_H

      main.cpp

      QApplication app(argc, argv); app.setWindowIcon(QIcon("qrc:/images/logo.ico")); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QList<QObject*> dataList; dataList.append(new MyClass("/images/images/zaglowek.png")); dataList.append(new MyClass("/images/images/pilot.png")); dataList.append(new MyClass("/images/images/uklad_jezdny.png")); dataList.append(new MyClass("/images/images/nozne_sterowanie.png")); engine.rootContext()->setContextProperty("myModel", QVariant::fromValue(dataList));

      For Now MyClass has only image path, but it will also set state (checked-unchecked) and animation (enable-disable).
      I would like to reload this QList ( with another images, states etc. ) when button ( one of three ) is clicked ( TButton.qml ).
      How to do it ? Please help.

    • S

      How can i get gridview element's x,y coordinate in the gridview rect
      QML and Qt Quick • gridview • • ssjoon

      1
      0
      Votes
      1
      Posts
      578
      Views

      No one has replied

    • E

      Cannot embed a GridView inside of a ScrollView
      QML and Qt Quick • scrollview gridview • • Ethan

      2
      0
      Votes
      2
      Posts
      802
      Views

      E

      I figured out why the GridView wasn't scrolling. I'm still having issues with the transitions as I described, but I don't think that's really a reasonable question to ask here at this time...so that's why I deleted the post.

    • N

      [solved] OpenGL Widget in the Grid
      General and Desktop • opengl gridview graphics scene • • N.Sumi

      5
      0
      Votes
      5
      Posts
      1248
      Views

      N

      Hi Mr. SGaist,

      Surely I will do it.

      Thanks for suggestions.