Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Desktop development - 2 questions: Scaling children in sync with main widget and switching views ('layouts' ... 'scenes'???) in a single widget
Forum Updated to NodeBB v4.3 + New Features

Desktop development - 2 questions: Scaling children in sync with main widget and switching views ('layouts' ... 'scenes'???) in a single widget

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    p14r
    wrote on last edited by
    #1

    Hoi everybody.

    After 10 years I've finally decided to join the Qt/C++ fray, have started my first small desktop application and now have to fundamental questions I haven't found answers to googling:

    1. I've got a QWidget as my main window and have placed some child-ui-components in there. I'd like those to scale along with the QWidget. Right now the Toolbox inside a vertical layout inside the QWidget doesn't budge. How is scaling and layout management done in Qt - is there some neat method - preferably a visual one in Qt designer in place for that or do I have to start listening to 'QWidgetScaleEvents' and stuff like that and adjusting my subcomponents size myself? I'd expect some basic attributes for this and some accompaning boolean notches in the designer inspector like 'scale with parent' or something, no?

    2. I want to be able to switch views (layouts, scenes, ... whatever they're called in Qt) in said main widget. Turning of individual 'pages' of my desktop app. Right now I'm stacking vertical layouts on top of one another in the Designer and turning them and their children on and off with a large chain of various foo->bar->setVisible(false); and foo->bar->setEnabled(false); and foo->bar->>setVisible(true); etc ... You get the picture. It just doesn't feel right and I'd like to know how this is done correctly - I couldn't find such a thing as a 'layout' pane or 'scene pane' or something in the Designer. Any hints?

    I'm a bit lost on both of these and am thankful for any help.

    Oh, and btw., I'm developing on Mac OS X and would like to deploy my app to OS X and Windows. ... Any trouble I should expect and avoid concerning UI building and components? ... Once again, this is a rather trivial n00by app, a file system level image db integrated with a GUI, nothing big.

    Greetings,
    Qt n00b

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Atul Patil
      wrote on last edited by
      #2

      Hi,

      For Your first question you can use sizepolicy property as expanding along with layouts.
      for more information refer "http://developer.qt.nokia.com/doc/qt-4.8/layout.html":http://developer.qt.nokia.com/doc/qt-4.8/layout.html

      for second question, u can use stacked widget where u can create pages and change current active page. for more information visit "http://www.developer.nokia.com/Community/Wiki/Implementing_a_widget_stack_in_Qt":http://www.developer.nokia.com/Community/Wiki/Implementing_a_widget_stack_in_Qt

      1 Reply Last reply
      0
      • P Offline
        P Offline
        p14r
        wrote on last edited by
        #3

        Thanks for the reply, was of great help.

        Qt n00b

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved