PDA

View Full Version : How to achieve Uniformity...!!!



deepusrp
5th May 2007, 07:33
Hello,

I am developing an application. I have so many doubts... please let me know the solutions

1. I want to disable the maximize/minimize button on my application

2. I am using a graphical label widget(QLabel). I'm using this to display the .eps object. I want that object to be displayed exactly square. When i first designed (in Zenwalk), i gave absolute values; it was showing perfectly. When i tried in other distribution like fedora-6 that image is not perfect square rather it looks like rectangle and the image looks like somewhat pressed from left and right sides. How can i modify that object so that it should be perfect square irrespective of the distribution

When i discussed this problem with some one, he suggested me to get the resolution or the number of pixels; i dont know how to get that.

3. Is there any object in Qt3 which can display the postscript file as it is. That is an object which displays .ps or .eps files without converting to jpeg or jpg or any other. What i a m doing now is i'm converting .ps to .eps then to jpeg.

thanks in advance

wysota
5th May 2007, 08:26
1. I want to disable the maximize/minimize button on my application
Try tweaking the window flags passed to the constructor.


2. I am using a graphical label widget(QLabel). I'm using this to display the .eps object. I want that object to be displayed exactly square. When i first designed (in Zenwalk), i gave absolute values; it was showing perfectly. When i tried in other distribution like fedora-6 that image is not perfect square rather it looks like rectangle and the image looks like somewhat pressed from left and right sides. How can i modify that object so that it should be perfect square irrespective of the distribution

Make sure the sizeHint returns the proper (square) size of the contents and set the size policy of the widget to fixed in both directions.

deepusrp
6th May 2007, 19:07
Thank you sir

Can u give me a piece of code or the property name. It will be of more help

What about the third one

thanks once again

marcel
6th May 2007, 19:15
What about the third one


3. No, unfortunately the is no such thing. You might want to think about using a third party library, like GhostScript. It is open source and there is also a viewer implemented, so you don't have to start from scratch.

Regards

wysota
6th May 2007, 20:28
Can u give me a piece of code or the property name.
What property name?


It will be of more help
I'm sure you'll manage without it. It's a single line of code reimplementing the default sizeHint method.

deepusrp
7th May 2007, 06:40
Thanks Mr Marcel 'n' Mr Wysota

Mr Marcel, can i embedd ghostviewer into my application so that the user can view the file with in my apllication window itself. If so please tell me how; if possible with a piece of code.

Mr Wyosta, The property which i asked was the form property, which property i have to change and to what. I have tried so many times, but i didn't succeed.

Thanks a lot

marcel
7th May 2007, 07:03
Mr Marcel, can i embedd ghostviewer into my application so that the user can view the file with in my apllication window itself. If so please tell me how; if possible with a piece of code.


It is not simple to do this.
If you just want to display the PS file, you can make ghostscript give you a flattened version of the document ( an image, pixmap ) and you just paint it in your window.
If you want to interact with the objects inside the file (texts, vectors), you will have to parse the PS with GhostScript and construct the objects yourself.

A code snippet will not help you in this case.
I suggest taking a good look at the GhostView sources. It also displays a rasterized version of the postscript file. Most application are not even concerned with the ghostscript sources. They just take gs32dll.lib and link with it. The API is decently documented on their site.You can use Google to find out more details.

Regards

deepusrp
7th May 2007, 08:59
Can i do the same using kparts. If so, how.. please give some code. I dont know parts.

wysota
7th May 2007, 09:11
Mr Wyosta, The property which i asked was the form property, which property i have to change and to what. I have tried so many times, but i didn't succeed.

There is no such property. You have to reimplement a method from QWidget.



Can i do the same using kparts. If so, how.. please give some code. I dont know parts.

We've already been through this topic. You were given a complete piece of code to achieve what you want. What more do you want?

marcel
7th May 2007, 09:11
Possibly. I have never used it... But, for example, the PostScript preview in Konqueror also uses GhostScript at some level.

You can start here:
http://developer.kde.org/documentation/tutorials/kparts/

Next you can dig in the KDE sources, just to see how the PS thumbnail is achieved.

Regards