Chris K
Chris K

Reputation: 12359

QT qmake lowercases my custom widget names

I'm using QT 4.6 on Linux and Windows, and on Linux, it insists on including my QScrollPane by qscrollpane.h

App.pro:

HEADERS += widgets/QScrollPane.h 

The section from 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>

The ui_mainform.h file:

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

This isn't a big deal on Windows or Mac, but on Linux it's downright annoying. I could create a symlink to solve the issue, but I want to find the root cause.

Regards, -Chris

Upvotes: 3

Views: 159

Answers (1)

chalup
chalup

Reputation: 8516

You need to provide more info 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>

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

I prefer using all lowercase filenames for my classes - I'm always 100% sure I won't be screwed up by some non 100% cross-platform tool.

Upvotes: 5

Related Questions