LinuxQuestions.org
Visit Jeremy's Blog.
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 07-27-2004, 02:00 AM   #1
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Rep: Reputation: 30
qt question


how to display some words in the windows?
I only can make a windows so far.
like this:
/**************************/
#include <qapplication.h>
#include <qpushbutton.h>
#include <qvbox.h>

int main( int argc, char **argv )
{
QApplication a( argc, argv );

QVBox box;
box.resize( 200, 120 );
a.setMainWidget( &box );
box.show();

return a.exec();
}
thank you.
 
Old 07-27-2004, 04:40 AM   #2
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
*pulls out Programming with Objects text*

Well what kind of text do you want? Do you want a button with text? Or do you want a textbox to display/edit text? Try this for starters:

Code:
#include <qapplication.h>
#include <qpushbutton.h>
#include <qvbox.h>

int main( int argc, char **argv )
{
QApplication a( argc, argv );

QVBox box;
box.resize( 200, 120 );
a.setMainWidget( &box );

ta = new QTextEdit( this, "textArea" );
ta->setGeometry(0, 20, 200, 120 );
ta->setTextFormat( Qt::PlainText );
ta->setFont( QFont( "Courier" ) );
ta->setText("Hello world!");
//ta->clear(); // This will clear the text
box.show();

return a.exec();
}
No guarantees on that working though. Its been a while since I've played around with QT
 
Old 07-27-2004, 09:56 AM   #3
blanks
Member
 
Registered: Jun 2004
Location: West Virginia
Distribution: Gentoo, Debian
Posts: 52

Rep: Reputation: 15
Qt has extensive documentation. Check http://doc.trolltech.com/3.3/index.html
Some tutorials there too...
 
Old 07-27-2004, 02:41 PM   #4
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
Smile

Trolltech.com has a program called QT-Designer in their development package 3.x.
It's a simple good CAM for your QT-GUIs.
You'll prefer it - test it - and all gonna be so easy.
 
  


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
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
2 part question: Speeding up MDK9.1/GNOME question wardialer Linux - Newbie 6 10-14-2004 03:16 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 12:53 PM

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

All times are GMT -5. The time now is 02:15 AM.

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