Results 1 to 4 of 4

Thread: How to replicate the Yosemite OSX search format for settings using QtableWidget

  1. #1
    Join Date
    Aug 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Lightbulb How to replicate the Yosemite OSX search format for settings using QtableWidget

    Hello All,

    I would Like to implement something similar to the image below, But I have no idea how to create the effect of the spotlight on the particular item once the search function finds the right name.

    dns-network-search.jpg


    Here is what I have done so far:

    I created a 6x8 QTableWidget, and inside this table widget I inserted arbitrary values (for convenience I entered the values from 1 to 49 in order). Then I stored those values in a QMap. The QMap was created such that my key will be the arbitrary values since thats what the user will eventually input in order to find it. For the values of the QMap I stored the location of the value (row,column).

    Thus, the QMap<int,QPair<int,int>> search_parameter

    Now, again what I would like to do is to put a QLineEdit, so that when the user inputs some arbitrary value (in this case any number from 1 to 49). In the table it reflects an effect as shown in the picture above. Or something similar.

    Sorry for the poor explanation if you guys have any question don't be afraid to ask. Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to replicate the Yosemite OSX search format for settings using QtableWidget

    Hmm.

    And idea would be to put another widget on to of the table widget and only show it when searching.
    When it is shown, it fills its area with a semi transparent color and draws filled circles with fully transparent color at the "highlight" areas.

    Cheers,
    _

  3. #3
    Join Date
    Aug 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: How to replicate the Yosemite OSX search format for settings using QtableWidget

    Quote Originally Posted by anda_skoa View Post
    Hmm.

    And idea would be to put another widget on to of the table widget and only show it when searching.
    When it is shown, it fills its area with a semi transparent color and draws filled circles with fully transparent color at the "highlight" areas.

    Cheers,
    _
    I grasp the idea conceptually, can you provide me with a quick simple example of how to do it. Because the moment I try to do that I loose focus on the QtableWidget. Since I want to highlight it, and yet still be able to use the others widget inside the cell.

    Thanks!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to replicate the Yosemite OSX search format for settings using QtableWidget

    You probably have to play with the focus policy of the cover widget, e.g. set it to NoFocus.

    Cheers,
    _

Similar Threads

  1. qwtlegend replicate v5 behavior
    By mqt in forum Qwt
    Replies: 1
    Last Post: 7th May 2015, 05:04
  2. OS X Yosemite, iOS 8 and Xcode 6
    By guidupas in forum Qt Programming
    Replies: 0
    Last Post: 16th June 2014, 23:28
  3. Replies: 6
    Last Post: 17th January 2012, 09:04
  4. how to perform search in QTableWidget?
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 5th January 2012, 04:25
  5. Replies: 1
    Last Post: 14th January 2011, 11:57

Tags for this Thread

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.