From 45184923f3165eb1bf59dd955c5f6a031a5b16f5 Mon Sep 17 00:00:00 2001 From: shibakaneki Date: Thu, 2 Feb 2012 14:30:52 +0100 Subject: [PATCH] Fixed a signal slot error --- src/customWidgets/UBWidgetList.cpp | 9 +++++++++ src/customWidgets/UBWidgetList.h | 4 ++++ src/gui/UBTBDocumentEditWidget.cpp | 2 +- src/gui/UBTeacherBarPreviewWidget.cpp | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/customWidgets/UBWidgetList.cpp b/src/customWidgets/UBWidgetList.cpp index 6481acb4..8b099b5a 100644 --- a/src/customWidgets/UBWidgetList.cpp +++ b/src/customWidgets/UBWidgetList.cpp @@ -10,6 +10,8 @@ UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation, , mMargin(5) , mListElementsSpacing(10) , mpEmptyLabel(NULL) + , mCanRemove(true) + , mpCurrentWidget(NULL) { setObjectName(name); mOrientation = orientation; @@ -130,6 +132,13 @@ void UBWidgetList::resizeEvent(QResizeEvent *ev) updateSizes(); } +void UBWidgetList::mousePressEvent(QMouseEvent *ev) +{ + if(mCanRemove){ + + } +} + void UBWidgetList::updateSizes() { // Resize all the widgets diff --git a/src/customWidgets/UBWidgetList.h b/src/customWidgets/UBWidgetList.h index 865386ad..c4137178 100644 --- a/src/customWidgets/UBWidgetList.h +++ b/src/customWidgets/UBWidgetList.h @@ -41,7 +41,10 @@ public: int listElementsSpacing() {return mListElementsSpacing; } protected: + bool mCanRemove; + void resizeEvent(QResizeEvent* ev); + void mousePressEvent(QMouseEvent* ev); private: int scaleWidgets(QSize pSize); @@ -55,6 +58,7 @@ private: int mListElementsSpacing; QMap mWidgetInfo; QLabel* mpEmptyLabel; + QWidget* mpCurrentWidget; }; #endif // UBWIDGETLIST_H diff --git a/src/gui/UBTBDocumentEditWidget.cpp b/src/gui/UBTBDocumentEditWidget.cpp index 2b4e358a..4139a9d2 100644 --- a/src/gui/UBTBDocumentEditWidget.cpp +++ b/src/gui/UBTBDocumentEditWidget.cpp @@ -120,7 +120,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW connect(mpLicenseCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseCurrentIndexChanged(int))); connect(mpKeywords, SIGNAL(textChanged(QString)), this, SLOT(onKeywordChanged(QString))); connect(mpLevel, SIGNAL(currentIndexChanged(QString)), this, SLOT(onLevelChanged(QString))); - connect(mpTopic, SIGNAL(currentIndexChanged(QString)), this, SLOT(onTopicChanged(QString))); + connect(mpTopic, SIGNAL(textChanged(QString)), this, SLOT(onTopicChanged(QString))); connect(mpAuthor, SIGNAL(textChanged(QString)), this, SLOT(onAuthorChanged(QString))); } diff --git a/src/gui/UBTeacherBarPreviewWidget.cpp b/src/gui/UBTeacherBarPreviewWidget.cpp index 39b8eb15..a02794b8 100644 --- a/src/gui/UBTeacherBarPreviewWidget.cpp +++ b/src/gui/UBTeacherBarPreviewWidget.cpp @@ -134,6 +134,7 @@ void UBActionPreview::setContent(const QString &content) UBTBPreviewContainer::UBTBPreviewContainer(QWidget *parent, const char *name):UBWidgetList(parent) { setObjectName(name); + mCanRemove = false; } UBTBPreviewContainer::~UBTBPreviewContainer()