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. Qt widget and menu bar on ubuntu

Qt widget and menu bar on ubuntu

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 631 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.
  • A Offline
    A Offline
    AMOUS
    wrote on last edited by
    #1

    Hello.
    I'm big newbie in Qt i would like to manage a laser and a temperature sensor.
    I created a widget with the menu bar but i dont' know how to do two another widgets by clicking laser or temperature sensor in my menu bar.
    Of course in the widget i would like to specify functions like start, stop, etc... Do i have to create a new.h like "laser.h" and "temperature sensor .h" to specify new functions on each .h and 2 new .cpp also?
    another things is how to recognize automatically by serial port my instruments. i tried by hyperterminal in ubuntu and its works but how to manage this in Qt?
    if somebody know a tuto for this
    thanks a lot for the help.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi And welcome to the forums
      For Serial port.
      This sample is a good start
      https://doc.qt.io/qt-5/qtserialport-terminal-example.html

      For your laser and a temperature sensor.
      If they can do stuff on their own, a normal c++ class should be good
      to handle its functions.
      and yes, you would create new .h and .cpp for each.
      QtCreator can make this for you if you use
      alt text
      alt text
      and fill out classname and base class
      alt text

      then it will create both .h and .cpp and add to project.

      1 Reply Last reply
      3
      • A Offline
        A Offline
        AMOUS
        wrote on last edited by
        #3

        thank you for all, i found something to create a new window when i clicked a button created on my main window (new Qt designer form class-->dialog without buttons), but my new problem is creating a new window when i clicked "Laser" on my menu bar.
        i can't get a slot like a press button when i right click on my menu bar.Do you have an idea for this?
        thank you

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AMOUS
          wrote on last edited by
          #4

          Ok i found it.
          Just put "void(...)::on_actionConfiguration_triggered() and .setModal(true) and.exec() with my new.h in my main window.cpp and its works! now i can configure in my new window in my new cpp.
          Thank you!
          Bye.

          1 Reply Last reply
          1

          • Login

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