Results 1 to 4 of 4

Thread: QSqlTableModel reference in a second dialog....

  1. #1
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QSqlTableModel reference in a second dialog....

    First off, please go easy on me as I'm lack-of-sleep-addled from a 4 month old and visit from the in-laws...

    Second -- I'm trying to reference a model that I've created in my MainWindow in a secondary data entry dialog that I've created...I have a pushbutton that creates a pop-up dialog wthat includes comboboxes populated from models instantiated in my MainWindow dialog...I can't seem to make the pop-up dialog "see" the model created in MainWindow dialog no matter what I've tried so I'm wondering if someone knows of an example I can follow...

    Thanks for any help!


    scott

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QSqlTableModel reference in a second dialog....

    Member variable visibility is governed by the rules of C++. Private and protected members are not generally visible outside the class. Pass a reference or pointer to the model when you construct your pop-up dialog.

  3. #3
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QSqlTableModel reference in a second dialog....

    I tried that but but I was probably hacking too much and not thinking it thru, so I'll try that route again...Thanks!


    scott

  4. #4
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QSqlTableModel reference in a second dialog....

    Yep, stupid typo with my pointers...Went back to the start and added the variables I needed one at a time CAREFULLY and it worked fine...Thanks for the help and sorry for the bother...


    scott

Similar Threads

  1. How to access objects of parent Dialog from Child Dialog .
    By ranjit.kadam in forum Qt Programming
    Replies: 4
    Last Post: 18th April 2011, 06:39
  2. Replies: 8
    Last Post: 30th March 2011, 20:06
  3. Replies: 0
    Last Post: 5th October 2010, 07:41
  4. closing child dialog closes parent dialog
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 28th May 2010, 19:46
  5. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 13:01

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.