Results 1 to 11 of 11

Thread: Widget->show() place widget to top left corner (not on the top of mainwindow)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    Hi,

    it doesn't help. Any other advices ? Thanks

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    If you can't post your code, please make a small project that has that behavior and post it.

  3. #3
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    No problem. See attachment.
    Attached Files Attached Files

  4. #4
    Join Date
    May 2010
    Posts
    24
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    Your form should inherit from QDialog, so it can be a top-level window, have a parent and be centered on top of that parent.

    And as Zlatomir said, you should pass this to its constructor:
    Qt Code:
    1. this->form = new Form(this);
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to alexisdm for this useful post:

    Zlatomir (29th May 2010)

  6. #5
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    Hi,

    I think (parent) is OK. If I use your proposals then my mainwindow is mixed with form widget. Did you try it you just assume it should be in that way? Thanks

  7. #6
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    If you make it a dialog it works like you want (or at least like i think you want)

    And i don't recommend to make the Form member in MainWindow (check the code)
    You can emit a signal (a MainWindow signal) when member button is clicked, and connect that with the show() slot of your Form (that's what on_bla_bla slots do with auto-connect, or you can manualy connect them)
    Attached Files Attached Files
    Last edited by Zlatomir; 29th May 2010 at 18:41.

  8. #7
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Widget->show() place widget to top left corner (not on the top of mainwindow)

    Hmm, I think this doesn't solve my situation. I need to mention I use 5 same widgets which I show with show() method and only 1 of them make a problem (is displayed at the top left corner). With my attachment I would like to show you whats the problem. It's rather strange for me why this happens because I use it is same way.

Similar Threads

  1. How to Disabel close button on top corner of widget
    By jsmith in forum Qt Programming
    Replies: 4
    Last Post: 2nd August 2010, 16:57
  2. QTabWidget: corner widget is not shown
    By dv_ in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2008, 17:30
  3. Replies: 5
    Last Post: 29th August 2007, 16:36
  4. Corner widget in QTabWidget doesn't show up
    By ePharaoh in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2006, 17:02
  5. [qt4] QScrollArea corner widget?
    By sertrem in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2006, 21:42

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.