[Interest] QTabWidget activity

william.crocker at analog.com william.crocker at analog.com
Thu Jan 7 22:47:03 CET 2016


On 01/07/2016 03:44 PM, Murphy, Sean wrote:
> I'm trying to figure out the right way to show some feedback to the user and I'm stuck. Here's the setup:
> - I have a QTabWidget, that has three tabs, one for live data, one for archived data, and a third tab that doesn't having much to do with this particular issue, other than it exists.
> - On the first tab we plot a live feed of data from a variety of sensors
>    - Also on this tab, there is a "Take Snapshot" button
>    - Pressing the "Take Snapshot" button should make a copy of the current plot data under the second tab while keeping the first tab (the live data) as the current tab index
> - On the second tab, there's a child tab widget that shows the snapshots taken above, one snapshot per tab
>
> This works fine, except that there's no real indication to the user that pressing the "Take Snapshot" button actually worked

Put a tool tip on the button telling them what it will do when they press it.
Then, have the button stay pressed an extra few milliseconds so it really looks
like it was pressed.

Bill

>until the user clicks on the second tab and sees that the snapshot exists, so 
we'd like to add some sort of visual feedback that it was successful. Ideally, 
I'd like to blink the background color of *just* the second tab a couple times 
to let the user know something changed over there. But looking through 
QTabWidget, QTabBar, there doesn't seem to be any way of changing the background 
color of an specific, individual tab. I can change the text color of a specific 
tab using QTabBar::setTabTextColor(), but after trying that the effect is just a 
little too subtle. The closest thing I can find is through stylesheets using the 
QTabBar::tab:middle subcontrol and pseudostate, which I just luck out that it 
works for me because I only have 3 tabs, and I'm trying to change the middle 
tab. If we add more tabs later, that won't work, unless I switch it to using QTa
>   bBar::tab:last and then change the behavior that the archived data is always on the last tab.
>
> Are there other options to change the color, or does anyone else have a better idea of how to do provide feedback to the user? The only other viable options I see is that I could either:
>   - change the text on the second tab to somehow reflect something changed (like add an * or something)
>   - blink an icon on the second tab using QTabBar::setTabIcon(int index, const QIcon&  icon)
>
> Sean
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>



More information about the Interest mailing list