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. Dialog is visible only above parent widget
Forum Updated to NodeBB v4.3 + New Features

Dialog is visible only above parent widget

Scheduled Pinned Locked Moved General and Desktop
qt4.8qdialogqwidget
2 Posts 2 Posters 1.0k 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.
  • R Offline
    R Offline
    Ruslan F.
    wrote on last edited by Ruslan F.
    #1

    I have some application with custom window frames. It was achived by using some default template BaseWindow witch sets Qt::FramelessWindowHint and handels move, resize e.t.c. here its code http://pastebin.com/1Uzqmgaw
    I have two windows witch inherets this class. First one is main window inhereted from BaseWindow<QWidget>, second one is a dialog(for example settings dialog) inhereted from BaseWindow<QDialog>
    The problem:
    If in ctor of BaseWindow class i use parent class initilizer i.e

    template <class T>
    BaseWindow<T>::BaseWindow(TitleMode titleMode, ResizeMode resizeMode, QWidget* parent) : T(parent)
    

    than dialog is visible only above parent.
    Can any one explain why this happend?
    I'm using Qt 4.8. Windows.

    A 1 Reply Last reply
    0
    • R Ruslan F.

      I have some application with custom window frames. It was achived by using some default template BaseWindow witch sets Qt::FramelessWindowHint and handels move, resize e.t.c. here its code http://pastebin.com/1Uzqmgaw
      I have two windows witch inherets this class. First one is main window inhereted from BaseWindow<QWidget>, second one is a dialog(for example settings dialog) inhereted from BaseWindow<QDialog>
      The problem:
      If in ctor of BaseWindow class i use parent class initilizer i.e

      template <class T>
      BaseWindow<T>::BaseWindow(TitleMode titleMode, ResizeMode resizeMode, QWidget* parent) : T(parent)
      

      than dialog is visible only above parent.
      Can any one explain why this happend?
      I'm using Qt 4.8. Windows.

      A Offline
      A Offline
      alex_malyu
      wrote on last edited by alex_malyu
      #2

      My comment might not be a reason it does not work for you, but every QObject derived class require Q_OBJECT macro at least if you have any signal/slot defined in it.
      I never tried to write template with such macro and believe it is not supported and will be not handled properly by mocing.
      It might be possible manually create required code instead, but I doubt this solution will be portable.

      In other words my impression is templates are no-no with QObject derived classes.

      1 Reply Last reply
      0

      • Login

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