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. Custom popup widget

Custom popup widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 8.5k Views
  • 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.
  • D Offline
    D Offline
    Dohisev
    wrote on last edited by
    #1

    Is there a tutorial or any idea of how to create popup widget like this:

    widget

    joeQJ 1 Reply Last reply
    0
    • D Dohisev

      Is there a tutorial or any idea of how to create popup widget like this:

      widget

      joeQJ Offline
      joeQJ Offline
      joeQ
      wrote on last edited by
      #2

      @Dohisev hi,friend.welcome.

      I think, you can use QWidget. when 1.00x widget get the mouse focus or clicked. the slider widget show and move it to right position. and set slider widget get focus. when slider widget lose focus, hide it.

      Just do it!

      D 1 Reply Last reply
      1
      • joeQJ joeQ

        @Dohisev hi,friend.welcome.

        I think, you can use QWidget. when 1.00x widget get the mouse focus or clicked. the slider widget show and move it to right position. and set slider widget get focus. when slider widget lose focus, hide it.

        D Offline
        D Offline
        Dohisev
        wrote on last edited by
        #3

        @joeQ How to set the position of another widget based on the current clicked widget?

        joeQJ 1 Reply Last reply
        0
        • D Dohisev

          @joeQ How to set the position of another widget based on the current clicked widget?

          joeQJ Offline
          joeQJ Offline
          joeQ
          wrote on last edited by joeQ
          #4

          @Dohisev every widget has Geometry in Qt. you can search Window Geometry key words in Qt help manual. and then QWidget::move(x,y). don't forget to the widget width and height.

          widget also has pos() and rect properties.

          Just do it!

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

            Hi,

            Isn't that the VLC GUI ?

            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
            • Vinod KuntojiV Offline
              Vinod KuntojiV Offline
              Vinod Kuntoji
              wrote on last edited by
              #6

              Widget::Widget(QWidget *parent)
              : QWidget(parent)
              {
              mButton = new QPushButton;
              mSlider = new QSlider;
              mMainLayout = new QVBoxLayout;
              mLayout = new QVBoxLayout;
              mLayout->addWidget(mButton);
              this->setLayout(mLayout);
              connect(mButton,SIGNAL(clicked()),this,SLOT(SLT_ShowPopUp()));
              }

              void Widget::SLT_ShowPopUp(){
              mSlider->setGeometry(this->x(),this->y()+100,200,30);
              mSlider->setWindowFlags(Qt::Popup);
              mSlider->setOrientation(Qt::Horizontal);
              mSlider->setRange(0,100);
              connect(mSlider,SIGNAL(valueChanged(int)),this,SLOT(SLT_SetValue(int)));
              mSlider->show();
              }

              void Widget::SLT_SetValue(int val){
              mSlider->setValue(val);
              mButton->setText(QString::number(val));
              }

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

              1 Reply Last reply
              1

              • Login

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