Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to define structure inside hash?
Forum Updated to NodeBB v4.3 + New Features

How to define structure inside hash?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.5k 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.
  • A Offline
    A Offline
    aurora
    wrote on last edited by
    #1

    Hi is it possible to define a hash function with a structure inside it?
    I tried to define as shown below,....
    But getting link error saying..."exited with code -1073741819"
    @
    class FilterColl : public QDialog
    {
    Q_OBJECT

    public:
    struct StructCheckedEntries {
    QString filename;
    QCheckBox *checkbox;
    QComboBox *combobox;
    QLineEdit *lineedit;
    };
    QHash<QString,StructCheckedEntries *> HCheckedEntries;
     
     
    private:
    Ui::FilterColl *ui;
    StructCheckedEntries *structentry;
    };
    

    @

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      You can basically use any type in the collections. Judging from your exit code you have most probably an access violation somewhere, which results in an segmentation fault.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        We're not talking about a hash function for your class, that would take an instance of that class and return an integer, but about dealing with an QHash based member attribute. Correct wording is essential in programming...

        For the linker error, isn't there more than one single number?

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on last edited by
          #4

          @ QHash<QString,FilterColl::StructCheckedEntries *> HCheckedEntries;@

          God is Real unless explicitly declared as Integer.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aurora
            wrote on last edited by
            #5

            Thank u all...
            I did it....
            Thank u so much....

            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