Browse Source

Replaced search field with ctkSearchBox

Andreas Fetzer 12 years ago
parent
commit
f27bac451a

+ 10 - 33
Libs/DICOM/Widgets/Resources/UI/ctkDICOMTableView.ui

@@ -37,7 +37,7 @@
       </spacer>
      </item>
      <item>
-      <widget class="QLineEdit" name="leSearchBox">
+      <widget class="ctkSearchBox" name="leSearchBox">
        <property name="sizePolicy">
         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
          <horstretch>0</horstretch>
@@ -51,19 +51,8 @@
         <string/>
        </property>
        <property name="placeholderText">
-        <string>Search...</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="pBDeleteSearch">
-       <property name="text">
         <string/>
        </property>
-       <property name="icon">
-        <iconset resource="../../../../Widgets/Resources/ctkWidgets.qrc">
-         <normaloff>:/Icons/clear.svg</normaloff>:/Icons/clear.svg</iconset>
-       </property>
       </widget>
      </item>
     </layout>
@@ -73,25 +62,13 @@
    </item>
   </layout>
  </widget>
- <resources>
-  <include location="../../../../Widgets/Resources/ctkWidgets.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>pBDeleteSearch</sender>
-   <signal>clicked()</signal>
-   <receiver>leSearchBox</receiver>
-   <slot>clear()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>743</x>
-     <y>30</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>680</x>
-     <y>29</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <customwidgets>
+  <customwidget>
+   <class>ctkSearchBox</class>
+   <extends>QLineEdit</extends>
+   <header location="global">ctkSearchBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
 </ui>

+ 3 - 0
Libs/DICOM/Widgets/ctkDICOMTableView.cpp

@@ -82,6 +82,9 @@ void ctkDICOMTableViewPrivate::init()
   this->tblDicomDatabaseView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
   this->tblDicomDatabaseView->horizontalHeader()->setStretchLastSection(true);
 
+  this->leSearchBox->setAlwaysShowClearIcon(true);
+  this->leSearchBox->setShowSearchIcon(true);
+
   if (this->DICOMDatabase)
   {
     this->setUpTableView();