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
Forum Updated to NodeBB v4.3 + New Features

Custom popup widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 8.6k 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.
  • D Offline
    D Offline
    Dohisev
    wrote on 15 Nov 2017, 12:35 last edited by
    #1

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

    widget

    J 1 Reply Last reply 15 Nov 2017, 12:54
    0
    • D Dohisev
      15 Nov 2017, 12:35

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

      widget

      J Offline
      J Offline
      joeQ
      wrote on 15 Nov 2017, 12:54 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 15 Nov 2017, 12:55
      1
      • J joeQ
        15 Nov 2017, 12:54

        @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 15 Nov 2017, 12:55 last edited by
        #3

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

        J 1 Reply Last reply 15 Nov 2017, 13:01
        0
        • D Dohisev
          15 Nov 2017, 12:55

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

          J Offline
          J Offline
          joeQ
          wrote on 15 Nov 2017, 13:01 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
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 15 Nov 2017, 20:58 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
            • V Offline
              V Offline
              Vinod Kuntoji
              wrote on 16 Nov 2017, 09:25 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

              3/6

              15 Nov 2017, 12:55

              • Login

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