Qt-interest Archive, April 2007
[4.3.0] New behavior of QToolBar extension is broken
Message 1 in thread
The behavior of the QToolBar extension has apparently been changed
in Qt 4.3. Previously a click on the extension button popped up
a menu with the rest of the toolbar items. Now the toolbar is slowly
animated to expand to its full size. While this may look fancy, it's
IMHO by far not as useful as the old method. Plus, there's a big problem
if the window isn't large enough to fit the expanded toolbar into it.
The attached test example creates a window with a toolbar.
Resize the window until there are only one or two of the "X"
buttons visible. Now click on the extension button and see
that you don't get access to all toolbar items any more.
This example may seem artificial, but isn't it just important for
*small* windows to be able to expand their toolbars?
Besides, if you dare to inadvertently move the cursor outside the extended
toolbar while moving the mouse to the desired item, it immediately
closes itself again.
I have reported this to TT on 2007-03-27, which should have given them
enough time to revert to the old extension mechanism (which I would
prefer over the new one any time). But today I was told that "now Qt 4.3
is entering the final stages we have to be very restrictive on what gets
changed". Well, they should have been more careful with what they change
*before* breaking this! They even told me to implement my own extension
button if this is a problem! Hello?! What was the reason for using Qt again?
Oh, yes: *not* to have to do such basic things myself!...
Klaus Schmidinger
#include <qapplication.h>
#include <qapplication.h>
#include <qcombobox.h>
#include <qicon.h>
#include <qmainwindow.h>
#include <qpushbutton.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <stdio.h>
const char * pm[] = {
"16 16 2 1",
" c None",
". c black",
". .",
" . . ",
" . . ",
" . . ",
" . . ",
" . . ",
" . . ",
" .. ",
" .. ",
" . . ",
" . . ",
" . . ",
" . . ",
" . . ",
" . . ",
". ."};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow mw;
QToolBar *toolBar = new QToolBar;
mw.addToolBar(toolBar);
for (int i = 1; i <= 10; i++) {
QToolButton *b = new QToolButton;
b->setIcon(QIcon(pm));
b->setText("Button" + QString::number(i));
toolBar->addWidget(b);
}
QComboBox *cb = new QComboBox;
cb->addItem("Item 1");
cb->addItem("Item 2");
cb->addItem("Item 3");
toolBar->addWidget(cb);
mw.show();
a.exec();
return 0;
}
Message 2 in thread
Klaus Schmidinger wrote:
> The behavior of the QToolBar extension has apparently been changed
> in Qt 4.3. Previously a click on the extension button popped up
> a menu with the rest of the toolbar items. Now the toolbar is slowly
> animated to expand to its full size...
One more bad thing about this new toolbar extension method:
If you have a window that is just too small for the toolbar
to be fully displayed and press the extension button so that
one or two additional items are displayed, these items are
at the very left end of the toolbar. Now you have to move the
mouse cursor all the way to the left, being very careful not to
get outside the toolbar area, because then it would immediately
close. With the old method the additional toolbar items appeared
right where the mouse was, and it was simple and easy to select
from them.
Am I actually the only one who sees these problems?
Klaus Schmidinger
--
[ signature omitted ]
Message 3 in thread
On 25.04.07 13:05:41, Klaus Schmidinger wrote:
> Klaus Schmidinger wrote:
> > The behavior of the QToolBar extension has apparently been changed
> > in Qt 4.3. Previously a click on the extension button popped up
> > a menu with the rest of the toolbar items. Now the toolbar is slowly
> > animated to expand to its full size...
>
> One more bad thing about this new toolbar extension method:
>
> If you have a window that is just too small for the toolbar
> to be fully displayed and press the extension button so that
> one or two additional items are displayed, these items are
> at the very left end of the toolbar. Now you have to move the
> mouse cursor all the way to the left, being very careful not to
> get outside the toolbar area, because then it would immediately
> close. With the old method the additional toolbar items appeared
> right where the mouse was, and it was simple and easy to select
> >from them.
>
> Am I actually the only one who sees these problems?
No, I suggest you send a bugreport to TT about this. However a toolbar
that is too large for a 500 pixel window with small icons, probably
contains too many buttons anyway and should be split up into 2 or more
toolbars.
Andreas
--
[ signature omitted ]
Message 4 in thread
Andreas Pakulat wrote:
> On 25.04.07 13:05:41, Klaus Schmidinger wrote:
>> Klaus Schmidinger wrote:
>>> The behavior of the QToolBar extension has apparently been changed
>>> in Qt 4.3. Previously a click on the extension button popped up
>>> a menu with the rest of the toolbar items. Now the toolbar is slowly
>>> animated to expand to its full size...
>> One more bad thing about this new toolbar extension method:
>>
>> If you have a window that is just too small for the toolbar
>> to be fully displayed and press the extension button so that
>> one or two additional items are displayed, these items are
>> at the very left end of the toolbar. Now you have to move the
>> mouse cursor all the way to the left, being very careful not to
>> get outside the toolbar area, because then it would immediately
>> close. With the old method the additional toolbar items appeared
>> right where the mouse was, and it was simple and easy to select
>> >from them.
>>
>> Am I actually the only one who sees these problems?
>
> No, I suggest you send a bugreport to TT about this.
I already did (task tracker entries #156285 #159715), but they told
me they'd do a "fix" for this in Qt 4.4! That's why I posted this
here in the first place, to raise a public vote for fixing this
*now* - after all, they broke it between Qt 4.2 and Qt 4.3, and I
reported it in the test phase of Qt 4.3.0, but now they claim it's
too late to fix it.
Strange release policy...
> However a toolbar
> that is too large for a 500 pixel window with small icons, probably
> contains too many buttons anyway and should be split up into 2 or more
> toolbars.
With this argument we wouldn't need a toolbar extension, anyway ;-)
My point is mainly: the toolbar extension worked fine in Qt 4.2
and many Qt 4.3 snapshots, and was recently broken. If they want to
introduce a new way of handling the toolbar extension, they could
as well have kept the old way as default and implement an optional
new way. Or even make the new way the default and allow the user
to go back to the old way. But apparently they just replaced the
old working way with a new broken one, and now even though it has been
reported during testing, it doesn't get fixed.
I wonder what good testing Qt betas is if reported problems aren't fixed?!
It appears to me like a Qt beta test means "Send in bug reports, so
we can fix them for the *next* version - this one will be released buggy,
anyway, because the relase date is fixed!".
Klaus Schmidinger
--
[ signature omitted ]
Message 5 in thread
On 25.04.07 13:43:16, Klaus Schmidinger wrote:
> Andreas Pakulat wrote:
> > On 25.04.07 13:05:41, Klaus Schmidinger wrote:
> >> Klaus Schmidinger wrote:
> >>> The behavior of the QToolBar extension has apparently been changed
> >>> in Qt 4.3. Previously a click on the extension button popped up
> >>> a menu with the rest of the toolbar items. Now the toolbar is slowly
> >>> animated to expand to its full size...
> >> One more bad thing about this new toolbar extension method:
> >>
> >> If you have a window that is just too small for the toolbar
> >> to be fully displayed and press the extension button so that
> >> one or two additional items are displayed, these items are
> >> at the very left end of the toolbar. Now you have to move the
> >> mouse cursor all the way to the left, being very careful not to
> >> get outside the toolbar area, because then it would immediately
> >> close. With the old method the additional toolbar items appeared
> >> right where the mouse was, and it was simple and easy to select
> >> >from them.
> >>
> >> Am I actually the only one who sees these problems?
> >
> > No, I suggest you send a bugreport to TT about this.
>
> I already did (task tracker entries #156285 #159715), but they told
> me they'd do a "fix" for this in Qt 4.4! That's why I posted this
> here in the first place, to raise a public vote for fixing this
> *now* - after all, they broke it between Qt 4.2 and Qt 4.3, and I
> reported it in the test phase of Qt 4.3.0, but now they claim it's
> too late to fix it.
> Strange release policy...
The first one is already fixed, in the second there's an information as
to why this can't be done in 4.3. I'm not a TT member but I can
understand their problem. With the beta the API is frozen, only bugfixes
may occur (I think) and as the comment states the fix needs API changes.
This is unfortunate but as I said large toolbars on small windows is
rather seldom I'd say.
> I wonder what good testing Qt betas is if reported problems aren't fixed?!
> It appears to me like a Qt beta test means "Send in bug reports, so
> we can fix them for the *next* version - this one will be released buggy,
> anyway, because the relase date is fixed!".
Come on, this is nonsense. They do fix bugs (and not just one or two),
but the API is not allowed to be changed after the first beta, which is
a good thing.
Andreas
--
[ signature omitted ]
Message 6 in thread
Andreas Pakulat wrote:
> On 25.04.07 13:43:16, Klaus Schmidinger wrote:
>> ...
>> I wonder what good testing Qt betas is if reported problems aren't fixed?!
>> It appears to me like a Qt beta test means "Send in bug reports, so
>> we can fix them for the *next* version - this one will be released buggy,
>> anyway, because the relase date is fixed!".
>
> Come on, this is nonsense. They do fix bugs (and not just one or two),
> but the API is not allowed to be changed after the first beta, which is
> a good thing.
They could very easily fix this by just going back to the old method
for now and introducing the new method later (together with the API
change). I really don't understand why they insist in introducing
a broken method now and repairing it later.
Klaus Schmidinger
--
[ signature omitted ]
Message 7 in thread
Klaus Schmidinger wrote:
> Andreas Pakulat wrote:
>> On 25.04.07 13:43:16, Klaus Schmidinger wrote:
>>> ...
>>> I wonder what good testing Qt betas is if reported problems aren't
>>> fixed?! It appears to me like a Qt beta test means "Send in bug reports,
>>> so we can fix them for the *next* version - this one will be released
>>> buggy, anyway, because the relase date is fixed!".
>>
>> Come on, this is nonsense. They do fix bugs (and not just one or two),
>> but the API is not allowed to be changed after the first beta, which is
>> a good thing.
>
> They could very easily fix this by just going back to the old method
> for now and introducing the new method later (together with the API
> change). I really don't understand why they insist in introducing
> a broken method now and repairing it later.
>
> Klaus Schmidinger
Hi,
The reason for the new functionality is not just to be flashy. Previously
QToolBar extension popups suffered the problem, that they couldn't display
QwidgetActions whith a default widget set. The widget could not be
reparented into the menu without removing the action from the toolbar, it
was quite a mess.
Now, since the toolbar itself grows, no reparenting is necessary and all
actions are displayed.
I have just submitted several fixes that address some of your concerns. The
toolbars now try to expand to be sqaure, rather than very tall and thin, or
short and wide. This should improve things in small main windows.
The animation is also optimized and should be faster.
The old code for displaying a popup is still in there. It is used when the
toolbar is not a child of the QMainWindow, and on Mac when it's a unified
toolbar. In Qt 4.4 we will add a property to toolbars which will enable the
old popup behavior. Unfortunately it's too late for API changes to go into
Qt 4.3.
Best regards,
Jacek
--
[ signature omitted ]
Message 8 in thread
> > The behavior of the QToolBar extension has apparently been changed
> > in Qt 4.3. Previously a click on the extension button popped up
> > a menu with the rest of the toolbar items. Now the toolbar is slowly
> > animated to expand to its full size...
> Am I actually the only one who sees these problems?
>
No, I am having the same problems and would like the behavior to be
configurable (old style vs. new (animated) style).
\Ralf
--
[ signature omitted ]