Pritpal Bedi wrote:
>
> Hi
>
>
> PCToledo wrote:
>>
>> I compiled the file demoqt of HBQT and liked much, but I'm lost.
>>
>> Someone could send a small example of how to create a Window Main and
>> open it in a Window Modal?
>>
>
> Try HBIDE and right clic k on <Harbour-Qt IDE> node of <Project Tree> and
> select <Properties>.
> It is a modal dialog in HBIDE's main window.
>
> I hope I understood what you asked for.
>
> Regards
> Pritpal Bedi
>
Pritpal Bedi, thanks for the help, but I wanted a code example of modal
window
My code:
/*----------------------------------------------------------------------*/
#include "hbqt.ch"
#include "common.ch"
#define QT_EVE_TRIGGERED_B "triggered(bool)"
STATIC oApplication
/*----------------------------------------------------------------------*/
INIT PROCEDURE Qt_Start()
oApplication := QApplication():new()
RETURN
EXIT PROCEDURE Qt_End()
oApplication:quit()
RETURN
Procedure Main()
Local oMainWindow, oStatusBar, oStatusTit, oMenuBar, oMenuFile
oMainWindow := QMainWindow():New()
oMainWindow:setMouseTracking( .t. )
oMainWindow:SetWindowTitle("Program title")
oStatusBar := QStatusBar():new(QT_PTROF(oMainWindow))
oStatusTit := QLabel():new()
oStatusTit:setText(" PCToledo Sistemas - [email protected]")
oStatusTit:setMinimumSize(oStatusTit:sizeHint())
oStatusBar:addWidget(QT_PTROF(oStatusTit),1)
oMainWindow:setStatusBar( QT_PTROF(oStatusBar) )
oStatusBar:setSizeGripEnabled(.f.)
oMenuBar := QMenuBar():new()
oMenuBar:resize( oMainWindow:width(), 25 )
oMenuFile := QMenu():new()
oMenuFile:setTitle("&File")
Qt_Connect_Signal( oMenuFile:AddAction("&Exit"), QT_EVE_TRIGGERED_B, {||
oMainWindow:close() })
oMenuBar:addMenu( QT_PTROF( oMenuFile ) )
oMainWindow:setMenuBar( QT_PTROF( oMenuBar ) )
IF PassWord(oMainWindow)
//valid password
ELSE
//Invalid Password
ENDIF
oMainWindow:showMaximized()
oApplication:Exec()
Return
STATIC FUNCTION PassWord()
Local Ret:=.T.
/* How to create a modal window here? I want a code example.
example:
+--------------------------------+
| Enter your password... |
| |
| Name: ______________________ |
| Password: __________________ |
| |
| +----------+ |
| | Ok | |
| +----------+ |
+--------------------------------+
*/
Return (Ret)
/*----------------------------------------------------------------------*/
Regards
-----
Toledo
http://www.pctoledo.com.br/forum http://www.pctoledo.com.br/forum
--
View this message in context:
http://old.nabble.com/Window-Main-X-Window-Modal-X-HBQT-tp26818868p26825519.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour