| Coding and Scripting Exchange Discussions related to general Coding and Scripting |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
UNIX chick
![]() Join Date: Jun 2002
Location: La Norvège
Posts: 3,698
Credits: 2,300
|
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 |
|
|
|
|
|
#2 (permalink) |
|
UNIX chick
![]() Join Date: Jun 2002
Location: La Norvège
Posts: 3,698
Credits: 2,300
|
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 |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -4. The time now is 07:34 PM.





) programming and can't get the simplest thing to work.
Here's my code, and you can se where the error is. In the 
Linear Mode

