Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Object vector in a qt widget application
Qt 6.11 is out! See what's new in the release blog

Object vector in a qt widget application

Scheduled Pinned Locked Moved Unsolved C++ Gurus
3 Posts 2 Posters 707 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    hello everyone, I'm trying to make a simple widget application like a form, where the user can introduce several data, check if the data is correct and then show it in a list, the thing is that i want that every time the data is correct it gets stored in a vector of objets, the question is how can I "connect" the interface( mainwindow) with my object and create a
    vector <Object> objectlist;? thanks in advance :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Shall that data be stored in the long term ?

      In any case, based on your description, you should go through the Model View Programming chapter in Qt's documentation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      ? 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Shall that data be stored in the long term ?

        In any case, based on your description, you should go through the Model View Programming chapter in Qt's documentation.

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @SGaist only meanwhile the program is running, once i close the program the data is lost, the program is just to simulate a form where the features of different vehicles are the input( number of wheels, if it has engine...) and once all the inputs are ready the program must check which tipe of vehicle it is, so I want the data to be stored in the object vehicle.

        I found out that adding to the private field in mainwindow.h :

        Vehicle v;
        vector<Vehicle> vehicleList;

        may work.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved