Results 1 to 2 of 2

Thread: How to get Integer form Mainwindow to dialog[ui->slider->setvalue] when calling

  1. #1
    Join Date
    Mar 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default How to get Integer form Mainwindow to dialog[ui->slider->setvalue] when calling

    (sorry for my bad english, I'm not a nativce speaker)

    Hi,

    I use QT Creator, C++ and OpenCV. My mainprogram is working fine. But when I call my Dialog I get some unsolved problems.....

    I have a Dialog and some Sliders in it.

    In my Mainwindow there are some integer (from Header|Privat)).

    Now I want to set the value of the sliders in the Dialog from the values ofn the integer from my mainwindow.

    Can somone give me a little simple workaround, how to do?

    I tried a lot of things, but now I am a little bit confused

    I just need a little workaround how it should works in a simple way.....

    I try like this:
    Qt Code:
    1. //Mainwindow
    2.  
    3. void EBL_FK::keyPressEvent(QKeyEvent *e)
    4. ...
    5. mconfig= new myconfig(this);
    6. mconfig-> show();
    7. //try to set int POLX to value of sliderOLX in dialog named myconfig
    8. connect(this, SIGNAL(POLX),parent,SLOT(myconfig::ui->sliderOLX->setValue))
    9. ...
    To copy to clipboard, switch view to plain text mode 



    thx a lot for your help

    How would be the right way?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to get Integer form Mainwindow to dialog[ui->slider->setvalue] when calling

    In C++, passing values from one object to another is done by calling methods.

    Your dialog class needs one or more methods that can be called from where you use the dialog to pass the values into the dialog.

    Cheers,
    _

Similar Threads

  1. Qt Calling function in main fun: Qt slider
    By graviteja in forum Newbie
    Replies: 1
    Last Post: 7th October 2015, 09:04
  2. How can we make slider form the two image?
    By pratik041 in forum Qt Programming
    Replies: 0
    Last Post: 29th October 2011, 09:54
  3. How to hide from taskbar a form showed form mainwindow
    By tonnot in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2011, 14:36
  4. Replies: 2
    Last Post: 30th July 2010, 15:59
  5. Calling a new form from current form
    By webgenius in forum Qt Programming
    Replies: 7
    Last Post: 8th April 2007, 19:50

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.