LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2007, 10:56 PM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
Need Help with QListView


Here's my simplified code.
Code:
#include <qapplication.h>
#include <qlistview.h>
#include <qlineedit.h>

class QFileView : public QListView
{
public:
  QFileView( QWidget* parent = 0, const char * name = 0 );
};

QFileView::QFileView(QWidget* parent, const char* name) : QListView(parent, name)
{
  addColumn("File", 100);
  QLineEdit* le = new QLineEdit(this, "Hello");
  le->setReadOnly( true );
}

int main( int argc, char ** argv ) {
    QApplication a( argc, argv );
    QFileView* mw = new QFileView();
    //mw->setCaption( "Install Script Maker" );
    mw->show();
    a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
    return a.exec();
}
This compiles, but hello does not display in the QLineEdit box and the QLineEdit box overlaps my column that says file. How can I fix this?
 
Old 11-26-2007, 11:05 PM   #2
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
nvm I found a good example.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
QListView help elvislu Programming 2 05-17-2005 09:37 AM
QListview in Qt shivaligupta Programming 1 01-13-2005 03:19 PM
how to connect my signal with standart (Qt(QListView)) stpg Programming 1 07-05-2004 07:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration