Qt Spin Box and Combo Box Properties

edited March 2013 in Ruby Scripting
Hi Matthias,

These should be pretty simple questions. How do I place title text for a spin and combo box? This isn't window title text, and it is not the text or number within the actual spin or combo box but should be above it. This is a window with multiple widgets (ie multiple spin boxes, combo boxes, check boxes,etc).
Also how do I space them? Right now they appear right to left in the window in a single row. How do I place them underneath one another?
I have looked for the right methods, but I just can't find it.

Jared

Comments

  • edited November -1

    Hi Jared,

    that is pretty much domain the of Qt library. Qt uses a layout system which automatically will arrange the objects.
    There are numerous tutorials for Qt. The first one covering the layout system I found is http://www.digitalfanatics.org/projects/qt_tutorial/chapter06.html. They are all for C++, but except the signal/slot mechanism which is mapped differently in KLayout's Qt binding, the samples should be easy to translate into Ruby.

    I personally prefer using the UI designer which allows to graphically design a dialog or widget and use that in your application (see http://klayout.de/doc/programming/qt_binding.html#h2-216 for example).

    Regards,

    Matthias

  • edited November -1
    Matthias,

    Thank you for the examples.
    Is the "UI Designer" a downloadable program from a website?

    Jared
  • edited March 2013

    Hi Jared,

    the UI designer comes with the Qt package. On Linux it's easy to install - it usually comes with the qt developer tools package. On Windows it can be found inside the QtSDK. However right now it's not easy to find a download for the Qt 4 version because they are rolling out Qt 5 which I assume is not backward compatible.

    The UI designer basically is a tool that lets you edit .ui files. These are XML files which you can load into the QFormBuilder and let it generate your dialogs without having to code the widget creation and layout management.

    Regards,

    Matthias

Sign In or Register to comment.