PDA

View Full Version : time edit problem



Petr_Kropotkin
25th January 2010, 03:11
I have a time edit box in a group box , but the time edit box is non functional. How can I make it work ?
Here is the code:


ui_calendarrime.h
timeEdit = new QTimeEdit(secondaryGroupBox);
timeEdit->setObjectName(QString::fromUtf8("QtimeEdit"));



I can't understand why it shoudln't work. The widget runs. I rewrote the widget from scratch using Q3TimeBox and it worked ,but using Q3TimeBox gave me some wierd error.

vishwajeet.dusane
25th January 2010, 05:38
Hi

It is hard to understand what is the behavior you are getting and what u expect. Could you please elaborate more on the problem

Petr_Kropotkin
25th January 2010, 13:26
The time box box behavior is frozen whne using QTimeBox, inside my code. I tried Q3Timebox and get the following error:

release/calendartime.o:calendartime.cpp:(.text$_ZN15Ui_Cal endarTime7setupUiEP7QDialog[Ui_CalendarTime::setupUi(QDialog*)]+0x732): undefined reference to `_imp___ZN10Q3TimeEditC1EP7QWidgetPKc'
I get this error alot:
collect2: ld returned 1 exit status
What does it mean and to get rid of it ?

Here is calendar_Time.ui code:




#ifndef UI_CALENDAR_2D_TIME_H
#define UI_CALENDAR_2D_TIME_H

#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QCalendarWidget>
#include <QtGui/QGroupBox>
#include <QtGui/QHeaderView>
#include <QtGui/QPushButton>
#include <QtGui/QWidget>
#include <Qt3Support/Q3TimeEdit>


class Ui_CalendarTime
{
public:
QGridLayout *gridLayout;
QVBoxLayout *vboxLayout;
QPushButton *okButton;
QPushButton *cancelButton;
QPushButton *moreButton;
QSpacerItem *verticalSpacer;
QGroupBox *primaryGroupBox;
QGridLayout *gridLayout1;
QSpacerItem *spacerItem;
QCalendarWidget *calendarWidget;
QGroupBox *secondaryGroupBox;
QGridLayout *gridLayout2;

QPushButton *acceptButton;
Q3TimeEdit *timeEdit;

void setupUi(QDialog *CTDialog)
{
if (CTDialog->objectName().isEmpty())
CTDialog->setObjectName(QString::fromUtf8("SortDialog"));
CTDialog->resize(353, 362);
gridLayout = new QGridLayout(CTDialog);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
vboxLayout = new QVBoxLayout();
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
okButton = new QPushButton(CTDialog);
okButton->setObjectName(QString::fromUtf8("okButton"));
okButton->setDefault(true);

vboxLayout->addWidget(okButton);

cancelButton = new QPushButton( CTDialog);
cancelButton->setObjectName(QString::fromUtf8("cancelButton"));

vboxLayout->addWidget(cancelButton);

moreButton = new QPushButton(CTDialog);
moreButton->setObjectName(QString::fromUtf8("moreButton"));
moreButton->setCheckable(true);

vboxLayout->addWidget(moreButton);

verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);

vboxLayout->addItem(verticalSpacer);

gridLayout->addLayout(vboxLayout, 0, 1, 2, 1);

primaryGroupBox = new QGroupBox(CTDialog);
primaryGroupBox->setObjectName(QString::fromUtf8("primaryGroupBox"));
gridLayout1 = new QGridLayout(primaryGroupBox);
gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
spacerItem = new QSpacerItem(31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

gridLayout1->addItem(spacerItem, 1, 0, 1, 1);

calendarWidget = new QCalendarWidget(primaryGroupBox);
calendarWidget->setObjectName(QString::fromUtf8("calendarWidget"));

gridLayout1->addWidget(calendarWidget, 0, 0, 1, 1);
gridLayout->addWidget(primaryGroupBox, 0, 0, 1, 1);

secondaryGroupBox = new QGroupBox( CTDialog);
secondaryGroupBox->setObjectName(QString::fromUtf8("secondaryGroupBox"));
gridLayout2 = new QGridLayout(secondaryGroupBox);
gridLayout2->setObjectName(QString::fromUtf8("gridLayout2"));
timeEdit = new Q3TimeEdit(secondaryGroupBox);
timeEdit->setFocus();
timeEdit->setObjectName(QString::fromUtf8("QtimeEdit"));


gridLayout2->addWidget(timeEdit, 0, 0, 1, 1);

acceptButton = new QPushButton(secondaryGroupBox);
acceptButton->setObjectName(QString::fromUtf8("pushButton"));

gridLayout2->addWidget(acceptButton, 0, 1, 1, 1);

gridLayout->addWidget(secondaryGroupBox, 1, 0, 1, 1);

retranslateUi(CTDialog);
QObject::connect(moreButton, SIGNAL(toggled(bool)), secondaryGroupBox, SLOT(setVisible(bool)));
QObject::connect(okButton, SIGNAL(clicked()), CTDialog, SLOT(accept()));
QObject::connect(cancelButton, SIGNAL(clicked()), CTDialog, SLOT(reject()));
QObject::connect(cancelButton, SIGNAL(clicked(bool)), CTDialog, SLOT(close()));
QObject::connect(acceptButton, SIGNAL(clicked()), timeEdit, SLOT(selectAll()));
QObject::connect(moreButton, SIGNAL(pressed()), timeEdit, SLOT(setFocus()));

QMetaObject::connectSlotsByName(CTDialog);
} // setupUi

void retranslateUi(QDialog *CTDialog)
{
CTDialog->setWindowTitle(QApplication::translate("CTDialog", "CTDialog", 0, QApplication::UnicodeUTF8));
okButton->setText(QApplication::translate("CTDialog", "OK", 0, QApplication::UnicodeUTF8));
cancelButton->setText(QApplication::translate("CTDialog", "Cancel", 0, QApplication::UnicodeUTF8));
moreButton->setText(QApplication::translate("CTDialog", "More", 0, QApplication::UnicodeUTF8));
primaryGroupBox->setTitle(QApplication::translate("CTDialog", "Calendar", 0, QApplication::UnicodeUTF8));
secondaryGroupBox->setTitle(QApplication::translate("CTDialog", "Time Editor Box", 0, QApplication::UnicodeUTF8));
acceptButton->setText(QApplication::translate("CTDialog", "Accept", 0, QApplication::UnicodeUTF8));
}


};

namespace Ui {
class CTDialog: public Ui_CalendarTime{};
} // namespace Ui

#endif
QT_END_NAMESPACE


But when I created a new project q3TimeBox wqorked....:confused:

boudie
25th January 2010, 13:46
get this error alot:
collect2: ld returned 1 exit status
What does it mean and to get rid of it ?

It means that a library can't be found.
One or more lines above it must contain more information.

Petr_Kropotkin
25th January 2010, 23:14
I solved most of my problems. It seems a certain Windowblinds skin causes the app to screw up.