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. Image next to menubar & toolbar

Image next to menubar & toolbar

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.9k Views 2 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
    amezei
    wrote on last edited by
    #1

    Hi!

    I'd like to insert an image at the top-right side of the application. The image would be the same size as the menubar and the toolbar together, but I can not insert an image next to them. Can I insert it somehow?

    Thank you!

    Ioseph12I 1 Reply Last reply
    0
    • A amezei

      Hi!

      I'd like to insert an image at the top-right side of the application. The image would be the same size as the menubar and the toolbar together, but I can not insert an image next to them. Can I insert it somehow?

      Thank you!

      Ioseph12I Offline
      Ioseph12I Offline
      Ioseph12
      wrote on last edited by
      #2

      @amezei

      Hi amezei,

      Maybe you can put both the toolbar and menubar inside a frame, and set the image as a background there.

      Regards,
      José

      1 Reply Last reply
      1
      • Vinod KuntojiV Offline
        Vinod KuntojiV Offline
        Vinod Kuntoji
        wrote on last edited by Vinod Kuntoji
        #3

        @amezei ,

        Hi,

        Take a QLabel, set image to that label,

        Pixmap pix(":/1.png");
        m_Label->setPixmap(pix);

        QHBoxLayout *hbox = new QHBoxLayout();
        QVBoxLayout *vbox = new QVBoxLayout();

        QMenuBar *m_MenuBar = new QMenuBar();
        QToolBar *m_ToolBar = new QToolBar();

        vbox->addWidget(m_MenuBar);
        vbox->addWidget(m_ToolBar);

        hBox->addLayout(vBox);
        hBox->addWidget(m_Label);

        C++, Qt, Qt Quick Developer,
        PthinkS, Bangalore

        A 1 Reply Last reply
        2
        • Vinod KuntojiV Vinod Kuntoji

          @amezei ,

          Hi,

          Take a QLabel, set image to that label,

          Pixmap pix(":/1.png");
          m_Label->setPixmap(pix);

          QHBoxLayout *hbox = new QHBoxLayout();
          QVBoxLayout *vbox = new QVBoxLayout();

          QMenuBar *m_MenuBar = new QMenuBar();
          QToolBar *m_ToolBar = new QToolBar();

          vbox->addWidget(m_MenuBar);
          vbox->addWidget(m_ToolBar);

          hBox->addLayout(vBox);
          hBox->addWidget(m_Label);

          A Offline
          A Offline
          amezei
          wrote on last edited by
          #4

          @Vinod-Kuntoji

          Thank you for the answer. Is there a way to do it in the Qt Creator designer? (with QMainWindow and QMenuBar, QToolbar)

          Arvindhan PonnusamyA 1 Reply Last reply
          0
          • A amezei

            @Vinod-Kuntoji

            Thank you for the answer. Is there a way to do it in the Qt Creator designer? (with QMainWindow and QMenuBar, QToolbar)

            Arvindhan PonnusamyA Offline
            Arvindhan PonnusamyA Offline
            Arvindhan Ponnusamy
            wrote on last edited by
            #5

            @amezei : If you are trying to set window Icon can use
            app.setWindowIcon(QIcon("./Icon"));

            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