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. How to display screen full of Images?
Forum Updated to NodeBB v4.3 + New Features

How to display screen full of Images?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 937 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.
  • A Offline
    A Offline
    Andrew
    wrote on 28 Mar 2013, 14:19 last edited by
    #1

    A very very basic and naive question.. How to display four images on the screen which span the entire window..?

    I want to create a game UI, which has cartoon Images on the front.. there might 3-4 four of them, and on top of that two buttons to play and help.

    Play button would then create a OpenGL context (onclick) and Game Engine would start.

    Is this right way to go..?

    Any code to display Images..?(No theory please.. code speaks a lot louder)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      messi
      wrote on 28 Mar 2013, 15:05 last edited by
      #2

      In C++ or in QML?

      In C++ is something like this:

      @SelectionWidget::SelectionWidget(QWidget* parent):
      QWidget(parent)
      {
      setWindowState(Qt::WindowFullScreen);

      QGridLayout gridLayout = new QGridLayout;
      gridLayout->setSpacing(0); // or the value you need
      gridLayout->setMargins(0); // or the value you need
      
      // Here you have to initialize 4 QLabels with your images
      // do not forget to call QLabel::setScaleableContents(true)
      
      
      gridLayout->addWidget( label1, 0, 0 );
      gridLayout->addWidget( label2, 1, 0 );
      gridLayout->addWidget( label3, 0, 1 );
      gridLayout->addWidget( label4, 1, 1 );
      
      setLayout(gridLayout);
      

      }@

      1 Reply Last reply
      0

      2/2

      28 Mar 2013, 15:05

      • Login

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