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

Resize problem of Qwidget

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k 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.
  • V Offline
    V Offline
    vicky12
    wrote on last edited by
    #1

    !http://i.imgur.com/TI9uCJk.png(resize_widget)!

    Hello every one .. my problem is with resize of Qwidget i want to re-size widget as same we can resize in Qt designer.. any one help.. problem is the opposite end are not fixed they are also moving with widget when we are in minninum of its height or width.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vicky12
      wrote on last edited by
      #2

      i am trying to fix widget bottom-right postion... how can i get it Fixed...

      1 Reply Last reply
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        Hi,

        Without some code it is hard to help.

        You could have a look at "the diagram scene example":http://qt-project.org/doc/qt-5/qtwidgets-graphicsview-diagramscene-example.html

        To get you further.

        Hope it helps

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vicky12
          wrote on last edited by
          #4

          @if(cursorShape == SelectionNodeWidget::RightBottom)
          {
          qDebug() << "Hello 2";

                      myPosition.setTopLeft(dw->geometry().topLeft());
                      myPosition.setBottomRight(e->pos());
                      dw->setGeometry(myPosition);
                      qDebug() << myPosition.topLeft();
                  }
                  if(cursorShape == SelectionNodeWidget::RightTop)
                  {
                      //qDebug() << "Hello 3";
                      myPosition.setBottomLeft(dw->geometry().bottomLeft());
                      myPosition.setTopRight(e->pos());
                      //                myPosition.setBottom(dw->geometry().bottom());
                     dw->setGeometry(myPosition);
                 }
          
          
                  if(cursorShape == SelectionNodeWidget::LeftTop)
                  {
                          myPosition.setTopLeft(e->pos());
                          myPosition.setBottomRight(dw->geometry().bottomRight());
                          dw->setGeometry(myPosition);
                          dw->resize(dw->geometry().width(),dw->geometry().height());
                          qDebug()<<myPosition.bottomRight()<<dw->geometry().bottomRight()<<e->pos();
                  }
                  if(cursorShape == SelectionNodeWidget::RightCenter)
                  {
                      myPosition.setRight(e->pos().x());
                      myPosition.setTop(dw->geometry().top());
                      myPosition.setLeft(dw->geometry().left());
                      myPosition.setBottom(dw->geometry().bottom());
                      dw->setGeometry(myPosition);
          
                  }
                  if(cursorShape == SelectionNodeWidget::LeftCenter)
                  {
                      myPosition.setLeft(e->pos().x());
                      myPosition.setTop(dw->geometry().top());
                      myPosition.setRight(dw->geometry().right());
                      myPosition.setBottom(dw->geometry().bottom());
                      dw->setGeometry(myPosition);
          
                  }
          

          @
          the resizing is some what like this i have done:- every thing works fine but when ever i comes to its inital position the widgt start moving

          1 Reply Last reply
          0
          • musimbateM Offline
            musimbateM Offline
            musimbate
            wrote on last edited by
            #5

            Hi,
            This "link":http://www.ggkf.com/qt/implementing-resize-handles-on-qrubberband-is-qsizegrip-relevant may contain a hint to what you need to achieve.

            Good luck

            Why join the navy if you can be a pirate?-Steve Jobs

            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