Results 1 to 4 of 4

Thread: QT Newbie Question

Hybrid View

  1. #1

    QT Newbie Question

    I've dabbled in QT programming before, but never really much beyond a "Hello World" button. Anyway tomorrow I'm doing a technical presentation on Industrial Strength GUI Design, and I'm comparing QT/C++ to Swing/Java. I'm including several code snippets from each to illustrate parallel functionality. I have a little swing application that pops up with a button that says "Click to close", and a bit of text above the button that says "Swing Example". Now I have no problem creating the "Click to close" button in QT, but for the life of me I have no idea how to display text in a window. Can anyone point me to the class whose object, when instantiated, will write the words "QT Example" in the frame?

  2. #2

    Re:QT Newbie Question

    I'm not sure if QLabel is what your looking for or not ....

    #include <qapplication.h>
    #include <qlabel.h>
    int main(int argc, char *argv[]) {
    QLabel* label = new QLabel("QT Application", parent);
    // resize the label
    I think QLabel inherits from QFrame.

  3. #3

    Re:QT Newbie Question

    Is this what your looking for?

  4. #4

    Re:QT Newbie Question

    It does appear to be what I'm looking for, but I'm having trouble instantiating it. Apparently it has to be within a QFrame, and I can't instantiate the QFrame. Gives me an error when I try to instantiate it, when I make it a child widget of my QVBox and when I make it a parent widget. I'm not in linux right now, but next time I'm there I'll post the error.

Similar Threads

  1. Newbie classpath question
    By Tyr_7BE in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 12-19-2005, 05:49 PM
  2. newbie CVS question
    By countach44 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 06-27-2004, 05:51 AM
  3. Newbie....First Question.
    By Brandonium in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 09-21-2003, 06:52 PM
  4. Newbie Question
    By exidous in forum Redhat / Fedora
    Replies: 1
    Last Post: 07-12-2002, 04:31 PM
  5. Newbie Question
    By hyxodus in forum Linux - General Topics
    Replies: 4
    Last Post: 03-07-2002, 01:38 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts