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. Code optimation, everything should more be the qt-way of programming

Code optimation, everything should more be the qt-way of programming

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 880 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.
  • R Offline
    R Offline
    roboterprogrammer
    wrote on last edited by
    #1

    Hello,
    I almost finished my gui so first thanks to everybody! everybody who helped me here.
    why I'm writing here:
    My sourcecode's cpp files are only two: main.cpp and robbie.cpp, and i put everything what could be own classes in robbie.cpp, because it was easier for me FIRST to connect the events in the old c++ way.

    What I would like to know how u let communicate not-mainclass-objects with not-mainclass-objects.
    more precised on my situation:

    when i split robbie.cpp in 4 new classes:

    • one serial (with qextserialport) class
    • one tcpserver class (hosts, so robot connects as client)
    • one tcpclient class (connects to robot host)
    • one writefile class (write a logfile on hdd)

    where is the connection for example for this event:
    robot sends via tcpclient object an event like door opened, and this should be logged in txtfile on hdd.
    where is the place to make the connection?

    do i create the objects in robbie.cpp initialisation class?
    and do i create the connections there with signals and slots.

    1st
    create a clienthost object which will connect automatically?

    2nd
    create a writefile object

    3rd link both. for this i have to catch the readyread signal from a constructed socket.
    then connect ( clienthost->socket->readyread event with writefile.write)

    would this be the right developing way?

    here my huge class robbie.cpp i want to make smaller.

    is the projects main class where the ui is generatet the place connections are made?

    http://no-paste.ch/show_528.html
    http://tinypic.com/view.php?pic=2dsk8dz&s=6

    thanks
    rafael

    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