Results 1 to 2 of 2

Thread: Centering layout in fullscreen application

  1. #1
    Join Date
    Nov 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Centering layout in fullscreen application

    Hi,

    I'm fairly new to Qt, and I'm trying to make a sort of launcher application for my media center PC. Basically a fullscreen application which will let me choose a set of applications to launch (XBMC, Spotify, Firefox etc.).

    Atleast to begin with, the application will consist of:
    • A background image filling up the entire screen
    • A sort of "window"-looking rectangle which is going to act as a visual container
    • A set of icons and labels, one icon and label for each application


    For now I've subclassed a QLabel as my main widget, and I reckon I can simply paint the "window" onto the QLabel. What I'm struggling with right now, however, is how to approach the placement of the icons. Basically they need to be laid out in a grid (grid layout here, I suppose) in the middle of the screen, and expand as needed. The actual layout and expanding I reckon I should be able to accomplish, it's however the part where they're centered on the screen I'm having problems.

    I can think of several solutions to this problem, however neither are ideal. In fact, far from it. What I need is a simple and effective way to center my grid layout, instead of having it lay out the entire screen/main widget. Essentially, I only want to layout a rectangular area in the center of the screen.

    Hope I've made myself somewhat clear, and I hope someone can provide me with a simple way of accomplishing this

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Centering layout in fullscreen application

    I personally would use a list view/widget with a custom delagate (if the painting needs to be different than the default painting)

    If you use a grid layout, you can set margins and alligments.

    What solutions have you thought about and why do you think they are not ideal?

Similar Threads

  1. [Symbian] show device's menu within a fullscreen application
    By curreli in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 12th September 2010, 07:54
  2. Centering a QCheckBox in a TableView
    By scarleton in forum Qt Programming
    Replies: 2
    Last Post: 6th July 2010, 15:13
  3. Centering a window
    By dwarnold45 in forum Newbie
    Replies: 1
    Last Post: 30th March 2010, 07:43
  4. Intercept fullscreen state on other application
    By hades76 in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2008, 09:13
  5. Fullscreen application under Gnome
    By cionci in forum Qt Programming
    Replies: 14
    Last Post: 8th March 2008, 21:36

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.