Results 1 to 2 of 2

Thread: interacting with qGraphicsItem

  1. #1
    Join Date
    Feb 2010
    Posts
    27
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default interacting with qGraphicsItem

    I have a number of QGraphicsItems set up to form a tvguide as so:



    I would like to capture the users action on the graphicsitem and change the parent QwidgetStack index to a page with details for the selected program.

    I have set up a mouseDoubleClickEvent that captures the mouse click, the problem i am having is changing the qwidgetstack index as i cant make a new mainwindow object and connect to a public function as the constructer for the mainwindow controls all the database and downloading, so if i:

    newMW = new mainwindow;
    newMW.showProgramInfo();

    it causes me all sorts of problems.

    can anyone suggest a better approach to achieving the desired functionality?

    Thanks,

    Dubstar_04

  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: interacting with qGraphicsItem

    can anyone suggest a better approach to achieving the desired functionality?
    Yes - redesign.
    Don't mix non GUI functionality (data base connections) with GUI.
    Separate the two.
    Get you data base code out of your main window, its conceptually in the wrong place.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Interacting QGraphicsItems together
    By sean.reynolds in forum Qt Programming
    Replies: 2
    Last Post: 16th April 2011, 09:35
  2. Replies: 5
    Last Post: 8th January 2010, 17:03
  3. Interacting with a dialog started with a QProcess
    By craven in forum Qt Programming
    Replies: 6
    Last Post: 30th September 2009, 21:16
  4. Interacting with an API
    By srohit24 in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2009, 14:17
  5. events interacting with signals/slots
    By gunhelstr in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2006, 12:30

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.