Results 1 to 5 of 5

Thread: How to pass a QComboBox to a function?

  1. #1
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to pass a QComboBox to a function?

    hi guys, i am new using Qt4 and i am trying to manipulate multiple QComboBox with a single function, but i can pass the object to the function to manipulate whatever QcomboBox that i want with this single function. thx

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

    Default Re: How to pass a QComboBox to a function?

    You can pass a pointer to the object.

  3. #3
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default

    sorry how do i do that?

    i mean this is the function
    Qt Code:
    1. //declaration of the function
    2. virtual void f1(QComboBox *)
    3. //implementation
    4. void MyApp::f1(QComboBox *combo)
    5. //use
    6. f1(&combo);
    To copy to clipboard, switch view to plain text mode 
    i have try to use it, but oly error in compilation
    plz any guide
    Last edited by wysota; 9th March 2008 at 22:50. Reason: Posts merged

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

    Default Re: How to pass a QComboBox to a function?

    Quote Originally Posted by Ricardo_arg View Post
    sorry how do i do that?
    I don't really see how I could answer that question

    I suggest you improve your C++ skills before trying to learn Qt, it seems you have some problems with it... Take a look at our Links section, there is a link to "Thinking in C++" book available online.

  5. #5
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to pass a QComboBox to a function?

    solved thx, i will red the book, i am a lilttle oxidate!

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  3. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  4. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  5. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52

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.