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. Display text in main window on menu action trigger()
Forum Updated to NodeBB v4.3 + New Features

Display text in main window on menu action trigger()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 579 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.
  • Nic8895N Offline
    Nic8895N Offline
    Nic8895
    wrote on last edited by
    #1

    Hello,

    I'm brand new to Qt, but I've been following tutorials and have gotten this far. I'm trying to...have it so that when you click one of the menu items, it will display text about whatever you clicked on the main window, and clear it out when choosing another topic. The problem is I have NO idea how to make Qt do that. cout doesn't work lol. I can't seem to find a tutorial on it either. Any chance I could get some help? I can share source if needed.

    Here's where I'm stuck:

    void MainWindow::on_actionMajor_triggered()
    {
        ui->
    }
    

    Here's a screenshot of what I have so far.

    http://imgur.com/a/538HU

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

      Hi and welcome to devnet,

      To show something on the console when using Qt, you would usually call qDebug() << "Message"; Not that you can't use stdout or stderr, it's just the common practice.

      If you want to show a simple message, you can use e.g. a QLabel or QMainWindow's status bar depending on how you want to show your message.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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