![]() |
2010-05-08
, 08:23
|
|
Posts: 702 |
Thanked: 334 times |
Joined on Feb 2010
@ Israel.
|
#2
|
![]() |
2010-05-08
, 10:31
|
|
Posts: 702 |
Thanked: 334 times |
Joined on Feb 2010
@ Israel.
|
#3
|
![]() |
2010-05-08
, 10:40
|
Posts: 435 |
Thanked: 769 times |
Joined on Apr 2010
|
#4
|
![]() |
2010-05-08
, 10:41
|
Posts: 402 |
Thanked: 229 times |
Joined on Nov 2009
@ Missouri, USA
|
#5
|
![]() |
2010-05-08
, 10:44
|
|
Posts: 702 |
Thanked: 334 times |
Joined on Feb 2010
@ Israel.
|
#6
|
I tried to make a radio fm app but got problems with QRadioTuner qtmobility class. It seams not to be working.
On the net I found this page and in the bottom in the platform compatibility it shows almost 0 compatibility with maemo 5...
http://doc.qt.nokia.com/qtmobility-1.0-tp/
![]() |
2010-05-08
, 10:48
|
|
Posts: 702 |
Thanked: 334 times |
Joined on Feb 2010
@ Israel.
|
#8
|
Mind posting the entire code? Hard to say whats wrong without the full context.
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QGridLayout> #include <QPushButton> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); public slots: void callButtonClicked(); void insertChar(); void hangUpButtonClicked(); protected: void changeEvent(QEvent *e); private: Ui::MainWindow *ui; void CreateLetter(QString letter); QGridLayout *lettersLayout; int row, col; QString abc; int currentLetter; int numberOfLettersPerRow; QList<QPushButton*> *existingLetterButtons; void init(); int getNumberOfContacts(); }; #endif // MAINWINDOW_H
#include "mainwindow.h" #include "ui_mainwindow.h" // Something needs to be included to make this work. // I Don't really know what, but from the help - I can realize that it is : #include <qcontactmanager.h> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); lettersLayout = new QGridLayout(); lettersLayout->setMargin(0); abc = "abcdefghijklmnopqrstuvwxyz"; numberOfLettersPerRow = 3; existingLetterButtons = new QList<QPushButton*>(); init(); } int MainWindow::getNumberOfContacts() { // TODO - Here I want to fetch all the number of contacts in the contact list, and itterate through them. // I can't get this to compile... return 0; } void MainWindow::init() { row = col = currentLetter = 0; } MainWindow::~MainWindow() { delete ui; } void MainWindow::hangUpButtonClicked() { for (int i = 0; i < existingLetterButtons->size(); i++) { QPushButton *tempButton = existingLetterButtons->at(i); delete tempButton; } existingLetterButtons->clear(); init(); } void MainWindow::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); break; default: break; } } void MainWindow::callButtonClicked() { CreateLetter(abc.at(currentLetter)); if (currentLetter == abc.length() - 1) { currentLetter = 0; } else { currentLetter++; } } void MainWindow::insertChar() { QPushButton *tempButton = qobject_cast<QPushButton *>(QObject::sender()); ui->contactEntry->insert(tempButton->text()); } void MainWindow::CreateLetter(QString letter) { QPushButton *myButton = new QPushButton(); myButton->sizePolicy().setVerticalPolicy(QSizePolicy::Minimum); myButton->sizePolicy().setHorizontalPolicy(QSizePolicy::Minimum); myButton->sizeHint().setHeight(10); myButton->sizeHint().setWidth(10); existingLetterButtons->insert(existingLetterButtons->size(),myButton); myButton->setText(letter); connect(myButton, SIGNAL(clicked()), this, SLOT(insertChar())); lettersLayout->addWidget(myButton, col, row); if (row == numberOfLettersPerRow - 1) { row = 0; col++; } else { row++; } ui->lettersFrame->setLayout(lettersLayout); myButton->show(); }
#include <QtGui/QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; #if defined(Q_WS_S60) w.showMaximized(); #else w.show(); #endif return a.exec(); }
![]() |
2010-05-08
, 10:49
|
Posts: 726 |
Thanked: 345 times |
Joined on Apr 2010
@ Sweden
|
#9
|
![]() |
2010-05-08
, 10:53
|
|
Posts: 702 |
Thanked: 334 times |
Joined on Feb 2010
@ Israel.
|
#10
|
The compiler is your friend. Whatever your IDE reports, the compiler is the one that has to try to use your code. So, compile outside of your IDE and look at the error messages. Then go back to your IDE and fix it.
Most likely, though, is that the path used for includes does not contain the directory where the header file for QContactManager is.
Edit : I don't really remember what solved this,
But all the code for a working App can be found in the sources of horizontal-call.
I am working on an app for the N900, written in C++/Qt Mobility for PR1.2.
So far, I got a nice GUI running on my phone via Qt + Madde,
and I am stuck trying to make QContactManager to give me what I need. The Qt documentation examples don't work, and I cannot find my way around this problem, been trying for 2 days now.
So the problem is like this : I want to fetch ALL the contacts from the address book, one by one and do some parsing on them,
I am stuck at even accessing the contacts API, I am trying to create a QContactManager object, and I am getting an error accessing it, after including <QContactManager>, I still don't get any autocompletes for it, and it remains out of scope.
Can anyone help me?
Edit : My problem :
| Reverse SSH - access your N900 from anywhere, anytime |
| Using Samsung Galaxy S GT-i9000 and Nokia N900 |
| DonateMe - If you feel I helped you in a very good way, feel free to donate |
Last edited by eitama; 2010-09-03 at 16:16. Reason: Solved