how to create an external window with information in qt?
-
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:
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)
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?
-
The second screenshot shows a dialog with a QTextEdit (or maybe QPlainTextEdit)
-
@Christian-Ehrlicher thanks a lot, it was just what i needed!