Results 1 to 4 of 4

Thread: how to use enums

  1. #1
    Join Date
    Jan 2006
    Location
    germany
    Posts
    75
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default how to use enums

    this might sound a little stupid and i really dont know if this a c++ or kde problem

    i have subclassed KProcess (not that KProcess is not derived from QProcess) and i need to pass two arguments to start().
    you can read this up at http://developer.kde.org/documentati...rocess.html#a9
    now i dont know how to do it.
    i thought that enums were just used as "names-for-int-values" and i have always just used the int value instead of bothering with the words but kdevelop tells me it "cannot convert int to KProgress::RunMode". so i tried casting the int, but it doesnt work and KProgress::OwnGroup (which is the 4th element of RunMode enum) is undeclared...
    what am i doing wrong?
    thanks!
    Quote Originally Posted by Bertolt Brecht
    What is the robbing of a bank compared to the founding of a bank?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to use enums

    I don't think I follow - could you show the code you are trying and the corresponding error?
    Where are you getting the enums int value from that you pass to the method??
    Why can't you just use the correct enum name?

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to use enums

    Quote Originally Posted by soul_rebel
    KProgress::OwnGroup (which is the 4th element of RunMode enum) is undeclared...
    I'm not sure, I've never played around with KProcess, but shouldn't it be KProcess::OwnGroup?

  4. #4
    Join Date
    Jan 2006
    Location
    germany
    Posts
    75
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Lightbulb Re: how to use enums

    shouldn't it be KProcess::OwnGroup?
    you are right
    i really need more focus... to many things going on in my head right now...
    anyways, problem solved.
    thank you
    Quote Originally Posted by Bertolt Brecht
    What is the robbing of a bank compared to the founding of a bank?

Similar Threads

  1. Save enums in QSettings
    By redhat in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2009, 11:22
  2. Q_ENUMS on C-style global enums
    By luf in forum Qt Programming
    Replies: 2
    Last Post: 8th July 2008, 19:11
  3. Using enums in QtScript
    By Orphelic in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2007, 11:55

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.