Results 1 to 8 of 8

Thread: How To do an actionListener

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    32
    Qt products
    Qt4

    Default Re: How To do an actionListener

    Okey I get it. But I have another problem now. I have a menu at top. Like "File" menu in browser. In it, there are two actions: actionViewClassic, actionViewModern.
    These are checkable. So if one of them is checked, the other one must be unchecked. To reach this goal,I passed the other Action as a parameter to the function.However since, I created the gui with designer, if i try to change the other buttons checked function it gives me an error Because of scoping. how can I accomplish these checkablity situation ??

    Error:

    GeneratedFiles\Debug\moc_assignment1.cpp(66) : error C2248: 'QAction::QAction' : cannot access private member declared in class 'QAction'
    1> d:\qt\include\qtgui\../../src/gui/kernel/qaction.h(191) : see declaration of 'QAction::QAction'
    1> d:\qt\include\qtgui\../../src/gui/kernel/qaction.h(41) : see declaration of 'QAction'
    Last edited by bod; 27th June 2008 at 13:12.

  2. #2
    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 do an actionListener

    Quote Originally Posted by bod View Post
    These are checkable. So if one of them is checked, the other one must be unchecked... how can I accomplish these checkablity situation ??
    Take a look at QActionGroup as already proposed.
    J-P Nurmi

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.