Results 1 to 6 of 6

Thread: StackedWidget overlapped

  1. #1
    Join Date
    Jul 2006
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default StackedWidget overlapped

    Hi, i am using a StackedWidget like this:

    Qt Code:
    1. clientes = new DialogListaClientes();
    2. articulos = new DialogListaArticulos();
    3. facturas = new DialogListaFacturas();
    4. stackedWidget->addWidget(articulos);
    5. stackedWidget->addWidget(facturas);
    6. stackedWidget->addWidget(clientes);
    7. stackedWidget->setCurrentWidget(clientes);
    To copy to clipboard, switch view to plain text mode 



    Now whe i run the app, the three widgets are overlappedd, i mean there are the three visible. That is not correct, only one widget should be showed at time, right?

    How can i fix this??
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: StackedWidget overlapped

    Quote Originally Posted by manucorrales
    Now whe i run the app, the three widgets are overlappedd, i mean there are the three visible. That is not correct, only one widget should be showed at time, right?

    How can i fix this??
    Yes, there should be only one widget visible at time. Does it make any difference if you construct the widgets with the stacked widget as parent? Which exact version of Qt 4 is this, maybe time to update to the latest..?
    J-P Nurmi

  3. #3
    Join Date
    Jul 2006
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: StackedWidget overlapped

    What do you mean by "construct the widgets with the stacked widget as parent"?

    I am using qt 4.1.4. I believe is the latest, but i am waiting for 4.2 to be stable for using it.

    Thanks for your answer.
    Last edited by manucorrales; 14th July 2006 at 21:00. Reason: mmm...

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: StackedWidget overlapped

    Ok, good. It's the latest.

    I meant something like this:
    Qt Code:
    1. clientes = new DialogListaClientes(stackedWidget);
    To copy to clipboard, switch view to plain text mode 

    But now after a tiny moment of thinking, I doubt that's the problem. What kind of widgets are these DialogLista*? Do they derive from QDialog? If so, I'm pretty sure that causes the problem.
    J-P Nurmi

  5. #5
    Join Date
    Jul 2006
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: StackedWidget overlapped

    Yep, there are QDialog subclasses. The strange thing is that use to work on previous versions of Qt.

    Anyway, I can change and subclass of QWidget, right? What do you recommend?

    Thanks.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: StackedWidget overlapped

    Yeah, anything else than QDialog should do the trick. QDialog is a special widget whose behaviour differs from other widgets:
    Note that QDialog uses the parent widget slightly differently from other classes in Qt. A dialog is always a top-level widget, but if it has a parent, its default location is centered on top of the parent's top-level widget (if it is not top-level itself). It will also share the parent's taskbar entry.
    J-P Nurmi

  7. The following 2 users say thank you to jpn for this useful post:

    csvivek (7th May 2008), manucorrales (14th July 2006)

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.