QT qmake reduces my custom widget names

I use QT 4.6 for Linux and Windows, and on Linux it insists on enabling my QScrollPane using qscrollpane.h

App.pro:

HEADERS += widgets/QScrollPane.h 

Section mainform.ui

<widget class="QScrollPane" name="ListView">
 <property name="geometry">
  <rect>
   <x>0</x>
   <y>0</y>
   <width>500</width>
   <height>490</height>
  </rect>
 </property>
</widget>

File ui_mainform.h:

 #include <QtGui/QStatusBar>
 #include <QtGui/QTabWidget>
 #include <QtGui/QWidget>
 #include <qscrollpane.h>

This is not a big problem on Windows or Mac, but on Linux it is completely annoying. I could create a symbolic link to solve the problem, but I want to find the root cause.

Regards, Chris

+3
source share
1 answer

You need to provide additional information about your custom widget. Add the following to your mainform.ui:

<customwidgets>
 <customwidget>
  <class>QScrollPane</class>
  <extends>QWidget or whatever class is QScrollPane parent</extends>
  <header>QScrollPane.h</header>
 </customwidget>
</customwidgets>

Must do the trick (disclaimer: tested only on Windows Qt 4.6.1).

- 100% , - 100% - .

+5

Source: https://habr.com/ru/post/1744182/


All Articles