Results 1 to 3 of 3

Thread: A Qwidget , setparent and Qwindow flags problem.

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default A Qwidget , setparent and Qwindow flags problem.

    I have a custom Qwidget with movement capabilities (using the mouse).
    Ok, this QWidget works fine when it is inserted into any other widget, that is, I can move it inside the limits of the widget where I placed it.
    Now I'd want to do the same but having this custom QWidget floating on the desktop.

    Ok, I have a UI where I have the custom Widget (I prefer to use the designer to design my interface). Now my questions are :
    - Can I 'load' only my Custom Widget ? (I dont want neither need the main QWidget)
    (Now I have the problem that my Custom widget is moving inside the Ui main QWidget )
    - And how can I can say it 'Your parent is this application, but your 'free world' is the desktop'
    I hope you understand what I want . Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A Qwidget , setparent and Qwindow flags problem.

    Quote Originally Posted by tonnot View Post
    - Can I 'load' only my Custom Widget ? (I dont want neither need the main QWidget)
    Load it where?

    - And how can I can say it 'Your parent is this application, but your 'free world' is the desktop'
    If I understand correctly what you want then you can't. The only thing you can do is to make your widget a classic window and set a hint on it to bypass the window manager. Then you can use approaches such as these mentioned below to operate on the widget.

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A Qwidget , setparent and Qwindow flags problem.

    Thanks WY.
    Anwsering you, to the first. Imagine I have a ui with 25 Qframes (each one for a specific purpose and with different buttons and other widgets). Imagine I want to show a dialog with the Qframe 12 (only). A solution can be : 1.- hide de tab widget where I have organized my 25 Qframes. 2.- Set the parent of Qframe 12 to main layout. 3.- Show the dialog.
    I have 24 unused frames. This is the reason because I'd like to have a way to 'load' only the Qframe12.

    To the second:
    I have now this :
    Qt Code:
    1. A_analyzer = new A_analyzer(qApp->activeWindow());
    To copy to clipboard, switch view to plain text mode 
    Inside A_analyzer constuctor :
    Qt Code:
    1. Qt::WindowFlags flags = 0;
    2. flags = Qt::SplashScreen;
    3. this->setWindowFlags(flags);
    4. this->move(0,0)
    To copy to clipboard, switch view to plain text mode 
    Ok, I see my widget-window without title (this is what I want). But, it would not have to be contained by qApp->activeWindow() ??? this->move(0,0) place the window at top-left of the screen, not at 0,0 of the activeWindow. Maybe the flag SplashScreen let my 'window' can live into the whole desktop?????

    Thanks

Similar Threads

  1. QObject::setParent across threads.
    By psih128 in forum Qt Programming
    Replies: 4
    Last Post: 21st January 2014, 16:01
  2. Why QWindow is not initialized with the NEW keyword?
    By probine in forum Qt Programming
    Replies: 5
    Last Post: 3rd April 2010, 22:28
  3. Qt on S60: setting window flags to QWidget don't work?
    By TheJ in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 18th September 2009, 11:10
  4. Qt widget setParent
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 30th November 2007, 20:38
  5. Parenting QWindow...
    By roomie in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2006, 09:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.