Results 1 to 4 of 4

Thread: Three questions : mainwindow background image,case sensitivity and push button image

  1. #1

    Default Three questions : mainwindow background image,case sensitivity and push button image

    Hello,

    I have three questions
    1st one :
    how to put an image as the background image for an application mainwindow ? I created a folder on the application directory and I called it "images" and then I put the image on it and renamed it "image.png" then I tried this code but didn't work
    Qt Code:
    1. MainWindow::setStyleSheet("background-image:url(:/images/image.png");
    To copy to clipboard, switch view to plain text mode 

    the 2nd question :
    when I tried to write the following code on the header I had a problem with the case sensitivity part
    Qt Code:
    1. signals:
    2. void findtext(const QString & str ,qt::casesensitivity cs);
    To copy to clipboard, switch view to plain text mode 
    according to the book that am learning from when I write qt then "::" a list appear to me and I supposed to find on that last "casesensitivity" but that doesn't happen to me ,I mean I don't find the casesensitivity on the list.
    is there a class that I should include on the header to make "casesensitivity" appear on the list or what?

    the 3rd question is I created an image of a close button on photoshop and I want the close button on my application to be that image ,how to do that?
    un2.png

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Three questions : mainwindow background image,case sensitivity and push button im

    1st: I can assume that you don't use qrc, that's way Qt can't resolve resource. see The Qt Resource System.
    2nd: correct spelling of the enum is Qt::CaseSensitivity enum.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3

    Default Re: Three questions : mainwindow background image,case sensitivity and push button im

    Quote Originally Posted by spirit View Post
    1st: I can assume that you don't use qrc, that's way Qt can't resolve resource. see The Qt Resource System.
    2nd: correct spelling of the enum is Qt::CaseSensitivity enum.
    Thank you ,I used qrc and now the image appear but the problem now is that the image is appearing as a tile I mean its repeating itself all over the form .How can I make it appear normally ?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Three questions : mainwindow background image,case sensitivity and push button im

    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. adding image and text both to a push button
    By Charvi in forum Qt Programming
    Replies: 5
    Last Post: 3rd August 2012, 08:44
  2. Push Button with image?
    By steve.bush in forum Newbie
    Replies: 10
    Last Post: 18th March 2011, 06:48
  3. MainWindow Background-Image issues
    By BingoMaster in forum Newbie
    Replies: 2
    Last Post: 5th November 2009, 17:22
  4. problem in Displaying image on push button
    By durgarao in forum Qt Tools
    Replies: 4
    Last Post: 2nd January 2009, 10:27
  5. Replies: 5
    Last Post: 10th April 2008, 09:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.