The problem remains the same. The image is not shown.bedipritpal wrote:Try:Roberto Lopez wrote: There is no special code. It is simply demoqt with Harbour built from current (a couple of days ago) sources.
The same works perfect on Windows.
oActNew := QAction():new( oMenu1 )
oActNew:setText( "&New" )
oActNew:setIcon( "new.png" )
oActNew:connect( "triggered(bool)", {|w,l| FileDialog( "New" , w, l ) } )
oMenu1:addAction_4( oActNew )
hbQT - Post queries in this thread only
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: hbQT - Post queries in this thread only
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- bedipritpal
- Posts: 122
- Joined: Thu Sep 02, 2010 10:47 pm
Re: hbQT - Post queries in this thread only
This aspect has gained more importance now as you have decided to base HMG on hbQT.A little suggestion:
Since QT official reference samples (and most of those we can find on the web) are C++ based, could be very useful if you could write a small HOWTO file, explaining how to handle certain situations when the translation of the code is not obvious for a Harbour/xBase programmer without C++ knowledge.
I do not commit but I will try to write one. In all practical situations you can easily grasp the
idea off hbIDE sources which exploits almost all classes of Qt.
As a rule of hbQT implementation, a pointer has to be encapsulated within return type object,
which on the issue we just resolved is - qPainter:device(). If you read Qt's documentation
QPainter():device() returns the QPaintDevice() *. Just encapsulate it in QPaintDevice():from( painter:device() ).
This holds good for all other classes too.
BTW I just downloaded HMG sources and the first scan have a suggestion for you:
The code is haphazardly formatted, indentation is TAB key but anybody touching the code
takes his/her own path, and many more anomalies. The code is entirely off Harbour standards on formatting levels.
I agree that writing the correct and efficient code is of utmost importance, but it is equally important
to have it presentable. I could not ascertain the correct picture of HMG object modal at all and after
few minutes gave up.
You can suggest your developers to use hbIDE. That could be an important resource for your team
to learn how Qt can be exploited best besides provoding necessary tips on formatting front.
This is simply a suggestion, you may follow or descard, entirely upto you.
enjoy hbIDEing... Pritpal Bedi
- bedipritpal
- Posts: 122
- Joined: Thu Sep 02, 2010 10:47 pm
Re: hbQT - Post queries in this thread only
I have no idea then.The problem remains the same. The image is not shown.
enjoy hbIDEing... Pritpal Bedi
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: hbQT - Post queries in this thread only
Thanks for your explanations and suggestions.bedipritpal wrote:This aspect has gained more importance now as you have decided to base HMG on hbQT.
<...>
Of course, I strongly agree with you in the formatting issue. It must be solved.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: hbQT - Post queries in this thread only
Thanks a lot for your detailed review Bedi.
I usually don't use tab key and give 3 spaces indentation. I will try HBIDE. Thanks for suggesting.
I usually don't use tab key and give 3 spaces indentation. I will try HBIDE. Thanks for suggesting.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: hbQT - Post queries in this thread only
I'm repeatting my post here:
Hi Pritpal!
First - Welcome from Poland!
Second - I have a question about QComboBox.
I need to realize SORT option - when all inserted items are sorted.
I've read about Insert Policies, but, in my opinion, they don't work.
Do you have any suggestion about it?
Hi Pritpal!
First - Welcome from Poland!
Second - I have a question about QComboBox.
I need to realize SORT option - when all inserted items are sorted.
I've read about Insert Policies, but, in my opinion, they don't work.
Do you have any suggestion about it?
Code: Select all
if lValue == .T.
::oQTObject:setInsertPolicy(6) //QComboBox::InsertAlphabetically
else
::oQTObject:setInsertPolicy(3) //QComboBox::InsertAtBottom
endif
- bedipritpal
- Posts: 122
- Joined: Thu Sep 02, 2010 10:47 pm
Re: hbQT - Post queries in this thread only
This is Qt documentation :mol wrote: I need to realize SORT option - when all inserted items are sorted.
I've read about Insert Policies, but, in my opinion, they don't work.
enum QComboBox::InsertPolicy
This enum specifies what the QComboBox should do when a new string is entered by the user.
^^^^^^^^^^^^^^^^
So this enum is used when user enters string the the combo-box's edit control.
:addItem()/:insertItem() always takes the bottom, or index of the item.
To simulate thi behavior, you need to keep array of strings into a instance vriable.
clear the combobox contents first and then push the sordted array you just preserved.
Like this :
DATA aComboItems INIT {}
METHOD addItem( cItem ) SETGET
METHOD ClassComboBox:addItem( cItem )
LOCAL s
IF hb_isChar( cItem )
aadd( ::aComboItems, cItem )
asort( ::aComboItems, , , {|e,f| e < f } )
::oQtObject:clear()
FOR EACH s IN ::aComboItems
::oQtObject:addItem( s )
NEXT
ENDIF
RETURN Self
You can tweak the above code to suit your requirements.
Unluckily QComboBox() does not have any sorting methods, we are to simulate ourselves.
enjoy hbIDEing... Pritpal Bedi
Re: hbQT - Post queries in this thread only
Thanks!
I've expected Qcombobox will sort items
Now, I can see, it need to be realized manually.
I've expected Qcombobox will sort items
Now, I can see, it need to be realized manually.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: hbQT - Post queries in this thread only
Hi,
Should I do anything else to make this work? I want to add an action enabled label when the user clicks on it. This is to add this widget to the status bar. I tried QPushButton instead. But it looks differently (center aligned, raised) when compared to other non-action oriented status bar items.
Should I do anything else to make this work? I want to add an action enabled label when the user clicks on it. This is to add this widget to the status bar. I tried QPushButton instead. But it looks differently (center aligned, raised) when compared to other non-action oriented status bar items.
Code: Select all
oWidget := QLabel():New()
oWidget:setText('Clickable Label')
oWidget:setMouseTracking(.t.)
oWidget:disconnect("mouseReleaseEvent()")
oWidget:connect("mouseReleaseEvent()",bBlock)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- bedipritpal
- Posts: 122
- Joined: Thu Sep 02, 2010 10:47 pm
Re: hbQT - Post queries in this thread only
oWidget := QLabel():New()rathinagiri wrote:Hi,
Should I do anything else to make this work? I want to add an action enabled label when the user clicks on it. This is to add this widget to the status bar. I tried QPushButton instead. But it looks differently (center aligned, raised) when compared to other non-action oriented status bar items.
Code: Select all
oWidget := QLabel():New() oWidget:setText('Clickable Label') oWidget:setMouseTracking(.t.) oWidget:disconnect("mouseReleaseEvent()") oWidget:connect("mouseReleaseEvent()",bBlock)
oWidget:setText( "<a href='http://harbour-project.org/'>http://har ... ct.org/</a>" )
oWidget:connect( "linkActivated(QString)", {|QString| ::execEvent( QString ) } )
enjoy hbIDEing... Pritpal Bedi