Results 1 to 16 of 16

Thread: Qdialog with out min,max and close button,,,,,,,,,

  1. #1
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Qdialog with out min,max and close button,,,,,,,,,

    Hi........
    I am using Qt for my application in which i need a Qdialog with out close mark in the top of the screen........I have gone through so many examples . but i dint get any clue..and all the examples are related to qwindow not for qdialog
    .when i am trying "CustomizeWindowHint" kind of functions it is showing there is no such kind of function in qt.
    I am using qt3.3.......
    Please help me out.........


    thanks........

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    When I googled "qt qdialog without maximize" (without quotes), the first hit was
    "How can I create a QDialog that has no minimize, maximize and close buttons in the titlebar?"
    http://qt-project.org/faq/answer/how...close_buttons_

  3. #3
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Thanks mvuori.......
    I have used it in my last trial.Again the same error that
    there is no function "WindowTitleHint" in qt.. I think these all are new ones from qt next version.........Is there any other way to achieve through qt3.3........
    And i have one more que that
    Hoe can I fix my dialog size to my screen size and it should be affixed to screen........

    Thanku....

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Quote Originally Posted by vani.pv View Post
    I am using qt3.3.......
    There's your problem. You are using a version Qt that is not even vaguely current: Qt 4 was released 7 years ago and Qt 5 is just around the corner. You will be hard put to find cut'n'paste examples anywhere except the documentation that comes with the Qt you are using. Try QWidget::setWFlags().
    Please help me out.........
    Update to Qt 4.8

  5. #5
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    thanks chris.......
    where can I get Qt4.8....... Is this is a complete SDK or just a designer/creator/Library.Bcause while i am searching for Qt4.8 whatever the link available directs to qt website .But there is no useful thing to me.I tried to install Qt4.8 lib but i dint get any thing...Is qtsdk1.2.1 support RedHat6.1 ?

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Quote Originally Posted by vani.pv View Post
    where can I get Qt4.8.......
    Seriously? http://www.qt-project.org/downloads or the package manager for your Linux distro.
    Is this is a complete SDK
    Maybe, if that is what you grab.

    The very first line of the downloads page, "The Qt SDK includes the tools you need to build desktop, embedded and mobile applications with Qt from a single install." It then lists the components it includes. Sounds fairly complete to me. For Linux/Mac it assumes you have a working C++ compiler tool chain. For Windows it can optionally install a C++ compiler and tools, or it can use an existing one.

    Your Linux distro package manager will probably not offer a complete "Qt SDK" but it will offer the Qt libraries and maybe Qt Creator.
    or just a designer/creator/Library.
    If you download the Qt Library source and build it yourself you get the libraries, Assistant, Designer, qmake, and the docs... or you can download a prebuilt version of same.
    If you download the Qt Creator source and build it for yourself you get Qt Creator... or you can download a prebuilt version of same. Qt Creator is just an IDE.
    Bcause while i am searching for Qt4.8 whatever the link available directs to qt website .But there is no useful thing to me.I tried to install Qt4.8 lib but i dint get any thing...
    You could not find anything useful? But you managed to "tried to install Qt4.8 lib"... so you must have found something. I have no idea what you "dint get".
    Is qtsdk1.2.1 support RedHat6.1 ?
    Yes. I expect the binaries will run here, and you can definitely build from source.

  7. #7
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    I have installed qt4.8 lib,but there is no exe's for designer and creator.It might be problem with installation.I have done this for 3 times and there is no change in result.
    There is only moc,ui3,ui.. exe's available.Tell me how could I start designer after installation....

    thanks....

  8. #8
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    By navigation to QTDIR/bin.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  9. #9
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    I have installed qt4.8 lib
    How did you install the libs? On what platform? If you used your distro repository you might also need a "qt-devel" package.

    On Windows the prebuilt-binary version of the Qt 4.8.2 libraries includes:
    Qt Code:
    1. D:\Qt\4.8.2>dir bin\*.exe /w
    2. Volume in drive D is Data
    3. Volume Serial Number is 9A47-6800
    4.  
    5. Directory of D:\Qt\4.8.2\bin
    6.  
    7. assistant.exe designer.exe
    8. dumpcpp.exe idc.exe
    9. lconvert.exe linguist.exe
    10. lrelease.exe lupdate.exe
    11. moc.exe pixeltool.exe
    12. qcollectiongenerator.exe qdoc3.exe
    13. qhelpconverter.exe qhelpgenerator.exe
    14. qmake.exe qmlplugindump.exe
    15. qmlplugindumpd.exe qmlviewer.exe
    16. qt3to4.exe qtdemo.exe
    17. qttracereplay.exe rcc.exe
    18. uic.exe uic3.exe
    19. xmlpatterns.exe xmlpatternsvalidator.exe
    20. 26 File(s) 17,203,712 bytes
    21. 0 Dir(s) 12,528,525,312 bytes free
    To copy to clipboard, switch view to plain text mode 

  10. #10
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    there is no designer or creator exe's in bin.

    Mine is ReadHat5.5.

    i just build the configure exe then gmake and gmake install.

  11. #11
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Qt Creator is not part of the Qt libraries. Designer is.

    What was the prefix used for the install? Did it go into /usr, /usr/local or /usr/local/Trolltech/Qt-4.8.2? The configure program tells you when it finishes:
    Qt Code:
    1. ...
    2. Qt is now configured for building. Just run 'gmake'.
    3. Once everything is built, you must run 'gmake install'.
    4. Qt will be installed into /usr/local/Trolltech/Qt-4.8.2
    5.  
    6. To reconfigure, run 'gmake confclean' and 'configure'.
    To copy to clipboard, switch view to plain text mode 

  12. #12
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Instructions are same as above.
    i have used gmake and gmake install.
    and the location is /usr/local or /usr/local/Trolltech/Qt-4.8.2.
    in Qt-4.8.2 there are bin,include,plugin directories available.
    in bin moc,uic3 and uic exes available.But there is no exe for designer and document.

  13. #13
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Hi.....

    Problem with close button.

    I have tried all the ways to hide the close button of my dialog.
    CustomizeWindowHint , Qt::WindowTitleHint , Qt::WindowMinMaxButtonsHint.
    all these three are not working for my dialog......

    any suggestions?

  14. #14
    Join Date
    Oct 2012
    Location
    Northbrook,IL
    Posts
    1

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    Hello,

    May I know what version are you using?
    It might be the same as what I had experienced.

  15. #15
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qdialog with out min,max and close button,,,,,,,,,


    i am using Qt creator 2.5. and
    have qt 4.6

  16. #16
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qdialog with out min,max and close button,,,,,,,,,

    So you have tried "all the ways" but don't mention the obvious Qt::WindowCloseButtonHint. Did you look at the Window Flags Example code?

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char **argv)
    4. {
    5. QApplication app(argc, argv);
    6.  
    7. QWidget w;
    8. // or QDialog w;
    9. w.setWindowTitle("Widget");
    10. Qt::WindowFlags f = w.windowFlags();
    11. f |= Qt::CustomizeWindowHint; // set the customise flag
    12. f &= ~(Qt::WindowCloseButtonHint | Qt::WindowMinMaxButtonsHint); // unset the unwanted flags
    13. w.setWindowFlags(f);
    14. w.show();
    15.  
    16. QTimer::singleShot(30000, qApp, SLOT(quit()));
    17. return app.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 

    Works as expected on Windows XP. Works on my Linux box with KDE window manager for removing the Close control. Unfortunately the window manager seem to ignore the min/max button hints: if you have a title bar you get these controls.
    Last edited by ChrisW67; 30th October 2012 at 08:45. Reason: updated contents
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

Similar Threads

  1. How to hide close button in QDialog?
    By grantbj74 in forum Newbie
    Replies: 3
    Last Post: 27th September 2011, 01:08
  2. QDialog not showing close button on Mac
    By manojmka in forum Qt Programming
    Replies: 2
    Last Post: 17th September 2008, 12:56
  3. Diasble close button on a QDialog
    By Krish_ng in forum Qt Programming
    Replies: 12
    Last Post: 17th July 2007, 04:23
  4. Replies: 1
    Last Post: 7th July 2007, 09:03
  5. showing close Button(x) in QDialog
    By vishal.chauhan in forum Newbie
    Replies: 6
    Last Post: 4th April 2007, 10:01

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.