Results 1 to 2 of 2

Thread: Main window

  1. #1
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Main window

    Some questions about the main window:

    How do you generally set up a QWorkspace as the central widget of a main window? Is it possible in Designer? Or do I have to use code?

    QDockWidget? I see you can do something in Designer, but how does that work, exactly? I can put them anywhere, and it'll be 'docked', it seems. Should I simply make it stick to the side with a layout for normal dock widget behaviour? Or might it be better to do the dockwidgets all-code?

    In general, how much of the main window do you do in designer and how much in code (except, of course, the behaviour that can only be done with the code)?
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  2. #2
    Join Date
    Jan 2006
    Location
    N.B. Canada
    Posts
    47
    Thanked 8 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Main window

    How do you generally set up a QWorkspace as the central widget of a main window? Is it possible in Designer? Or do I have to use code?
    I am not at a computer with Qt now, but if there is a widget for it in the designer, than you can work with it in the designer; if there is no widget for it, than you have to do it all in code.

    QDockWidget? I see you can do something in Designer, but how does that work, exactly? I can put them anywhere, and it'll be 'docked', it seems. Should I simply make it stick to the side with a layout for normal dock widget behaviour? Or might it be better to do the dockwidgets all-code?
    Hmm I am not exactly sure myself as to how you are suppose to use dockwidgets in the designer, as I have never tried it. See my answer to your next question.

    In general, how much of the main window do you do in designer and how much in code (except, of course, the behaviour that can only be done with the code)?
    For main windows, I think doing it all in code works better. I find i have much better control over what's setup and how. Usually I use designer for widgets and dialogs because it's a lot faster to do them in the designer, and a lot easier to get the layout(s) right. So the main widget for the main window may be something that is created using designer if needed. Ofcourse, even these things (the ui) are usually customised using the code. So it's really the coded class that is used in the main window. Hope that makes sense. Anyway, that's how I do it.
    The march of progress:
    C:
    printf("%10.2f", x);
    C++:
    cout << setw(10) << setprecision(2) << showpoint << x;
    Java:
    java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
    formatter.setMinimumFractionDigits(2);
    formatter.setMaximumFractionDigits(2);
    String s = formatter.format(x);
    for (int i = s.length(); i < 10; i++) System.out.print(' ');
    System.out.print(s);

Similar Threads

  1. access main window from function
    By eric in forum Qt Programming
    Replies: 6
    Last Post: 19th January 2008, 22:29
  2. minimizing main window
    By eric in forum Qt Programming
    Replies: 4
    Last Post: 28th November 2007, 17:54
  3. Background image for main window widget using css.
    By Enygma in forum Qt Programming
    Replies: 8
    Last Post: 23rd August 2007, 16:40
  4. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 09:41
  5. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 11:21

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.