Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • How to implement transparent pencil tool in Qt? [pic link updated]

    9
    0 Votes
    9 Posts
    9k Views
    L
    [quote author="utcenter" date="1340915293"]Hehe, looks like you discovered accidental art, looking at the resulting pattern. It is either an issue of color indexing or you need to add some more parenthesis to make sure you get a value in the range of 0-255 before you multiply it by the transparency and set it as alpha value. [/quote] But the art also makes me puzzled... I replaced your way of read alpha value from this: @qAbs((int)test.pixel(iX, iY)-255)@ to this: @(255-qGray(test.pixel(iX, iY)))*0.3; // 0.3 is the transparency@ Now everything woks fine^^ Thanks again!
  • Qt, Linux, check if a given user has sudo privileges

    10
    0 Votes
    10 Posts
    18k Views
    napajejenunedk0N
    @ChrisW67: I have tried this solution already. Calling sudo -l requests for sudo password.
  • QEvent and notify()

    5
    0 Votes
    5 Posts
    8k Views
    A
    It is actually the mechamism behind cross-thread signals and slots. However, only use QCoreApplication::postEvent, not the sendEvent variant.
  • Resizing widgets using drag & drop

    2
    0 Votes
    2 Posts
    3k Views
    A
    That isn't standard functionality. It will take quite a bit of programming to get this to work properly.
  • Custom QLineEdit Selection Highlight

    9
    0 Votes
    9 Posts
    7k Views
    A
    [quote author="Plissken" date="1341420919"]I've created a stylesheet to create black line (actually, just the bottom border visible) for text. However, there is a gap between the baseline of the characters and the line itself. Is there anyway to shift the characters to rest right on the line?[/quote] Sure there is: try playing around with the padding. You can try setting the bottom padding to a negative value.
  • Learning Qt Step by step

    12
    0 Votes
    12 Posts
    14k Views
    A
    sorry this topic posted one year ago!!
  • Compile Qt Resources into a dll?

    4
    0 Votes
    4 Posts
    3k Views
    T
    tucnak: Resources are read only, there is no need to worry about them getting changed:-) Qt Creator plugins tend to each have their own set of resources. Since each plugin is essentially a library that seems to work fine:-)
  • What database and why?

    11
    0 Votes
    11 Posts
    4k Views
    D
    I do understand French though the topic is not about knowing how to use queries it's how to compile the drivers of MySQL for QT, but thanks anyways. [quote author="issam" date="1341397726"]Hi dsylebee. If you understand french, see this simple tutorial : http://www.siteduzero.com/tutoriel-3-267200-maitrisez-les-bases-de-donnees-avec-qtsql.html good luck ![/quote]
  • 0 Votes
    4 Posts
    10k Views
    M
    Ok, I solved it by not using real checkboxes at all, now I'm just returning the correct checkbox-icon in data() and nothing for CheckStateRole. I had to connect the clicked-signal from the view with an own slot in my model which implements the checkbox-behaviour... If somebody has a better idea, Id appreciate to hear it ;) But for now this problem is solved...
  • Why XMLHttpRequest doesn't support PROPFIND method?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Accessing the C++ code of objects created in Designer?

    4
    0 Votes
    4 Posts
    2k Views
    S
    If you want more control over how the UI elements are created you could just create them directly in your code; you don't have to use the designer. If you don't already have it, the book 'C++ GUI Programming with Qt4' covers this approach in some detail. More information here: http://www.qtrac.eu/marksummerfield.html
  • 0 Votes
    5 Posts
    2k Views
    S
    @Andre Thanks for your valuable reply, Sir. I am looking forward to this interesting environment :) @notgary Thanks for guidance, sir. As advised, I am going through Getting started, but when ever I am stuck, I will seek help. I have taken Qt as SDK and my project is a mini project in C++ for my academic purpose. Thanks :)
  • Building Qt Statically

    10
    0 Votes
    10 Posts
    10k Views
    R
    Hi, It seems that the problem may with the PATH variable or with the mingw installed with the QtSDK. I added the following path C:\QtSDK\QtSources\static\bin;C:\QtSDK\mingw\bin And when running minggw32-make, it first tries to run the uic.exe from the path C:\QtSDK\QtSources\4.8.1\bin, but these are actually reside in the directory C:\QtSDK\QtSources\static\bin , why this problem? may be we make qt from a different director?
  • How to use common enum in both C++ and qml.??

    5
    0 Votes
    5 Posts
    3k Views
    B
    So OK the moc does not preprocess my macro apparently, and therefore the Q_ENUMS does not know about MyEnum while the moc is preprocessing it. But what is the solution then? Bill
  • List of all the standard shortcuts[Solved]

    4
    0 Votes
    4 Posts
    3k Views
    sierdzioS
    Great! If that solves the issue for you, please prepend "[Solved]" to topic's title.
  • Right to Left GUI application not showing dynamic text correctly

    1
    0 Votes
    1 Posts
    786 Views
    No one has replied
  • Block user's desktop on Windows in Qt

    5
    0 Votes
    5 Posts
    2k Views
    M
    [quote author="john_god" date="1341390413"]In windows to restrain the user to use only one application, you have to use a combination of admin policies and regedit options.[/quote]
  • Qmake generates wrong paths in the uninstall section

    1
    0 Votes
    1 Posts
    999 Views
    No one has replied
  • 0 Votes
    9 Posts
    8k Views
    K
    [quote author="Andre" date="1341390491"]Back on topic: I don't think you'll see much happening. First of all, you completely overrode the painting of the whole dialog. So, perhaps you'll see a small dot, but not much else being painted. Make sure to (in this case: first) call the base implementation: @ QDialog::paintEvent(paintEvent); @ Then, on the dot you draw itself. I doubt you'll even see that. The problem is: you are painting it right at the mouse cursor. And what is that spot overdrawn with? Exactly: the mouse cursor. [/quote] Nice analysis Andre [quote author="W.K.S" date="1341338884"]Thanks to both of you. You're right koahnig - I failed to check that the paintEvent() is actually called and that's where the problem was. Thanks a lot :) [/quote] Now I am wondering why it might have worked ?
  • [solved]qt crashes on running QSqlQuery::exec()

    7
    0 Votes
    7 Posts
    4k Views
    L
    You're welcome. Feel free to prepend the post title with [Solved] (just edit your initial post), as an indication that your problem has been solved and that there is a solution inside.