Discussion:
[Interest] QStackedWidget : hide user controls
Etienne Sandré-Chardonnal
2013-06-14 07:19:00 UTC
Permalink
Dear all,

I am using a QStackedWidget with Qt 4.8.1
The documentation states that : "QStackedWidget provides no intrinsic means
for the user to switch page. This is typically done through a
QComboBox<qthelp://com.trolltech.qt.481/qdoc/qcombobox.html>
or a QListWidget <qthelp://com.trolltech.qt.481/qdoc/qlistwidget.html> that
stores the titles of the QStackedWidget's pages".
This is exactly what I am trying to do. However, there are two little
arrows displayed on the top of the widget that switch the pages and I would
like to remove them. The whole thing has to be designed with Qt Designer,
so using a custom class with QStackedLayout is not an option.

How can I remove the arrows, and why is this not working as in the
documentation? Is it a style issue?

Thanks!

Etienne
Danny Koppel
2013-06-14 07:43:53 UTC
Permalink
Etienne,

I thought that the arrows are only visible in designer. For convenience purposes.

Kind regards,
Danny

Van: interest-bounces+d.koppel=skf-***@qt-project.org [mailto:interest-bounces+d.koppel=skf-***@qt-project.org] Namens Etienne Sandré-Chardonnal
Verzonden: vrijdag 14 juni 2013 9:19
Aan: ***@qt-project.org
Onderwerp: [Interest] QStackedWidget : hide user controls

Dear all,
I am using a QStackedWidget with Qt 4.8.1
The documentation states that : "QStackedWidget provides no intrinsic means for the user to switch page. This is typically done through a QComboBox<qthelp://com.trolltech.qt.481/qdoc/qcombobox.html> or a QListWidget<qthelp://com.trolltech.qt.481/qdoc/qlistwidget.html> that stores the titles of the QStackedWidget's pages".
This is exactly what I am trying to do. However, there are two little arrows displayed on the top of the widget that switch the pages and I would like to remove them. The whole thing has to be designed with Qt Designer, so using a custom class with QStackedLayout is not an option.
How can I remove the arrows, and why is this not working as in the documentation? Is it a style issue?

Thanks!

Etienne
Etienne Sandré-Chardonnal
2013-06-14 07:50:02 UTC
Permalink
Hi Dany,

There are visible at least in "preview" mode. I thought the preview
function was just creating the widget as it would be in its final use, but
I will test in the app. If not, that's a strange behavior of the preview.

Etienne
Etienne,****
** **
I thought that the arrows are only visible in designer. For convenience
purposes.****
** **
Kind regards,****
Danny ****
** **
Sandré-Chardonnal
*Verzonden:* vrijdag 14 juni 2013 9:19
*Onderwerp:* [Interest] QStackedWidget : hide user controls****
** **
Dear all,****
I am using a QStackedWidget with Qt 4.8.1****
The documentation states that : "QStackedWidget provides no intrinsic
means for the user to switch page. This is typically done through a
QComboBox or a QListWidget that stores the titles of the QStackedWidget's
pages".****
This is exactly what I am trying to do. However, there are two little
arrows displayed on the top of the widget that switch the pages and I would
like to remove them. The whole thing has to be designed with Qt Designer,
so using a custom class with QStackedLayout is not an option.****
How can I remove the arrows, and why is this not working as in the
documentation? Is it a style issue?
Thanks!
Etienne****
André Somers
2013-06-14 07:55:58 UTC
Permalink
Post by Etienne Sandré-Chardonnal
Hi Dany,
There are visible at least in "preview" mode. I thought the preview
function was just creating the widget as it would be in its final use,
but I will test in the app. If not, that's a strange behavior of the
preview.
It *is* for preview mode, and the reason that they are there is, that
often the machinery to control the switching of the page is in the
source code, not in the .ui file. That would make it impossible to see
the pages other than the first in a preview, which would be very
inconvenient. So, the arrows are there in design and preview mode only.
They are not there in the actual running application.

André
--
You like Qt?
I am looking for collegues to join me at i-Optics!
André Somers
2013-06-14 08:40:56 UTC
Permalink
Hi,

Please keep the discussion on the list.
OK,
I'm still not convinced with the logic behind it though. There are two
- Change the page in designer, then start preview for each page
That prevents you from spotting things like different margins on
different pages, causing widgets to appear to jump around. Being able to
quicly change tabs in preview allows you to spot that. Also, which page
is first is part of the design of the form, and I don't want to change
the design in order to preview it.
- Add a QComboBox with page names and connect its item changed slot
to QStackedWidget set page slot.
So, you suggest actually changing the design of the form just to be able
to preview it? Who says I want to use a combo box in my form? Perhaps I
want to use a tree view. Or a completely custom widget. Or...
Issue is the arrows are included in the layout and take space, which
is screwing up the sheet design. It would be better, at least, to
overlay the arrows instead of using layout for displaying them. The
most valuable use of designer for me is it allows to optimize design
and layout visually very quickly. That's just a suggestion though...
AFAIK, the arrows *are* overlayed. They do not take their own space. But
if they turn out not to be, it's a good suggestion.

André
--
You like Qt?
I am looking for collegues to join me at i-Optics!
Loading...