Is it possible for me to represent each day in calender in button,so that i can interact with each of the day for particular process..
Is it possible for me to represent each day in calender in button,so that i can interact with each of the day for particular process..
Yes, its possible.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Can u please tell me how it can be done...as i have created array of button..that looks like
1 2 3 4 5 6 7
8 9 10........
.......31
each of these number r shown in button...now hw can i change the position of each button depending upon the month ie if i change my month from april to may
than the position of the button changes as per calender work..so what logic i hv to use to implement this i want to knw..
thanks
Here are some thoughts:
- Create 31 buttons. Create a 7x5 grid layout and move the buttons to the appropriate cells for the month (and hide 29, 30, 31 as required)
- Create 35 buttons and put them into a 7x5 grid layout. Set the labels and enable disable the correct buttons for the month.
would u provide some code regarding this..as i am new in QT..
If you are new to Qt then it is very important that you know where to find the manual.
Open Qt Assistant and search for "Layout Examples" and look at the "Basic Layouts Example". Also read the docs for QGridLayout.
If you are targeting S60 then Qt Quick may also be of interest, but I cannot help at all with that.
maybe, if you would provide a concrete description of the problem you have?would u provide some code regarding this.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Problem is that instead of representing all day that is 1 to 31 in grid that is given in the calender widget in qtdesigner part..i hv to built my own custom calender where i represent each day ie from 1 to 31 in buttons...so that i can interact with each day as i want..either by onclick or onpress function..so if suitable can u provide me the code for that..
thanks
Sure.so if suitable can u provide me the code for that.
Do you want a special skin for it as well?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
yeh..if possible
Sure, I am right on it.
Should the user be able to use Chinese calendar as well?
Or you want only the Gregorian?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
no jst want Gregorian..
I give up.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
i just sent u the interface design...u just check it whether it possible to bulid like that..or not..means whether we can use buttons in day as shown in interface as i hv send..if possible plz send me the code
[IMG]file:///C:/Users/PT356110002/Desktop/image.html[/IMG]
Added after 39 minutes:
i had used the calender widget in one dialog ie dialog1.h...now when i click any of the day in calender widget than i went to another dialog ie dialog2.ui,there is one button in dialog2.ui...now when i click the button in dialog2 than i again went to dialog1.ui..but when i do so i need some changes in calender widget such color changes in each day..
The problem is that when i do the same thing in single dialog then it works...but when i perform this action in another dialog than error occurs..that is calender object not found..so i can i resolve this bug..
Last edited by anshumanBorah; 13th April 2011 at 11:31.
Hi anshumanBorah,
You should learn the concept of irony. High-flyer had no intention of giving you the code. No-one in this forum will just give some piece of code to someone who doesn't spend any effort in trying to find the solution himself.
To get you started (perhaps not 100% correct but you'll get the idea) :
Make a form in designer, and put a QFrame on in where you want all your buttons.
Next, try and create two QPushButtons in the constructor of your form class (after the setupUi(this) statement) and put them on your form or in the QFrame.
If you understand this, try and create a QGridLayout in the constructor of your form class and add it to the QFrame. Then add the buttons to the QGridLayout.
If this works, add buttons for all the days to the grid layout.
Good luck,
Marc
thanks for ur suggestion..one more query
how can i call a function of one dialog from anothe dialog...
Aaaargh..... not again ..... That question has been asked many, many times on this forum.
A dialog is an instance of a class. To be able to call one of its methods, you have to have a reference or pointer to that instance. A quick-and-dirty way to do this is to create a global variable that is accessible from the code in both your dialogs.
This is very basic C++. If you don't know C++ already, you should really really learn it first before starting to use Qt.
Best regards,
Marc
Actually i had done this but when i return from one dialog to another,the Interface design is change..suppose i had dialog named ss.ui contain buttons?supose there is another dialog hh.ui...In first dialog i write a code like this...
hh s(this)//create a instance of second dialog
s.show();
s.exec();
after executing i came to second dialog..in second dialog cpp file when i write the code like this..
ss a(this)//create a instance of first dialog
a.show();
it will not work...but if i write like this..
ss *a=new ss();
a.show();
it will work but once i return to first dialog the size of button become smaller as compared it is actually constructed..so hw can i solve this problem..
Please use code tags and show original code. Did you read QDialog::exec and do you understand the difference to QWidget::show?
Bookmarks