[bt-devel] Close button on tabs

Gary Holmlund gary.holmlund at gmail.com
Sat Aug 20 08:17:41 MST 2011


On 08/20/2011 12:54 AM, Jaak Ristioja wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 20.08.2011 06:22, Gary Holmlund wrote:
>> Jaak,
>>
>> I was looking at the feature requests and saw that the request to add
>> close buttons to tabs would be easy to do. I checked it in a bit ago. I
>> did not realize that you had recently assigned it to yourself until I
>> went to close it. I am sorry for not checking this first.
>>
>> Gary
> Hi Gary!
>
> No problem. This is not high-priority thing anyway. Thanks you for your
> contribution! :) I took a quick look at your commit, and I have a few
> small questions/issues about this:
>
> * Are you sure the using findChildren() is ok? I mean it's recursive and
> could match any QTabBar in the QObject chain. Maybe we should explicitly
> use a QTabWidget for this MDI type.
The QMdiArea manages the QTabBar, but does not give any direct functions 
for accessing it. There is only one QTabBar when in tab mode and it is 
deleted when you are not in tab mode. It is not possible to mix using 
your own QTabBar or QTabWidget with QMdiArea. If we do not use 
findChildren the tab close buttons cannot be implemented.

If we were using QTabBar in our works windows, the recursion would cause 
a problem. We are not currently doing this, so there is no problem right 
now. I may be able to check that the QTabBar's parent, parent is our 
cmdiarea(QMdiArea). It's actual parent is a private member of the 
QMdiArea. This would eliminate a future problem. I will look into this 
further later today.
> * setTabsCloseable was introduced in Qt 4.5. Can anybody recall what was
> the minimum Qt version we require?
As Martin already mentioned, it is 4.5.
> * Do we really need to use disconnect() there?
The disconnect is there to prevent multiple connections from the QTabBar 
to the closeTab slot. The first time through this code, the disconnect 
does nothing. Each time after that slot is disconnected and reconnected. 
Without this, there will be multiple calls to the closeTab slot for a 
single click of the close button.
> * Changelog entry had extra space at the end of line (git diff printed
> it out RED)
My git diff does not show this. What are tool you using?
> * #includes appear to be in non-alphabetical order (would be easier to
> read imho).
I guess I could agree to doing that. They were not completely in 
alphabetical order before my change.
>
> Feel free to express your opinion and argue with me :)
>
>
> Many blessings! :)
> Jaak
>
>




More information about the bt-devel mailing list