Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. SVG wont load from qrc on Android
Forum Updated to NodeBB v4.3 + New Features

SVG wont load from qrc on Android

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 1 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jon Heron1
    wrote on last edited by Jon Heron1
    #1

    G'Day!
    I am trying to get my old widget app going on Android, currently its working well on bb10 and linux desktop.
    I made custom buttons for my QSpinboxes and QTabWidget to make them usable on the BB10 with svg images. They work great on the BB10 and the desktop but no joy on droid (Qt5.4 Droid 4.3).
    I set them up via the QTabwidgets stylesheet from properties of the UI editor like this:
    '
    QDoubleSpinBox{
    height:6ex;
    }
    QDoubleSpinBox::up-button {
    width: 6ex;
    background-color: "light grey";
    image: url(:/prefix1/images/upArrow.svg);
    }
    QDoubleSpinBox::down-button {
    width: 6ex;
    background-color: "light grey";
    image: url(:/prefix1/images/downArrow.svg);
    }
    QTabBar QToolButton {
    border-width: 5px;
    padding:6px
    }
    QTabBar QToolButton::right-arrow {
    image: url(:/prefix1/images/rightArrowG.svg);
    background-color: "light gray";
    }
    QTabBar QToolButton::left-arrow {
    image: url(:/prefix1/images/leftArrowG.svg);
    background-color: "light gray";
    }
    QTabBar::tab{
    height: 6ex;
    border: 2px solid #C4C4C3;
    border-bottom-color: #C2C7CB; /* same as the pane color /
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    min-width: 8ex;
    padding: 2px;
    }
    QTabBar::scroller{
    width: 7ex;
    border-width: 6ex;
    }
    QTabBar::tab:selected, QTabBar::tab:hover {
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
    stop: 0 #fafafa, stop: 0.4 #f4f4f4,
    stop: 0.5 #e7e7e7, stop: 1.0 #fafafa);
    }
    QTabBar::tab:selected {
    border-color: #9B9B9B;
    border-bottom-color: #C2C7CB; /
    same as pane color */
    }
    '
    And my .pro file looks like this:
    [code]
    #-------------------------------------------------

    Project created by QtCreator 2010-12-03T20:30:29

    #-------------------------------------------------

    QT += core gui widgets svg
    TARGET = Bio_Brewers_tools
    TEMPLATE = app

    SOURCES += main.cpp
    biologger.cpp
    aboutdialog.cpp

    HEADERS += biologger.h
    aboutdialog.h

    FORMS += biologger.ui
    aboutDialog.ui

    CONFIG += qt

    RESOURCES +=
    bioCalc.qrc
    RC_FILE = bioLogger.rc

    OTHER_FILES +=
    bar-descriptor.xml
    [/code]
    (What happened to the code tags buttons etc?)
    But the images never get loaded, the spinboxes do not appear at all and the tab's on the tabWidget are collapsed I assume all due to the images not getting loaded.
    Any insight or advice as to where I am going wrong here would be appreciated!
    Cheers,
    Jon

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jon Heron1
      wrote on last edited by Jon Heron1
      #2

      Well it appears its the code in my stylesheet that is causing the problem, not the svg images after all.
      If I remove the stylesheet code altogether it runs fine on the droid with the same ol Qt widget styling.
      If I edit out the svg images from the stylesheet it behaves the same way as above in that the tabs and spin boxes don't appear.
      Can anybody see whats wrong with my style sheet code above when it comes to Android?
      Perhaps its because I am implementing it from the UI editor for the tab widget and I should be implementing it from main.cpp as I see is sometimes recommended while I was researching this problem? Grasping at straws here... :)
      Perhaps this is a bug...
      Cheers,
      Jon

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jon Heron1
        wrote on last edited by
        #3

        Bug filed.
        https://bugreports.qt.io/browse/QTBUG-45517
        Cheers,
        Jon

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved