Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    How to display screen full of Images?

    General and Desktop
    2
    2
    842
    Loading More Posts
    • 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
      Andrew last edited by

      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 Reply Quote 0
      • M
        messi last edited by

        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 Reply Quote 0
        • First post
          Last post