Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Qt on android

    12
    0 Votes
    12 Posts
    11k Views
    G
    I see...thanks for the info!..
  • Implementing a contrast slider with Qslider

    3
    0 Votes
    3 Posts
    3k Views
    W
    I clear the QGraphicsScene by calling myscene.clear(); When I didn't do this, the program would balloon in memory and quickly crash. I'll try what you suggested. Thanks.
  • How to save the state of Q3Checklistitem on being checked or unchecked..

    5
    0 Votes
    5 Posts
    3k Views
    D
    Please use @ tags as Andre recommended you in another post. BTW, why do use Q3* classes? Maybe you can avoid them and use ones that are not obsolete?
  • 0 Votes
    2 Posts
    2k Views
    A
    Perhaps use a custom delegate?
  • Need help in using graphicsView

    9
    0 Votes
    9 Posts
    3k Views
    J
    I apply this method to the code, but still I have a problem. When I press over an empty graphicsView a get the coordinates correctly. But when I load a png image in the graphics view, when I press on the image, the coordinates don't change and remain the same.Do you have something to suggest about this problem? Thanks
  • Gradient drawing in SvgGenerator

    2
    0 Votes
    2 Posts
    2k Views
    A
    I'd say: bug. File a report, with a simple testcase please.
  • How to replace a particular text in a file located at any place..?

    4
    0 Votes
    4 Posts
    3k Views
    G
    Read the file completely into memory, change the content and then write again. Or create a temporary second file, read the original, change the text and write to the second one.
  • QTable that is a QSplitter child does not show vertical scrollbar

    5
    0 Votes
    5 Posts
    3k Views
    S
    Thanks a lot, it works now :)
  • Rounded Corner Tooltips

    3
    0 Votes
    3 Posts
    6k Views
    D
    I'm using Qt opensource sdk 4.7.0. I tried the example on both Ubuntu 10.10 and Meego. With your given code, the ToolTip also displayed in rectangle on Ubuntu 10.10. Thanks.
  • Opengl rendering loop

    6
    0 Votes
    6 Posts
    4k Views
    B
    depends on your application. if it is a game, i will do the same, but if it is a 3d application, i.e. a 2d modeler, you probably want to update the scene when your scene has changed. for example when window is resized or mouse dragged.
  • Use changed spinbox-value in another void-function

    11
    0 Votes
    11 Posts
    4k Views
    V
    Your welcome. I am glad that you solved the problem finally!
  • [SOLVED] List operations

    10
    0 Votes
    10 Posts
    15k Views
    D
    Okay, it was the max which dumped something else, thx!
  • Gradient Buttons (+/-) for lists on Mac OS X, others

    4
    0 Votes
    4 Posts
    3k Views
    S
    When there are several buttons in a strip of gradient buttons on OS X, they have a single-line frame between them. Because of that, they look like segments of a single control. To make this kind of buttons, I used QToolButton (not a QToolBar, just buttons in layouts), and styled them. I used 4 styles: the first (left) button in a strip. buttons in the middle in a strip. the last (right) button in a strip. a standalone button. These 4 styles draw different frames. This is what I did: A fragment of the style that I assign to the instance of QApplication (these styles use stretchable images that you need to draw or grab from OS X) @// // == QToolButton: segmented // "QToolButton[sgm_single="true"] { " " border-width: 4px; " " border-image: url(:/img/BPicTbrSUp.png) 4 4 4 4 ; " "} " "QToolButton[sgm_single="true"]:pressed { " " border-width: 4px; " " border-image: url(:/img/BPicTbrSDown.png) 4 4 4 4 ; " "} " "QToolButton[sgm_left="true"] { " " border-width: 4px; " " border-image: url(:/img/BPicTbrLUp.png) 4 4 4 4 ; " "} " "QToolButton[sgm_left="true"]:pressed { " " border-width: 4px; " " border-image: url(:/img/BPicTbrLDown.png) 4 4 4 4 ; " "} " "QToolButton[sgm_left="true"]:checked { " " border-width: 4px; " " border-image: url(:/img/BPicTbrLChecked.png) 4 4 4 4 ; " " color: white; " "} " "QToolButton[sgm_middle="true"] { " " border-width: 4px; " " border-image: url(:/img/BPicTbrMUp.png) 4 4 4 4 ; " "} " "QToolButton[sgm_middle="true"]:pressed { " " border-width: 4px; " " border-image: url(:/img/BPicTbrMDown.png) 4 4 4 4 ; " "} " "QToolButton[sgm_middle="true"]:checked { " " border-width: 4px; " " border-image: url(:/img/BPicTbrMChecked.png) 4 4 4 4 ; " " color: white; " "} " "QToolButton[sgm_right="true"] { " " border-width: 4px; " " border-image: url(:/img/BPicTbrRUp.png) 4 4 4 4 ; " "} " "QToolButton[sgm_right="true"]:pressed { " " border-width: 4px; " " border-image: url(:/img/BPicTbrRDown.png) 4 4 4 4 ; " "} " "QToolButton[sgm_right="true"]:checked { " " border-width: 4px; " " border-image: url(:/img/BPicTbrRChecked.png) 4 4 4 4 ; " " color: white; " "} " @ In a constructor of a dialog with these special buttons @ // a single button ui->btnWkPerfInfo->setProperty("sgm_single", true); // // 3 buttons in a strip ui->btnDayAdd->setProperty("sgm_left", true); ui->btnDayCopy->setProperty("sgm_middle", true); ui->btnDayDelete->setProperty("sgm_right", true); @
  • Subclassing widget to take coordinates

    5
    0 Votes
    5 Posts
    2k Views
    J
    When I mahe this change the .exe file stops working when I prees over the image, when I have already opened it. Is there any good example to get coordinates of an image using QGraphicsView? ////// .h ////////// @class graphicsView : public QGraphicsScene { public: graphicsView( QObject *parent = 0); protected: void mouseMoveEvent ( QMouseEvent * event ); };@ ///////// .cpp /////////// @graphicsView::graphicsView( QObject *parent ) : QGraphicsScene( parent ) { } void QGraphicsView::mouseMoveEvent ( QMouseEvent * event ) { QPointF pos = event->pos(); double x = pos.x(); double y = pos.y(); int k=3; QLabel *label_value_x; QLabel *label_value_y; label_value_x->setNum(x); label_value_y->setNum(y); }@
  • Problem in setting stylesheet

    6
    0 Votes
    6 Posts
    3k Views
    S
    The fact that an enum is used in a switch case should not cause any problems per say. Can you post a stand alone, small example that shows the problem? That way, we can reproduce the problem and investigate what the cause can be.
  • To render 3d object loadded into Qt3d what free engine should i use ?

    4
    0 Votes
    4 Posts
    3k Views
    Z
    "Let me google that for you":http://lmgtfy.com/?q=opengl+reflection
  • No Matching Function for call to run int!

    4
    0 Votes
    4 Posts
    6k Views
    S
    Geroif and Franzk I appreciate your concern, I really do. Geroif: The good thing is after applying the rectification you have pointed out for argument passing, my program compiled without any error :) but the bad think is its still working in blocking mode destroying my very purpose of exciting that function on separate thread. I followed the documentation and your absolutely right about using QThread. But the thing is iam not that much vigilant to grasp it by myself since the QThread class is to be built in header file (as far as ive observed) this will require my Function implementation inside void Run() to have global variables so that i can pass result through to my main program. Can you plz guide me in the right direction! Regards.
  • Does try finally statement work???

    11
    0 Votes
    11 Posts
    12k Views
    A
    With a bit of template magic, you can make a RAII class that you can use for more than one purpose. Still, even without that, it can make perfect sense to create a RAII class that you only use at a single place. It is not like they take a lot of code to write, just a few lines usually does it. If you end up with code like Eonz showed before: @ void otherProc() { mutex.lock(); if (condition1Passes) { if (condition2Passes) { if (condition3Passes) doStuffSafely(); else mutex.unlock(); } else mutex.unlock(); } else mutex.unlock(); } @ you know you need a RAII class to make this readable and maintainable again. There is one ready made for mutexes, but they also make perfect sense for many other cases too.
  • QFrame: want no background

    6
    0 Votes
    6 Posts
    9k Views
    B
    My final solution was to use stylesheet attribute "border-image:none;"
  • [Solved] Mouse wheel problem

    2
    0 Votes
    2 Posts
    7k Views
    T
    Ah sorry! it was a problem in my OpenGL code!!! I just noticed it! I'll keep the code for future reference :-) Thanks for even reading this :-)