Results 1 to 2 of 2

Thread: qt designer:linking fuctions to actions?

  1. #1
    Join Date
    Jul 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 2 Times in 1 Post

    Default qt designer:linking fuctions to actions?

    First of all i apologize if i have posted this question in the wrong place. I am new to this forum.

    I am an experienced coder but i am new to developing GUI's. I have found Qt designer to be a great resource for building a GUI, however i have become frustrated trying to implement some advanced functionality. I am new to the concept of signals and slots, where as i have successfully managed to connect a slider and a spin box to react to each other and i have manged to get a button click to close the program i have not found a way to run my own code on a button click event.

    In specific, i have a button which when pressed i want a function i wrote myself to be called. This function sets up a web camera and starts to stream the camera data to a display.

    My question is, how do i get a button click to run my function. I cannot seem to access the code behind my gui, i have also tried including my function in the main.ccp file which is loaded in QDevelop however i have not found a way to get Qt designer to access this function.

    I have also stumbled across the idea of promoting a widget, it seems you can add your own class for a width and add functionality there, i am not sure if this is the correct method?

    Any help would be appreciated. Even if you just direct me to somewhere i can find the information, i am not lazy just confused by new terminology, there is a high probabilty i have skimmed by the answer tens of times.

    I am using Qdevelop 4.5 and developing on a linux distro

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: qt designer:linking fuctions to actions?

    Read about Using a Designer .ui File in Your Application. Once you create a proper widget subclass for your form, you can add connect() statements to the class that will connect the UI with login of the subclass.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    switch (29th July 2009)

Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 22:36
  2. QScrollArea: How to avoid automatic scroll actions?
    By PhilippB in forum Qt Programming
    Replies: 4
    Last Post: 31st October 2012, 20:04
  3. Get the actions from a toolbar
    By jano_alex_es in forum Newbie
    Replies: 3
    Last Post: 20th May 2009, 10:02

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.