Results 1 to 3 of 3

Thread: Up this topic if you wanna QDesigner with an Anchors property!

  1. #1
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Talking Up this topic if you wanna QDesigner with an Anchors property!

    As the topic says, let's up this topic until the next version of QDesigner comes with the property Anchors for each visual QT control, so we don't need to waste days learning how to draw layouts by trying and testing until the thing becomes good. What an annoying task and waste of time, huh? Even coding the GUI is easier than using QDesigner in some cases.

    What does Anchors property mean?
    The purpose of an Anchors property is to set, as the name suggests, the anchors (Top/Bottom/Left/Right) of a given visual control. With Anchors you don't need to set any layouts because it will do the job automatically for you. It will resize the controls (eg: inside a QDialog) when you resize the dialog itself. It's a very easy way to design a GUI and it must be part of the next version of QDesigner. Things will become much more easier to design window applications.
    The Anchors property idea is took from Borland IDEs (Delphi/C++Builder). If you already used one of them you know that the anchors property is very usefull when designing GUIs.

    Note: The purpose of this topic is not to clean QT from using layouts, but just to add a new property that will let the developer to choose if he wanna suffer with layouts or to use the anchors property and be very happy!

    Up!

  2. #2
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Up this topic if you wanna QDesigner with an Anchors property!

    The layout mechanism is THE heavenly advantage of Qt compared to all other GUI libs I have seen so far.

    Some months ago I tried to improve a C# app, written by a colleague at work. My goal was to have a proper handling of the GUI elements when the window is resized.
    Whatever this library is called, that provides the GUI elements, I found it really annoying to work with theses "anchor" things (the elements have some sort of properties telling that the element is "sticked" at the e.g. bottom of another element).
    I gave my best, but when the dialog window was scaled down everything was a mess. Some buttons were pushed below text boxes and therefore invisible until the window was made bigger again.

    I decided not to use C# (and all related languages) for apps providing a GUI. It must be bare horror to create a GUI that can be resized and "feels good" in such a language.

    Working with layouts in Qt is different to what other libraries provide concerning "layouting". But it is far more advanced to anything else!
    Get used to it and you will learn to love it.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Up this topic if you wanna QDesigner with an Anchors property!

    Quote Originally Posted by thiforums View Post
    What does Anchors property mean?
    The purpose of an Anchors property is to set, as the name suggests, the anchors (Top/Bottom/Left/Right) of a given visual control. With Anchors you don't need to set any layouts because it will do the job automatically for you. It will resize the controls (eg: inside a QDialog) when you resize the dialog itself. It's a very easy way to design a GUI and it must be part of the next version of QDesigner. Things will become much more easier to design window applications.
    I'm sorry to say that but the "anchor" solution is one of the worst methods of positioning elements within a container. It has no flexibility and it is very error prone. There are many situations which simply can't be expressed with such a mechanism ( such as relative dimensions and non-trivial layouts). Try to express a layout such as the one in the attachment using this mechanism. It's not that simple and it's a single click using the layouts paradigm.

    The Anchors property idea is took from Borland IDEs (Delphi/C++Builder). If you already used one of them you know that the anchors property is very usefull when designing GUIs.
    Borland C++ environment is the worst C++ development environments I have ever seen. Sorry for being so blunt but I really think so.

    Note: The purpose of this topic is not to clean QT from using layouts, but just to add a new property that will let the developer to choose if he wanna suffer with layouts or to use the anchors property and be very happy!
    You don't have to modify Qt to be able to do that, you can implement it with the already provided functionality. Either implement a simple layout where you can specify alignment of items (there already is a similar layout implementation available - it is called "border layout" and as far as I remember it is one of the examples that come with Qt) or use the grid layout where specifying alignments is already possible.
    Attached Images Attached Images
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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.