PDA

View Full Version : Qdialog with out min,max and close button,,,,,,,,,



vani.pv
27th August 2012, 14:38
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........

mvuori
27th August 2012, 17:43
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_can_i_create_a_qdialog_that_has_no_minimize_ma ximize_and_close_buttons_

vani.pv
28th August 2012, 05:22
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....

ChrisW67
28th August 2012, 07:41
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 (http://doc.qt.nokia.com/3.3/qwidget.html#setWFlags). Try QWidget::setWFlags().

Please help me out.........
Update to Qt 4.8

vani.pv
29th August 2012, 05:34
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 ?

ChrisW67
29th August 2012, 06:01
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.

vani.pv
29th August 2012, 08:07
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....

spirit
29th August 2012, 08:09
By navigation to QTDIR/bin.

ChrisW67
29th August 2012, 09:05
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:


D:\Qt\4.8.2>dir bin\*.exe /w
Volume in drive D is Data
Volume Serial Number is 9A47-6800

Directory of D:\Qt\4.8.2\bin

assistant.exe designer.exe
dumpcpp.exe idc.exe
lconvert.exe linguist.exe
lrelease.exe lupdate.exe
moc.exe pixeltool.exe
qcollectiongenerator.exe qdoc3.exe
qhelpconverter.exe qhelpgenerator.exe
qmake.exe qmlplugindump.exe
qmlplugindumpd.exe qmlviewer.exe
qt3to4.exe qtdemo.exe
qttracereplay.exe rcc.exe
uic.exe uic3.exe
xmlpatterns.exe xmlpatternsvalidator.exe
26 File(s) 17,203,712 bytes
0 Dir(s) 12,528,525,312 bytes free

vani.pv
29th August 2012, 10:40
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.

ChrisW67
29th August 2012, 11:43
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 is now configured for building. Just run 'gmake'.
Once everything is built, you must run 'gmake install'.
Qt will be installed into /usr/local/Trolltech/Qt-4.8.2

To reconfigure, run 'gmake confclean' and 'configure'.

vani.pv
30th August 2012, 06:34
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.

vani.pv
29th October 2012, 11:07
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?

toddmarsh08
29th October 2012, 18:54
Hello,

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

vani.pv
30th October 2012, 06:17
i am using Qt creator 2.5. and
have qt 4.6

ChrisW67
30th October 2012, 08:06
So you have tried "all the ways" but don't mention the obvious Qt::WindowCloseButtonHint. Did you look at the Window Flags Example code?



#include <QtGui>

int main(int argc, char **argv)
{
QApplication app(argc, argv);

QWidget w;
// or QDialog w;
w.setWindowTitle("Widget");
Qt::WindowFlags f = w.windowFlags();
f |= Qt::CustomizeWindowHint; // set the customise flag
f &= ~(Qt::WindowCloseButtonHint | Qt::WindowMinMaxButtonsHint); // unset the unwanted flags
w.setWindowFlags(f);
w.show();

QTimer::singleShot(30000, qApp, SLOT(quit()));
return app.exec();
}


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.