Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Custom widget demoted to base widget on its own

Custom widget demoted to base widget on its own

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 174 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Knaron
    wrote on last edited by
    #1

    I've made multiple custom widgets in a single plugin. One of these is a custom line edit that inherits from QLineEdit. When I open a ui file in the form editor the object list says that they are all a QLineEdit and not my custom line edit. This doesn't happen for the other widgets in the same plugin. My custom line edit is still in the toolbox list, but when I add it to the ui it is a QLineEdit.
    When I open the ui file in a text editor it shows that the line edits use my custom line edit. When I make a change in the form editor and save it, then all the line edits are changed to QLineEdit even in the text editor.
    From testing I know that if I remove the plugin library, then the form editor uses my custom line edit. I've also noticed that when I want to promote a widget (doesn't need to be a line edit), that in the options of the base class combo-box the QLineEdit is missing but my custom line edit is in that list (I don't know how). So I can't promote the line edits.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Knaron
      wrote on last edited by
      #2

      Q_OBJECT was needed in the line edit to make it work

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved