Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Designer Plugin get location of project folder
Forum Updated to NodeBB v4.3 + New Features

Qt Designer Plugin get location of project folder

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 144 Views
  • 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.
  • M Offline
    M Offline
    Mike96
    wrote on 20 Feb 2025, 19:24 last edited by
    #1

    Does anyone know how to get the directory of the current project to use with a Qt Designer Plugin?

    The problem I am trying to solve:

    I have a plugin that loads a "css" file into the form using:

    auto* form_window = QDesignerFormWindowInterface::findFormWindow(static_cast<QStackedWidget*>(this));
    QFile file(":css/custom.css");
    file.open(QIODevice::ReadONly);
    QString css = file.readAll();
    form_window->setStyleSheet(css);
    

    This makes it so I can have one style sheet and keep it as its own file, making the style much easier to maintain.

    This works great, but if I change the css file, I have to close and re-open designer to get the new css. I tried adding a watch to the ":css/custom_css" but it seems watching a resource path (i.e. using ":/...", with the resource in a "resources.qrc" file) does not work, as nothing happened when I changed the css file.

    To solve this, I want to watch the actual css file and not the "resource".

    If someone knows a better way of achieving what I want, I am all for that too.

    1 Reply Last reply
    0

    1/1

    20 Feb 2025, 19:24

    • Login

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