AppleSpy Forums

Coding and Scripting Exchange Discussions related to general Coding and Scripting

Reply
 
LinkBack Thread Tools Display Modes
Old 02-25-2006, 10:57 AM   #1 (permalink)
UNIX chick
Kris's Avatar
Join Date: Jun 2002
Location: La Norvège
Posts: 3,698
Credits: 2,300
Default

I'm very new to QT (no, I don't mean QuickTime ) programming and can't get the simplest thing to work. Here's my code, and you can se where the error is. In the documentation is says the parameter has to be Qt::Horizontal, but it just won't work. Maybe something else is wrong? Ideas?

Code:
#include <qapplication.h>
#include <qlcdnumber.h>
#include <qslider.h>

int main(int argc, char *argv[]) {
	
 QApplication sliderApp(argc, argv);
	
 QWidget *myWidget = new QWidget();
 myWidget->setGeometry(400,300,170,110);
	
 /* ERROR: Gives me error on the Horizontal parameter! */
 QSlider *signalSlider = new QSlider(0, 9, 1, 1, Qt::Horizontal, myWidget);
	
 signalSlider->setGeometry(10,10,150,30);
	
 QLCDNumber *myLCD = new QLCDNumber(1,myWidget);
	
 myLCD->setGeometry(60,50,50,50);
 myLCD->display(1);
	
 QObject::connect(signalSlider, SIGNAL(sliderMoved(int)),myLCD,SLOT(display(int)));
	
 myWidget->show();
	
 return sliderApp.exec(); *
}
__________________
MacBook / QuickSilver G4 / 7300 / 6200 / Mac Classic / Mac Classic II / 8200 x 2 / PB 160 / Beige G3 / SparcStation 5
Kris is offline   Reply With Quote
Old 02-25-2006, 01:37 PM   #2 (permalink)
UNIX chick
Kris's Avatar
Join Date: Jun 2002
Location: La Norvège
Posts: 3,698
Credits: 2,300
Default

Problem solved, and it was silly. The book I'm reading has code based on version 3, while I program with version 4. The syntax for the QSlider has changed, as I even linked to.
__________________
MacBook / QuickSilver G4 / 7300 / 6200 / Mac Classic / Mac Classic II / 8200 x 2 / PB 160 / Beige G3 / SparcStation 5
Kris is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:34 PM.