I'm new to C++/QT and am porting a program i made in VB to linux.
I have found QT to be very nice, and almost compareable to VB, in the use of slots.

My problem, is trying to set the text of lineedit widget, below is my code:

QString filename = QFileDialog::getOpenFileName(
"MP3s (*.mp3)",
"open file dialog"
"Choose a MP3 file" );

//set the linedit text to the file selected in the dialog
LineEdit2->setText( filename );

I get:

"invalid use of undefined type 'struct QLineEdit'"

i checked and setText is part of the QLineEdit class and LineEdit2 IS the name of
the qlineedit widget...any ideas?


  • : I get:
    : "invalid use of undefined type 'struct QLineEdit' "

    QLineEdit being a class and all, it looks like you have the wrong type for LineEdit2 ... or maybe you didn't include the right header?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion