Results 1 to 18 of 18

Thread: Modification of a question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Modification of a question

    Quote Originally Posted by R.ANGEL View Post
    I didn't want to come back and post without attempting any solution to original posted question because that would mean I did not learn anything from the stuff I read.
    Now that's a great attitude! Congratulations!

    Before we get into lists and maps, please try to think whether you really need Film to inherit QObject and if not, whether you need the map to hold pointers to Film instances instead of just Film instances (i.e. QMap<int,Film> and not QMap<int,Film*>).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Aug 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Modification of a question

    good morning

    I need the map to hold pointers to film instances such as:

    QMap<int, Film*>

    in my opinion from reading the question.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Modification of a question

    Why do you need pointers?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Aug 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Modification of a question

    I thought that since inheritance was occurring we would need to use pointers.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Modification of a question

    Quote Originally Posted by R.ANGEL View Post
    I thought that since inheritance was occurring we would need to use pointers.
    Inheritance itself has nothing to do with this. Only if you inherit QObject you need to use pointers because QObject instances can't be copied. But your class does not require QObject legacy, thus my original question.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Aug 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Modification of a question

    so I guess I have been attempting this solution the incorrect way by inheriting QObject and using pointers

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Modification of a question

    It is not that it is incorrect, it's just more difficult and simply not required. I suggest you KISS.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Aug 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Modification of a question

    I am unsure on how to proceed next in completing my solution though

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Modification of a question

    Remove QObject legacy, change the map definition and implement functions for adding film instances to the map, removing them, etc.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Aug 2013
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Modification of a question

    ok thank you Sir, I will attempt that and repost my solution

Similar Threads

  1. modification to pictureflow widget
    By qtnewbi3 in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2011, 14:47
  2. Layout modification in QListWidget
    By ouekah in forum Newbie
    Replies: 2
    Last Post: 20th March 2010, 06:15
  3. QStandardItem color modification
    By prashant in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2009, 09:24
  4. file modification date/time
    By tommy in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2009, 20:43
  5. modification time on files
    By soul_rebel in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2007, 20:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.