Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Signals and RAD GUI design ?
Forum Updated to NodeBB v4.3 + New Features

Signals and RAD GUI design ?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    novaktamas
    wrote on last edited by
    #1

    (I am newbie here, I evaluate Qt Creator for only 3 weeks)
    It started by working on a QGraphicsView-QGraphicsScene with mouse pan/zoom, and I couldn't find the signals of the QGraphicsView.
    Please reassure me that I am not not totally misguided:

    Original widgets lack most of the signals (e.g. mouse move, buttonpress/release etc.) I have to create own classes inherited from original system's classes, and override the event-handling functions this way. These functions can emit signals or simply they themselves do whatever must be done. And of course these overriden functions have their dedicated names (which are hard to find in doc's; we have to take a look for their source)

    And making my own classes, I can't use the GUI designer: I have to create and place all screen objects at runtime from code.

    Why are all possible signals (== event handler calls) left out at most widgets? Performance problems (even if these signals wouldn't be connected to anyone)?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      Already discussed here http://developer.qt.nokia.com/forums/viewthread/3260/

      [quote]And making my own classes, I can’t use the GUI designer: I have to create and place all screen objects at runtime from code. [/quote]

      You can "promote" a widget to your subclass.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • B Offline
        B Offline
        burga
        wrote on last edited by
        #3

        You can use GUI designer to design interface itself, and then create your own class just to add functionality to GUI. If you're new to Qt, there is a book "Qt Foundations" that is great in explaining connections between widgets and classes that actualy do something.

        There is no God and Paul Dirac is his prophet

        1 Reply Last reply
        0
        • N Offline
          N Offline
          novaktamas
          wrote on last edited by
          #4

          So the usual graphical app. design should be
          -drop a widget on the creator's form,
          -set size/placement/stylesheet etc. of the widget in Creator
          -edit .cpp to create a sublass for that widget's class
          -promote visually placed widget to the newly created subclass
          -override widget's event-handling functions to emit proper signals (or simply do the stuff in the event-handler without signalling. Still can't see the advantage of signal/slot system over event handling. It seems to me that signal/slot system is a new layer above the eventhandling level)

          Am I right? Opinions?

          Where can I find reference of possible events (what eventhandler function names to override) for actual Q objects? Do I have to check their source?

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ivan.todorovich
            wrote on last edited by
            #5

            [quote author="novaktamas" date="1296677648"]
            Where can I find reference of possible events (what eventhandler function names to override) for actual Q objects? Do I have to check their source?[/quote]
            http://doc.trolltech.com/latest/qwidget.html#events

            I've successfully edited my own personal clone of qt and added signals for relevant qwidget events like focusIn, focusOut, mouseEnter, mouseLeave, mousePress, mouseRelease, mouseClick (even added a mouseClick event handler), mouseDoubleClick, keyPress, keyRelease, show, hide, move, resize, and maybe other events I don't remember right now.

            You just need to declare the signals and emit them at the end of the corresponding event handler function.

            For the record I think this should be a standard for Qt, but hey.. that's the best thing about open source, you can hack it at your will.

            o_o Sorry for my rusted english.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved