PDA

View Full Version : no error???? why???



Shuchi Agrawal
11th January 2007, 07:27
i m using Qt4.2.2 evaluation version.
following are my files in a project
in 7th line of form.cpp i m calling ui.disp() and
on line no. 13 in function disp() i m calling QmessageBox..
my ques is that why its not giving error during compile.
i m using nmake1.5 n winXP n Visual studio C++ 6.0.
plz suggest me better programming in my given code..

can any1 help me to draw a line or anything on the central widget when i click a menu item?
thanks in advance

Cesar
11th January 2007, 10:44
Try

connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(disp()));
Note, that you should mention slot's name and parameters, but not the object instance.

WBR, Cesar

Shuchi Agrawal
11th January 2007, 11:02
thanks Cesar but i m able to do it correctly.so my ques was that why the given code does not give error as there is no slot in Ui::MainWindow and when QmessageBox class has not been included, still its not showing error. why??????

jpn
11th January 2007, 11:40
Signal slot connections are established at run time. You won't get compilation errors if you misspell something in the connect statement (unless the typo is so bad that it doesn't pass syntactically). The connect statement returns false if the connection fails (and in this case it does print information on the debug output):


Object::connect: No such slot MainWindow::ui.disp()
Object::connect: (sender name: 'pushButton')
Object::connect: (receiver name: 'MainWindow')


You are including the whole QtGui module which leads to including QMessageBox as well.

Shuchi Agrawal
11th January 2007, 12:00
thanks a lot jpn but i cud not understand tht how u got the 3 lines or error u have given in ur reply.
plz explain then how can i know the logaical error like the one i did in my code in slot.
and can u tel me the way to draw line n all on central widget and activate context menu(floating menu)

jpn
11th January 2007, 12:17
thanks a lot jpn but i cud not understand tht how u got the 3 lines or error u have given in ur reply.
plz explain then how can i know the logaical error like the one i did in my code in slot.

Are you running the program in Visual Studio? It should appear in the debug output window.


and can u tel me the way to draw line n all on central widget and

Override QWidget::paintEvent() for the widget you want to paint on and use QPainter to draw the line. For example, if you want to paint on the central widget in a main window, you must reimplement the paintEvent() for the central widget, not for the main window.


activate context menu(floating menu)

See this post (http://www.qtcentre.org/forum/p-open-context-menu-unde-the-items-of-a-qlistwidget-post10468/postcount10.html).

Shuchi Agrawal
11th January 2007, 12:40
hey jpn,
thanks for menu n paint help.
but i m generally creating .ui files,then .h and .cpp files anr running in cmd prompt. so can u help me to make my project with Visual Studio
i hv installed VS C++ 6.0 on my system but not able to use it as i dnt know.

jpn
11th January 2007, 13:15
so can u help me to make my project with Visual Studio
i hv installed VS C++ 6.0 on my system but not able to use it as i dnt know.
The commercial edition of Qt has at least some loose integration to VS6.
Presumably you have the commercial edition of Qt so try downloading and installing the Qt-VsAddin package. The package should give you some tools for managing Qt project directly from VS.

Another solution is to add "CONFIG += console" to the .pro file to make an additional console window appear for the debug output.

Shuchi Agrawal
11th January 2007, 14:23
Another solution is to add "CONFIG += console" to the .pro file to make an additional console window appear for the debug output.

this thing is not working n i wil implement ur plugin suggestion n wil let u know..

hey i m attaching my code.so can u see u tell that is it the right way to paint on central widget(its the way u suggested). if not plz tel me the correct way..

and is the moveDockWindow is the same for Floating window in qt4 or is there some other function or class for same?

jpn
11th January 2007, 15:24
this thing is not working n i wil implement ur plugin suggestion n wil let u know..

You need to always re-run qmake after modifying the .pro file to generate a new makefile. Did you, by any chance, forget that step?



hey i m attaching my code.so can u see u tell that is it the right way to paint on central widget(its the way u suggested). if not plz tel me the correct way..

I can't see any attachments.. ;)



and is the moveDockWindow is the same for Floating window in qt4 or is there some other function or class for same?
What do you mean by "moveDockWindow"? For example the "Sidebar" in Qt Designer is a QDockWidget. Did you mean that?

I can see two Qt3Support methods called "moveDockWindow":

Q3MainWindow::moveDockWindow()
Q3DockArea::moveDockWindow()

Do they have something to do with this? Please be specific with the terms and class names you use. It will be easier for others to interpret the meaning of the post.

jpn
11th January 2007, 16:00
The commercial edition of Qt has at least some loose integration to VS6.
Presumably you have the commercial edition of Qt so try downloading and installing the Qt-VsAddin package. The package should give you some tools for managing Qt project directly from VS.
Bah sorry, it's reading right there in the first post that you are using an evaluation version. Actually, I have no clue if the evaluation version contains the Qt VsAddin package (which is the only official way to integrate Qt4 into VS6). Can anyone confirm whether it does or not? Sorry for the confusion.

wysota
11th January 2007, 16:02
Can anyone confirm whether it does or not? Sorry for the confusion.

AFAIK it does.

Shuchi Agrawal
12th January 2007, 05:53
Bah sorry, it's reading right there in the first post that you are using an evaluation version. Actually, I have no clue if the evaluation version contains the Qt VsAddin package (which is the only official way to integrate Qt4 into VS6). Can anyone confirm whether it does or not? Sorry for the confusion.

hey jpn,

820
821
822

above are the code.so check them n tel tht is it the right way to paint(draw line n a point) on the central widget on a menu click event?[i think its not the right way, though its working]

by floating window i mean the sidebar which u can see on paint application and which can be dragged to any part of the paint window.
plz see to it..
thaks in advance

Shuchi Agrawal
12th January 2007, 05:56
originally osted my WYSOTA

can u tel me ful form of AFAIK?

Shuchi Agrawal
12th January 2007, 06:00
I can't see any attachments.. ;)

i have atached them now.



What do you mean by "moveDockWindow"? For example the "Sidebar" in Qt Designer is a QDockWidget. Did you mean that?

yes i mean with sidebar only which is QDockWidget class in Qt.
thanks

aamer4yu
12th January 2007, 06:36
AFAIK == As Far As I Know

for integrating Qt with Visual Studio check this (http://qtnode.net/wiki/Qt4_with_Visual_Studio)

I have integrated Qt Open Source edition with Visual Studio 2005. But yes designer is not integrated , u have to copy the ui files and compile.
hope this helps

Shuchi Agrawal
12th January 2007, 07:09
AFAIK == As Far As I Know

thanks :)

the link http://qtnode.net/wiki/Qt4_with_Visual_Studio w/c u referred is good.but,
when in this its given steps of qt open source[not commercial evaluation version] with VS 6.0
so in the step Patching the Qt sources i m getting the following :

C:\>cd qt\4.2.2

C:\Qt\4.2.2>nmake \?

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

NMAKE : fatal error U1069: no match found for wildcard '\?'
Stop.

C:\Qt\4.2.2>nmake /?

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

Usage: NMAKE @commandfile
NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets]

Options:

/A Build all evaluated targets
/B Build if time stamps are equal
/C Suppress output messages
/D Display build information
/E Override env-var macros
/HELP Display brief usage message
/I Ignore exit codes from commands
/K Build unrelated targets on error
/N Display commands but do not execute
/NOLOGO Suppress copyright message
/P Display NMAKE information
/Q Check time stamps but do not build
/R Ignore predefined rules/macros
/S Suppress executed-commands display
/T Change time stamps but do not build
/U Dump inline files
/Y Disable batch-mode
/? Display brief usage message

C:\Qt\4.2.2>installpatch42.bat
patching file examples/threads/waitconditions/waitconditions.pro
patching file misc/bcc32pch/bcc32pch.cpp
patching file misc/bcc32pch/bcc32pch.pri
patching file misc/bcc32pch/bcc32pch.pro
The next patch would create the file misc/bcc32pch/Makefile.win32-borland,
which already exists! Assume -R? [n] y // when i m pressing "n" then its microsoft error
patching file misc/bcc32pch/Makefile.win32-borland
Press any key to continue . . .

C:\Qt\4.2.2>configure.exe --help
'configure.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Qt\4.2.2>qconfigure.exe --help
'qconfigure.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Qt\4.2.2>

so can u help me out in this???

jacek
12th January 2007, 12:01
C:\Qt\4.2.2>configure.exe --help
'configure.exe' is not recognized as an internal or external command,
operable program or batch file.
AFAIR you can't recompile the evaluation version, so configure.exe isn't shipped with it.

Shuchi Agrawal
12th January 2007, 12:03
AFAIR you can't recompile the evaluation version, so configure.exe isn't shipped with it.

oh is it??..ok...:(
thanks...

Shuchi Agrawal
12th January 2007, 12:10
hey jpn,
i hv created a new thread for my paint ques.. so plz reply on tht..
thanks

wysota
12th January 2007, 12:14
Furthermore I think the evaluation version is already prepared for Visual C++ compiler so you don't have to recompile it. The article on QtNode.net referrs to making the open source version work with MSVC and you don't need that.

Shuchi Agrawal
12th January 2007, 12:18
ok then how to use Visual C++ 6.0 for my Qt codes given in the first post of this thread...
and ya one thing.. how to delete my attached files from post???
i dnt find any provision in forum for tht?

wysota
12th January 2007, 13:10
ok then how to use Visual C++ 6.0 for my Qt codes given in the first post of this thread...

I think I don't understand the question :) I think you should... push the 'build' button in Visual Studio or call nmake on commandline...


and ya one thing.. how to delete my attached files from post???
i dnt find any provision in forum for tht?

You can ask one of the admins to do that.