Results 1 to 7 of 7

Thread: Function running on its own

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Function running on its own

    I am not sure how to get around that
    If you are doing this in the constructor, then the combo box is created but not yet visible. In the slot, you can check isVisible() and only call fillTable() if it returns true.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Apr 2014
    Posts
    59
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Function running on its own

    If you are doing this in the constructor, then the combo box is created but not yet visible.
    I did not realize that. That is certainly much cleaner than what I was planning. Thanks again!

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Function running on its own

    Alternatively, you could bracket the for() loop in your constructor with calls to blockSignals( true ) and blockSignals( false ) through the combo box pointer.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. #4
    Join Date
    Apr 2014
    Posts
    59
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Function running on its own

    That might be another option, but I think it might be better suited for a different situation. Now that I know the combo box is not visible, at that point, I think the first way is more readable.

    Now if I can just get my queries to work right...

Similar Threads

  1. Replies: 12
    Last Post: 18th September 2014, 19:54
  2. Replies: 1
    Last Post: 8th January 2012, 11:33
  3. show a rotating circle when running a busy function
    By hoffen in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2011, 09:33
  4. Running an external function in a new thread
    By Andrea Landi in forum Newbie
    Replies: 3
    Last Post: 29th May 2011, 04:05
  5. Replies: 1
    Last Post: 17th May 2006, 00:23

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.