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. [solved]Qmovie+QImage in single window screen
Forum Updated to NodeBB v4.3 + New Features

[solved]Qmovie+QImage in single window screen

Scheduled Pinned Locked Moved General and Desktop
13 Posts 3 Posters 3.3k 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.
  • S Offline
    S Offline
    sasireka
    wrote on last edited by
    #1

    hi all,

    I am new to qt. This is dialog.cpp. In this dialog i created 2 text labels. one is for movie and another one is for image. if i am running this code, i am getting the result which one in last(now movie). in single screen i want movie above and below image. how to do it. please help me .

    @Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
    {
    ui->setupUi(this);

    QImage *image = new QImage("/home/dev6/Desktop/animation/label1.jpg");
    QLabel *label1 = new QLabel(this);
    label1->setPixmap(QPixmap::fromImage(*image));
    //label1->show();
    
    QMovie *movie = new QMovie("/home/dev6/Desktop/animation/spectrum.gif");
    QLabel *processLabel = new QLabel(this);
    processLabel->setMovie(movie);
    movie->start();@
    

    .................................
    Thanks & Regards

    Sasi

    .................................
    Go Green

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      You could use "move":http://qt-project.org/doc/qt-5/qwidget.html#pos-prop or "setGeometry":http://qt-project.org/doc/qt-5/qwidget.html#geometry-prop to specify a position for the widgets. Use it to change QLabel's positions since by default it goes to (0,0).
      Or the best way would be to put these widgets in a layout.

      157

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Have a look at QVBoxLayout

        Are you using designer to build your UI ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sasireka
          wrote on last edited by
          #4

          yes i am using designer.

          .................................
          Thanks & Regards

          Sasi

          .................................
          Go Green

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sasireka
            wrote on last edited by
            #5

            how to set. can you please explain

            .................................
            Thanks & Regards

            Sasi

            .................................
            Go Green

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sasireka
              wrote on last edited by
              #6

              i am using designer. in dialog.ui i changed geometry. but still i have the same problem.

              .................................
              Thanks & Regards

              Sasi

              .................................
              Go Green

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Please, practice some patience.

                Add two labels in your UI inside a QVBoxLayout then set the QMovie and QImage on these labels, then you can remove the two you are creating with code

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sasireka
                  wrote on last edited by
                  #8

                  okay. in program i used setgeometry. now it is working fine. thanks to you all.
                  [quote author="SGaist" date="1411473715"]Please, practice some patience.

                  Add two labels in your UI inside a QVBoxLayout then set the QMovie and QImage on these labels, then you can remove the two you are creating with code[/quote]

                  .................................
                  Thanks & Regards

                  Sasi

                  .................................
                  Go Green

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sasireka
                    wrote on last edited by
                    #9

                    yes now it is working fine. thanks to you all.
                    [quote author="p3c0" date="1411462248"]Hi,

                    You could use "move":http://qt-project.org/doc/qt-5/qwidget.html#pos-prop or "setGeometry":http://qt-project.org/doc/qt-5/qwidget.html#geometry-prop to specify a position for the widgets. Use it to change QLabel's positions since by default it goes to (0,0).
                    Or the best way would be to put these widgets in a layout.[/quote]

                    .................................
                    Thanks & Regards

                    Sasi

                    .................................
                    Go Green

                    1 Reply Last reply
                    0
                    • p3c0P Offline
                      p3c0P Offline
                      p3c0
                      Moderators
                      wrote on last edited by
                      #10

                      Good.. Please mark the post as solved then. Also in future try to use Layouts where ever possible.

                      157

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sasireka
                        wrote on last edited by
                        #11

                        yes okay. in future i will use layouts. how to mark the post as solved.

                        [quote author="p3c0" date="1411533921"]Good.. Please mark the post as solved then. Also in future try to use Layouts where ever possible.[/quote]

                        .................................
                        Thanks & Regards

                        Sasi

                        .................................
                        Go Green

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Edit your original post and update the thread

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            sasireka
                            wrote on last edited by
                            #13

                            okay done.

                            .................................
                            Thanks & Regards

                            Sasi

                            .................................
                            Go Green

                            1 Reply Last reply
                            0

                            • Login

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