Results 1 to 3 of 3

Thread: Having an issue with Qt Window Flags

  1. #1
    Join Date
    Jun 2012
    Posts
    98
    Thanks
    11
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Having an issue with Qt Window Flags

    Basically in my custom class (derived from QDialog) when I set any window flags (that I've tried) I can't get see the window. I've used redundant calls to "show()" as this seems to imply, but I still can't see the window. Here is the relevant code:
    Qt Code:
    1. //synthkeypad.cpp
    2. SynthKeypad::SynthKeypad(QWidget *parent) :
    3. QDialog(parent),
    4. ui(new Ui::SynthKeypad)
    5. {
    6. //initialize ui file
    7. ui->setupUi(this);
    8.  
    9. //set the window to modify size
    10. layout()->setSizeConstraint(QLayout::SetFixedSize);
    11.  
    12. //initialize connections
    13. setupConnections();
    14.  
    15. this->setStyleSheet("QDialog {background-color: rgb(151,111,94);}");
    16.  
    17. //***If this line is commented out, the window works as desired, EXCEPT it has help and close buttons, a title bar, etc..***
    18. this->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint);
    19. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. void GenrepFE::setupPPMKeypad(SynthKeypad *inpad)
    2. {
    3. //Just putting this all here so you don't assume this function is screwing things up
    4. //these are just wrapper functions to initialize parameters of the dialog
    5. inpad->setSpinBoxRange(-500,500);
    6. inpad->addType(QString("ppm"));
    7. inpad->enableNegative();
    8. inpad->setTextBlob("blah");
    9. }
    10.  
    11. void GenrepFE::openPPMKeypad()
    12. {
    13. ui->synthButton->releaseMouse(); //don't worry about this ;)
    14.  
    15. SynthKeypad *ppmKeypad = new SynthKeypad(this);
    16. setupPPMKeypad(ppmKeypad);
    17. connect(ppmKeypad,SIGNAL(accepting(double)),this,SLOT(ppmAccepted(double)));
    18. ppmKeypad->exec();
    19. ppmKeypad->show(); //this is the "redundant" call I added, even though exec should be showing the window like normal.
    20.  
    21. delete ppmKeypad;
    22. }
    To copy to clipboard, switch view to plain text mode 

    If someone could point out why the window flags are leaving the window hidden (or maybe I've used a bad combination?) despite
    being show()n, that'd be very helpful. Also, if you can provide an explanation (if it's not painfully obvious) as to why this is happening that's double-plus-helpful

    Thanks!

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Having an issue with Qt Window Flags

    dunno. exec() should make it visible.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Jun 2012
    Posts
    98
    Thanks
    11
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Having an issue with Qt Window Flags

    I decided to have the parent just call "Frameless window" on it. I assume that by using CustomizeWindowHint I was resetting something important?

Similar Threads

  1. Double window issue
    By georgeky in forum Newbie
    Replies: 2
    Last Post: 31st January 2011, 05:14
  2. Window Title Text left alignment issue.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2010, 14:46
  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. Window Layout issue.
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 26th August 2008, 21:46
  5. Flags not doing the work
    By chaosgeorge in forum Qt Programming
    Replies: 1
    Last Post: 23rd November 2006, 23:35

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.