Results 1 to 6 of 6

Thread: I can't move my slider. Heelp

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Nov 2006
    Location
    indonesia
    Posts
    55
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: I can't move my slider. Heelp

    Hi,
    The problem is you set the "initial mainWindow design" at top of your slider design. Please move location of
    Qt Code:
    1. ui->setupUi(this);
    To copy to clipboard, switch view to plain text mode 
    at top of your constructor mainWindow. So, your constructor is like this :
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. this->setFixedSize(500,800);
    7. timer = new QTimer(this);
    8. slider= new QSlider(Qt::Horizontal, this);
    9. slider->setValue(3);
    10. slider->setMaximum (15);
    11. slider->setMinimum (1);
    12. slider->setGeometry(QRect((width()/2)-100, (height()*8/9), 200, 50));
    13. tekst = new QLabel(this);
    14. tekst->setStyleSheet("font: 38pt;");
    15. tekst->setGeometry(QRect((width()/2)-10, (height()*7/9), 80, 80));
    16. connect(timer, SIGNAL(timeout()), this, SLOT(updated()));
    17. connect(slider, SIGNAL(valueChanged(int)), this, SLOT(predkosc(int)));
    18. predkosc(3);
    19. }
    To copy to clipboard, switch view to plain text mode 

    Best regards,

    Toto

  2. The following user says thank you to myta212 for this useful post:

    Krystian (10th October 2013)

Similar Threads

  1. Dynamic label to right of slider resizes slider
    By zenzero-2001 in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2013, 10:11
  2. Replies: 0
    Last Post: 2nd August 2010, 11:17
  3. Problem in Move Move Event Handler.
    By redgoof in forum Qt Programming
    Replies: 0
    Last Post: 7th April 2010, 11:45
  4. Replies: 2
    Last Post: 21st March 2010, 09:01
  5. I hope to move the slider bar in QGraphicsView automatically
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2008, 14:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.