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. how to create an external window with information in qt?
Forum Updated to NodeBB v4.3 + New Features

how to create an external window with information in qt?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 233 Views
  • 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.
  • J Offline
    J Offline
    JXCT_25
    wrote on 14 Jun 2022, 18:26 last edited by
    #1

    I have a problem when I want to show information in a qt application that I design.

    I am using the function QMessageBox::about like the following code:

    void MainWindow::on_actionAcerca_del_programa_triggered()
    {
        QString txt;
        txt = "Declaracion de los elementos, formato de escritura \n\n";
    
        txt += "Fuente de voltaje independiente DC: (Vnombre) (nodo 1) (nodo 2) (Tipo de fuente) (amplitud)\n";
        txt += "Ejemplo: v1 1 2 DC 5\n\n";
    
        txt += "Fuente de corriente independiente DC: (Inombre) (nodo 1) (nodo 2) (Tipo de fuente) (amplitud)\n";
        txt += "Ejemplo: i1 1 2 DC 5\n\n";
    
        txt += "Resistencia: (Rnombre) (nodo 1) (nodo 2) (valor)\n";
        txt += "Ejemplo: R1 1 2 1000\n\n";
    
        txt += "Capacitores (condiciones iniciales igual a 0): (Cnombre) (nodo 1) (nodo 2) (valor)\n";
        txt += "Ejemplo: C1 1 2 1000\n\n";
    
        txt += "Capacitores (condiciones  distintas de 0): (Cnombre) (nodo 1) (nodo 2) (valor) (ic=valor)\n";
        txt += "Ejemplo: C1 1 2 1 ic=0.6\n\n";
    
        txt += "Inductores (condiciones iniciales igual a 0): (Lnombre) (nodo 1) (nodo 2) (valor)\n";
        txt += "Ejemplo: L1 1 2 1000\n\n";
    
        txt += "Inductores (condiciones  distintas de 0): (Lnombre) (nodo 1) (nodo 2) (valor) (ic=valor)\n";
        txt += "Ejemplo: L1 1 2 1 ic=0.6\n\n";
    
        txt += "Fuentes de corriente controladas por voltaje: (Gnombre) (nodo 1) (nodo 2) (nodo3) (nodo4) (valor)\n";
        txt += "Ejemplo: G1 1 2 3 4 10\n\n";
    
        txt += "Fuentes de corriente controladas por corriente: (Fnombre) (nodo 1) (nodo 2) (nodo3) (nodo4) (valor)\n";
        txt += "Ejemplo: F1 1 2 3 4 10\n\n";
    
        txt += "Fuentes de voltaje controladas por voltaje: (Enombre) (nodo 1) (nodo 2) (nodo3) (nodo4) (valor)\n";
        txt += "Ejemplo: E1 1 2 3 4 10\n\n";
    
        txt += "Fuentes de voltaje controladas por corriente: (Hnombre) (nodo 1) (nodo 2) (nodo3) (nodo4) (valor)\n";
        txt += "Ejemplo: G1 1 2 3 4 10\n\n";
    
        txt += "Transformadores ideales: (Nnombre) (nodo 1) (nodo 2) (nodo3) (nodo4) (valor)\n";
        txt += "Ejemplo: N1 1 2 3 4 12\n\n";
    
        txt += "Amplificadores operacionales: (Onombre) (nodo 1) (nodo 2) (salida) (valor)\n";
        txt += "Ejemplo: O1 1 2 3 4 12\n\n";
    
        QMessageBox::about(this,"AnSiRE",txt);
    }
    

    but when the window is opened, the written information is not displayed correctly, it does not even fit on the entire screen. Besides I need to add much more information so this method does not work for me...

    (this is how the window with the information is displayed:imagen1_SO.png

    Within the same qt platform there is an option called system information which opens a window like this:

    (This is how I would like the window to display the information)imagen2_SO.png

    With QMessageBox::about I have not been able to make a window like this, I also tried with QtabletWidget, but it is not the function that I need.

    What function allows me to do this?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 14 Jun 2022, 18:35 last edited by
      #2

      The second screenshot shows a dialog with a QTextEdit (or maybe QPlainTextEdit)

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      J 1 Reply Last reply 16 Jun 2022, 17:23
      2
      • C Christian Ehrlicher
        14 Jun 2022, 18:35

        The second screenshot shows a dialog with a QTextEdit (or maybe QPlainTextEdit)

        J Offline
        J Offline
        JXCT_25
        wrote on 16 Jun 2022, 17:23 last edited by
        #3

        @Christian-Ehrlicher thanks a lot, it was just what i needed!

        1 Reply Last reply
        0

        1/3

        14 Jun 2022, 18:26

        • Login

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